Skip to content

Commit

Permalink
clear line annotations outside of move_vertically/_visual
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDickie committed Aug 20, 2023
1 parent d23a9a4 commit 1df3fef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions helix-core/src/movement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ pub fn move_vertically_visual(
if !text_fmt.soft_wrap {
return move_vertically(slice, range, dir, count, behaviour, text_fmt, annotations);
}
annotations.clear_line_annotations();
let pos = range.cursor(slice);

// Compute the current position's 2d coordinates.
Expand Down Expand Up @@ -112,7 +111,6 @@ pub fn move_vertically(
text_fmt: &TextFormat,
annotations: &mut TextAnnotations,
) -> Range {
annotations.clear_line_annotations();
let pos = range.cursor(slice);
let line_idx = slice.char_to_line(pos);
let line_start = slice.line_to_char(line_idx);
Expand Down
1 change: 1 addition & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ fn move_impl(cx: &mut Context, move_fn: MoveFn, dir: Direction, behaviour: Movem
let text = doc.text().slice(..);
let text_fmt = doc.text_format(view.inner_area(doc).width, None);
let mut annotations = view.text_annotations(doc, None);
annotations.clear_line_annotations();

let selection = doc.selection(view.id).clone().transform(|range| {
move_fn(
Expand Down

0 comments on commit 1df3fef

Please sign in to comment.