[Monodevelop-patches-list] r689 - in trunk/MonoDevelop/src/AddIns/DisplayBindings: SourceEditor/Gui TextEditor/Gui/Dialogs
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Jan 27 19:10:42 EST 2004
Author: benm
Date: 2004-01-27 19:10:42 -0500 (Tue, 27 Jan 2004)
New Revision: 689
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs
Log:
fixup the jumping function, it played around with selection bounds; make GoTo independant of the editor binding. Yes, I tested; Both ;-).
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs 2004-01-28 00:01:11 UTC (rev 688)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs 2004-01-28 00:10:42 UTC (rev 689)
@@ -98,7 +98,9 @@
TextIter itr = se.Buffer.GetIterAtLine (line);
itr.LineOffset = column;
- se.Buffer.MoveMark (se.Buffer.InsertMark, itr);
+ se.Buffer.MoveMark (se.Buffer.InsertMark, itr);
+ se.Buffer.MoveMark (se.Buffer.SelectionBound, itr);
+
se.View.ScrollMarkOnscreen (se.Buffer.InsertMark);
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs 2004-01-28 00:01:11 UTC (rev 688)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs 2004-01-28 00:10:42 UTC (rev 689)
@@ -19,6 +19,9 @@
using Gtk;
using Glade;
+// TODO: this dialog should be moved to the core, as it has no deps
+// on this binding.
+
namespace ICSharpCode.SharpDevelop.Gui.Dialogs
{
public class GotoLineNumberDialog
@@ -56,12 +59,10 @@
IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
- if (window != null && window.ViewContent is ITextEditorControlProvider) {
- TextEditorControl textarea = ((ITextEditorControlProvider)window.ViewContent).TextEditorControl;
-
- int i = Math.Min(textarea.Document.TotalNumberOfLines, Math.Max(1, Int32.Parse(line_number_entry.Text)));
- textarea.ActiveTextAreaControl.Caret.Line = i - 1;
- textarea.ActiveTextAreaControl.ScrollToCaret();
+ if (window != null && window.ViewContent is IPositionable) {
+ int l = Math.Max (0, Int32.Parse(line_number_entry.Text) - 1);
+
+ ((IPositionable) window.ViewContent).JumpTo (l, 0);
}
} catch (Exception) {
More information about the Monodevelop-patches-list
mailing list