1
0
forked from aniani/vim

patch 9.1.0007: can select empty inner text blocks

Problem:  can select empty inner text blocks
          (laurentalacoque)
Solution: make selecting empty inner text blocks an error

textobjects: Make selecting inner empty blocks an error

fixes: #13514
closes: #13523

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-01-04 21:43:36 +01:00
parent 184f71cc68
commit ad4d7f446d
4 changed files with 127 additions and 8 deletions

View File

@@ -1131,6 +1131,11 @@ current_block(
break;
}
if (EQUAL_POS(start_pos, *end_pos))
// empty block like this: ()
// there is no inner block to select, abort
return FAIL;
/*
* 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.