aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 6a588e12..acf60905 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -398,7 +398,7 @@ impl EditorView {
// TODO: set cursor position for IME
if let Some(syntax) = doc.syntax() {
use helix_core::match_brackets;
- let pos = doc.selection(view.id).cursor();
+ let pos = doc.selection(view.id).cursor(doc.text().slice(..));
let pos = match_brackets::find(syntax, doc.text(), pos)
.and_then(|pos| view.screen_coords_at_pos(doc, text, pos));
@@ -443,7 +443,7 @@ impl EditorView {
widgets::{Paragraph, Widget},
};
- let cursor = doc.selection(view.id).cursor();
+ let cursor = doc.selection(view.id).cursor(doc.text().slice(..));
let diagnostics = doc.diagnostics().iter().filter(|diagnostic| {
diagnostic.range.start <= cursor && diagnostic.range.end >= cursor
@@ -555,7 +555,10 @@ impl EditorView {
// _ => "indent:ERROR",
// };
let position_info = {
- let pos = coords_at_pos(doc.text().slice(..), doc.selection(view.id).cursor());
+ let pos = coords_at_pos(
+ doc.text().slice(..),
+ doc.selection(view.id).cursor(doc.text().slice(..)),
+ );
format!("{}:{}", pos.row + 1, pos.col + 1) // convert to 1-indexing
};