Browse Source

Fixed Forum-5038: using "Go to line number" does not clear the selection.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1106 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
2e030b8b2a
  1. 4
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Caret.cs
  2. 3
      src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs

4
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Caret.cs

@ -146,7 +146,7 @@ namespace ICSharpCode.TextEditor @@ -146,7 +146,7 @@ namespace ICSharpCode.TextEditor
int line = Math.Max(0, Math.Min(textArea.Document.TotalNumberOfLines - 1, pos.Y));
int column = Math.Max(0, pos.X);
if (!textArea.TextEditorProperties.AllowCaretBeyondEOL) {
if (column == int.MaxValue || !textArea.TextEditorProperties.AllowCaretBeyondEOL) {
LineSegment lineSegment = textArea.Document.GetLineSegment(line);
column = Math.Min(column, lineSegment.Length);
}
@ -162,7 +162,7 @@ namespace ICSharpCode.TextEditor @@ -162,7 +162,7 @@ namespace ICSharpCode.TextEditor
line = Math.Max(0, Math.Min(textArea.Document.TotalNumberOfLines - 1, line));
column = Math.Max(0, column);
if (!textArea.TextEditorProperties.AllowCaretBeyondEOL) {
if (column == int.MaxValue || !textArea.TextEditorProperties.AllowCaretBeyondEOL) {
LineSegment lineSegment = textArea.Document.GetLineSegment(line);
column = Math.Min(column, lineSegment.Length);
}

3
src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs

@ -363,8 +363,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -363,8 +363,7 @@ namespace ICSharpCode.SharpDevelop.Gui
TextEditorControl editor = GetEditor();
if (editor != null) {
int i = Math.Min(editor.Document.TotalNumberOfLines, Math.Max(1, (int)tag));
editor.ActiveTextAreaControl.Caret.Line = i - 1;
editor.ActiveTextAreaControl.ScrollToCaret();
editor.ActiveTextAreaControl.JumpTo(i - 1, int.MaxValue);
}
} else if (tag is IClass) {
IClass c = tag as IClass;

Loading…
Cancel
Save