mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 11:23:10 +03:00
Fix incorrect line hihglight when a selection is at the end of a line.
This commit is contained in:
parent
1792dc6f93
commit
1910fa7723
@ -378,7 +378,15 @@ impl EditorView {
|
|||||||
let selection = doc.selection(view.id);
|
let selection = doc.selection(view.id);
|
||||||
|
|
||||||
for selection in selection.iter().filter(|range| range.overlaps(&screen)) {
|
for selection in selection.iter().filter(|range| range.overlaps(&screen)) {
|
||||||
let head = view.screen_coords_at_pos(doc, text, selection.head);
|
let head = view.screen_coords_at_pos(
|
||||||
|
doc,
|
||||||
|
text,
|
||||||
|
if selection.head > selection.anchor {
|
||||||
|
selection.head - 1
|
||||||
|
} else {
|
||||||
|
selection.head
|
||||||
|
},
|
||||||
|
);
|
||||||
if let Some(head) = head {
|
if let Some(head) = head {
|
||||||
// Draw line number for selected lines.
|
// Draw line number for selected lines.
|
||||||
let line_number = view.first_line + head.row;
|
let line_number = view.first_line + head.row;
|
||||||
|
Loading…
Reference in New Issue
Block a user