Skip to content

Commit

Permalink
Merge pull request #40 from danwalmsley/snippet-returns-context
Browse files Browse the repository at this point in the history
Snippet returns context
  • Loading branch information
danwalmsley authored Jul 20, 2017
2 parents 6f2b994 + 150c077 commit 161fdc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/AvaloniaEdit/Snippets/Snippet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Snippet : SnippetContainerElement
/// <summary>
/// Inserts the snippet into the text area.
/// </summary>
public void Insert(TextArea textArea)
public InsertionContext Insert(TextArea textArea)
{
if (textArea == null)
throw new ArgumentNullException(nameof(textArea));
Expand All @@ -53,6 +53,8 @@ public void Insert(TextArea textArea)
Insert(context);
context.RaiseInsertionCompleted(EventArgs.Empty);
}

return context;
}
}
}
1 change: 1 addition & 0 deletions src/AvaloniaEdit/Snippets/SnippetBoundElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private void targetElement_TextChanged(object sender, EventArgs e)

public void Deactivate(SnippetEventArgs e)
{
TargetElement.TextChanged -= targetElement_TextChanged;
}

public bool IsEditable => false;
Expand Down

0 comments on commit 161fdc9

Please sign in to comment.