aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/view.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/view.rs')
-rw-r--r--helix-view/src/view.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index 8a7d3374..ee236e94 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -2,10 +2,9 @@ use std::borrow::Cow;
use crate::{graphics::Rect, Document, DocumentId, ViewId};
use helix_core::{
- coords_at_pos,
graphemes::{grapheme_width, RopeGraphemes},
line_ending::line_end_char_index,
- Position, RopeSlice, Selection,
+ visual_coords_at_pos, Position, RopeSlice, Selection,
};
type Jump = (DocumentId, Selection);
@@ -91,7 +90,10 @@ impl View {
.selection(self.id)
.primary()
.cursor(doc.text().slice(..));
- let Position { col, row: line } = coords_at_pos(doc.text().slice(..), cursor);
+
+ let Position { col, row: line } =
+ visual_coords_at_pos(doc.text().slice(..), cursor, doc.tab_width());
+
let inner_area = self.inner_area();
let last_line = (self.offset.row + inner_area.height as usize).saturating_sub(1);