You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-view/src
Pascal Kuthe 72b9311678 fix view anchors not at start of a visual line
The top of a view is marked by a char idx anchor. That char idx is
usually the first character of the visual line it's on. We use a char
index instead of a line index because the view may start in the middle
of a line with soft wrapping. However, it's possible to temporarily
endup in a state where this anchor is not the first character of the
first visual line. This is pretty rare because edits usually happen
inside/after the view. In most cases we handle this case correctly.

However, if the cursor is before the anchor (but still in view)
there can be crashes or visual artifacts. This is caused by the fact
that visual_offset_from_anchor (and the positioning code in view.rs)
incorrectly assumed that the (cursor) position is always after the
view anchor if the cursor is in view. But if the anchor is not the
first character of the first visual line this is not the case anymore.

In that case crashes and visual artifacts are possible. This commit
fixes that problem by changing `visual_offset_from_anchor` (and
callsites) to properly consider that case.
2 years ago
..
handlers feat(dap): send Disconnect if Terminated event received (#5532) 2 years ago
base64.rs Fix new clippy lints (#5892) 2 years ago
clipboard.rs Fix new clippy lints (#5892) 2 years ago
document.rs Improved file reload error message (#6274) 2 years ago
editor.rs Add undercurl config option #6196 (#6253) 2 years ago
env.rs Use OSC 52 as a fallback for setting the system clipboard (#3220) 2 years ago
graphics.rs build(deps): bump bitflags from 1.3.2 to 2.0.2 (#6387) 2 years ago
gutter.rs Add command for resetting diff hunks (#5736) 2 years ago
info.rs fix: remove unneeded allocations when calling helix_view::Info::new 2 years ago
input.rs Fix new clippy lints (#5892) 2 years ago
keyboard.rs build(deps): bump bitflags from 1.3.2 to 2.0.2 (#6387) 2 years ago
lib.rs rework positioning/rendering and enable softwrap/virtual text (#5420) 2 years ago
macros.rs Apply transactions to all views (#4733) 2 years ago
theme.rs Generalised to multiple runtime directories with priorities (#5411) 2 years ago
tree.rs Feat: LSP Type Hints (#5934) 2 years ago
view.rs fix view anchors not at start of a visual line 2 years ago