summaryrefslogtreecommitdiff
path: root/helix-core/src/movement.rs
diff options
context:
space:
mode:
authorIvan Tham2021-11-03 03:02:29 +0000
committerGitHub2021-11-03 03:02:29 +0000
commit3eb829e2330fed5ad1c095f8bba44f62361b4943 (patch)
tree400ee47dd753eb318774f9ab02934f0e70b92597 /helix-core/src/movement.rs
parentee889aaa854d0036da3bae16252bc382e50b0df6 (diff)
Ensure coords in screen depends on char width (#885)
The issue affected files with lots of tabs at the start as well. Fix #840
Diffstat (limited to 'helix-core/src/movement.rs')
-rw-r--r--helix-core/src/movement.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-core/src/movement.rs b/helix-core/src/movement.rs
index 5d080545..9e85bd21 100644
--- a/helix-core/src/movement.rs
+++ b/helix-core/src/movement.rs
@@ -53,6 +53,10 @@ pub fn move_vertically(
let pos = range.cursor(slice);
// Compute the current position's 2d coordinates.
+ // TODO: switch this to use `visual_coords_at_pos` rather than
+ // `coords_at_pos` as this will cause a jerky movement when the visual
+ // position does not match, like moving from a line with tabs/CJK to
+ // a line without
let Position { row, col } = coords_at_pos(slice, pos);
let horiz = range.horiz.unwrap_or(col as u32);