Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit f69ce55

Browse files
fix bug in InsertWithCursor: should not scroll to top after start of InsertWithCursor-mode
1 parent 7c40540 commit f69ce55

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/EditorScript.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ void InsertWithCursorOnLayer(EditorScript currentScript, InsertionCursorLayer la
152152
if (doc != null) {
153153
doc.UndoStack.Push(op);
154154
}
155+
layer.ScrollToInsertionPoint();
155156
layer.Exited += delegate(object s, InsertionCursorEventArgs args) {
156157
doc.UndoStack.StartContinuedUndoGroup();
157158
try {

src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertionCursorLayer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public InsertionCursorLayer(TextArea editor, string operation, IList<InsertionPo
6565
this.editor.TextView.InsertLayer(this, KnownLayer.Text, LayerInsertionPosition.Above);
6666
this.editor.TextView.ScrollOffsetChanged += TextViewScrollOffsetChanged;
6767
AddGroupBox();
68-
ScrollToInsertionPoint();
6968
}
7069

7170
static readonly Pen markerPen = new Pen(Brushes.Blue, 2);
@@ -246,7 +245,7 @@ void InsertCode(object sender, ExecutedRoutedEventArgs e)
246245
FireExited(true);
247246
}
248247

249-
void ScrollToInsertionPoint()
248+
internal void ScrollToInsertionPoint()
250249
{
251250
var location = insertionPoints[CurrentInsertionPoint].Location;
252251
editor.GetService<TextEditor>().ScrollTo(location.Line, location.Column);

0 commit comments

Comments
 (0)