vim-patch:8.2.5012: cannot select one character inside () (#18731)

Problem:    Cannot select one character inside ().
Solution:   Do not try to extend the area if it is empty. (closes vim/vim#10472,
            closes vim/vim#6616)
53737b5eee
This commit is contained in:
zeertzjq
2022-05-25 07:16:12 +08:00
committed by GitHub
parent 2f974736ac
commit af2899aee0
2 changed files with 24 additions and 6 deletions

View File

@@ -3453,11 +3453,11 @@ int current_block(oparg_T *oap, long count, int include, int what, int other)
}
}
/*
* In Visual mode, when the resulting area is not bigger than what we
* started with, extend it to the next block, and then exclude again.
*/
// In Visual mode, when the resulting area is not bigger than what we
// started with, extend it to the next block, and then exclude again.
// Don't try to expand the area if the area is empty.
if (!lt(start_pos, old_start) && !lt(old_end, curwin->w_cursor)
&& !equalpos(start_pos, curwin->w_cursor)
&& VIsual_active) {
curwin->w_cursor = old_start;
decl(&curwin->w_cursor);