Skip to content

Commit

Permalink
issue 403: Editor selection no longer shows selection on empty lines (#…
Browse files Browse the repository at this point in the history
…708)

* issue 403: Editor selection no longer shows selection on empty lines

* issue 403: Editor selection no longer shows selection on empty lines

* issue 403: Editor selection no longer shows selection on empty lines
  • Loading branch information
KhodyrevDS authored Dec 13, 2024
1 parent bd92509 commit b2fe244
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/views/editor/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,13 @@ impl EditorView {
ed.last_col(info, true)
};

let line_height = f64::from(ed.line_height(line));

// Skip over empty selections
if !info.is_empty_phantom() && left_col == right_col {
let rect = Rect::from_origin_size((0.0, vline_y), (CHAR_WIDTH, line_height));
cx.fill(&rect, color, 0.0);

continue;
}

Expand Down Expand Up @@ -402,8 +407,7 @@ impl EditorView {
(x0, x1 - x0)
};

let line_height = ed.line_height(line);
let rect = Rect::from_origin_size((x0, vline_y), (width, f64::from(line_height)));
let rect = Rect::from_origin_size((x0, vline_y), (width, line_height));
cx.fill(&rect, color, 0.0);
}
}
Expand Down

0 comments on commit b2fe244

Please sign in to comment.