mirror of
https://github.com/microsoft/edit.git
synced 2026-06-16 06:29:42 -05:00
Fix selection highlight at the end of the document
This commit is contained in:
@@ -1634,7 +1634,12 @@ impl TextBuffer {
|
||||
);
|
||||
|
||||
// Draw the selection on this line, if any.
|
||||
if selection_beg <= cursor_end.logical_pos && selection_end >= cursor_beg.logical_pos {
|
||||
// FYI: `cursor_beg.visual_pos.y == visual_line` is necessary as the `visual_line`
|
||||
// may be past the end of the document, and so it may not receive a highlight.
|
||||
if cursor_beg.visual_pos.y == visual_line
|
||||
&& selection_beg <= cursor_end.logical_pos
|
||||
&& selection_end >= cursor_beg.logical_pos
|
||||
{
|
||||
// By default, we assume the entire line is selected.
|
||||
let mut beg = 0;
|
||||
let mut end = COORD_TYPE_SAFE_MAX;
|
||||
|
||||
Reference in New Issue
Block a user