diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-01-06 06:45:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-06 06:45:11 +0800 |
commit | a18b4af7596b2eb3309df7ce49c87913285b6974 (patch) | |
tree | 08ad93af5856730086f247868b3e1c1915184fbe /src/nvim/textobject.c | |
parent | 52e6059415ba40b955267a9b447b5c57fc45b397 (diff) | |
parent | 14918118e86a7d113331f4445c51e6e48a6a99c4 (diff) | |
download | rneovim-a18b4af7596b2eb3309df7ce49c87913285b6974.tar.gz rneovim-a18b4af7596b2eb3309df7ce49c87913285b6974.tar.bz2 rneovim-a18b4af7596b2eb3309df7ce49c87913285b6974.zip |
Merge pull request #26909 from zeertzjq/vim-9.1.0007
vim-patch:9.1.{0007,0012}: can select empty inner text blocks
Diffstat (limited to 'src/nvim/textobject.c')
-rw-r--r-- | src/nvim/textobject.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c index 3d8e7c9901..76ea24039a 100644 --- a/src/nvim/textobject.c +++ b/src/nvim/textobject.c @@ -955,6 +955,13 @@ int current_block(oparg_T *oap, int count, bool include, int what, int other) } } + // In Visual mode, when resulting area is empty + // i.e. there is no inner block to select, abort. + if (equalpos(start_pos, *end_pos) && VIsual_active) { + curwin->w_cursor = old_pos; + 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. |