This commit is contained in:
Kovid Goyal 2021-09-27 17:29:22 +05:30
parent cc261db606
commit c71d8fe1cc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 16 additions and 1 deletions

View File

@ -3131,7 +3131,8 @@ screen_update_selection(Screen *self, index_type x, index_type y, bool in_left_h
set_abs(abs_initial_start, s->initial_extent.start, s->initial_extent.scrolled_by);
set_abs(abs_initial_end, s->initial_extent.end, s->initial_extent.scrolled_by);
if (self->selections.extend_mode == EXTEND_WORD) {
s->adjusting_start = selection_boundary_less_than(&abs_current_input, &abs_initial_end);
if (s->adjusting_start) s->adjusting_start = selection_boundary_less_than(&abs_current_input, &abs_initial_end);
else s->adjusting_start = selection_boundary_less_than(&abs_current_input, &abs_initial_start);
} else {
const unsigned int initial_line = abs_initial_start.y;
if (initial_line == abs_current_input.y) {

View File

@ -155,6 +155,20 @@ class TestMouse(BaseTest):
move(0.2)
release()
self.ae(sel(), 'ab cd')
multi_click(x=4.4)
self.ae(sel(), 'cd')
move(x=4.4, y=1)
self.ae(sel(), 'cd f gh')
move(x=4.4, y=0)
self.ae(sel(), 'cd')
release()
multi_click(x=4.4, y=1)
self.ae(sel(), 'gh')
move(x=4.4, y=0)
self.ae(sel(), 'cd f gh')
move(x=4.4, y=1)
self.ae(sel(), 'gh')
release()
# Line select with drag
s.reset()