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