diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs | 10 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs | 11 |
2 files changed, 12 insertions, 9 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs index a1af09c25c..934c975f87 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs @@ -159,7 +159,7 @@ namespace MonoDevelop.Ide.Navigation return point; } - IEditableTextBuffer editBuf = doc.GetContent<IEditableTextBuffer> (); + var editBuf = doc.Editor; if (editBuf != null) { point = new TextFileNavigationPoint (doc, editBuf); if (point != null) @@ -291,8 +291,8 @@ namespace MonoDevelop.Ide.Navigation currentDoc.Closed += HandleCurrentDocClosed; if (currentDoc.Editor != null) { - currentDoc.Editor.Document.TextReplaced += BufferTextChanged; - currentDoc.Editor.Caret.PositionChanged += BufferCaretPositionChanged; + currentDoc.Editor.TextChanged += BufferTextChanged; + currentDoc.Editor.CaretPositionChanged += BufferCaretPositionChanged; } } @@ -308,8 +308,8 @@ namespace MonoDevelop.Ide.Navigation currentDoc.Closed -= HandleCurrentDocClosed; if (currentDoc.Editor != null) { - currentDoc.Editor.Document.TextReplaced -= BufferTextChanged; - currentDoc.Editor.Caret.PositionChanged -= BufferCaretPositionChanged; + currentDoc.Editor.TextChanged -= BufferTextChanged; + currentDoc.Editor.CaretPositionChanged -= BufferCaretPositionChanged; } currentDoc = null; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs index 82087312c9..d17c03e0c9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs @@ -31,6 +31,7 @@ using System; using MonoDevelop.Ide.Gui.Content; using MonoDevelop.Core; using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Editor; namespace MonoDevelop.Ide.Navigation { @@ -39,10 +40,12 @@ namespace MonoDevelop.Ide.Navigation int line; int column; - public TextFileNavigationPoint (Document doc, IEditableTextBuffer buffer) + public TextFileNavigationPoint (Document doc, TextEditor buffer) : base (doc) { - buffer.GetLineColumnFromPosition (buffer.CursorPosition, out line, out column); + var location = buffer.CaretLocation; + line = location.Line; + column = location.Column; } public TextFileNavigationPoint (FilePath file, int line, int column) @@ -79,11 +82,11 @@ namespace MonoDevelop.Ide.Navigation { Document doc = base.DoShow (); if (doc != null) { - IEditableTextBuffer buf = doc.GetContent<IEditableTextBuffer> (); + var buf = doc.Editor; if (buf != null) { doc.DisableAutoScroll (); buf.RunWhenLoaded (() => { - buf.SetCaretTo (Math.Max (line, 1), Math.Max (column, 1)); + buf.SetCaretLocation (Math.Max (line, 1), Math.Max (column, 1)); }); } } |