Browse Source

Fixed caret position after leaving snippet mode.

pull/14/head
Daniel Grunwald 15 years ago
parent
commit
e1a9ec1c9b
  1. 1
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetCaretElement.cs

1
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/SnippetCaretElement.cs

@ -23,6 +23,7 @@ namespace ICSharpCode.AvalonEdit.Snippets @@ -23,6 +23,7 @@ namespace ICSharpCode.AvalonEdit.Snippets
internal static void SetCaret(InsertionContext context)
{
TextAnchor pos = context.Document.CreateAnchor(context.InsertionPosition);
pos.MovementType = AnchorMovementType.BeforeInsertion;
pos.SurviveDeletion = true;
context.Deactivated += (sender, e) => {
if (e.Reason == DeactivateReason.ReturnPressed || e.Reason == DeactivateReason.NoActiveElements) {

Loading…
Cancel
Save