diff options
Diffstat (limited to 'src/nvim/textobject.c')
-rw-r--r-- | src/nvim/textobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c index 3d8e7c9901..3e696167e2 100644 --- a/src/nvim/textobject.c +++ b/src/nvim/textobject.c @@ -955,6 +955,12 @@ int current_block(oparg_T *oap, int count, bool include, int what, int other) } } + if (equalpos(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. // Don't try to expand the area if the area is empty. |