mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
vim-patch:9.1.1175: inconsistent behaviour with exclusive selection and motion commands (#32745)
Problem: inconsistent behaviour with exclusive selection and motion
commands (aidancz)
Solution: adjust cursor position when selection is exclusive
(Jim Zhou)
fixes: vim/vim#16278
closes: vim/vim#16784
c8cce711dd
Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "nvim/memline.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/normal.h"
|
||||
#include "nvim/option_vars.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/search.h"
|
||||
@@ -427,6 +428,13 @@ int end_word(int count, bool bigword, bool stop, bool empty)
|
||||
|
||||
curwin->w_cursor.coladd = 0;
|
||||
cls_bigword = bigword;
|
||||
|
||||
// If adjusted cursor position previously, unadjust it.
|
||||
if (*p_sel == 'e' && VIsual_active && VIsual_mode == 'v'
|
||||
&& VIsual_select_exclu_adj) {
|
||||
unadjust_for_sel();
|
||||
}
|
||||
|
||||
while (--count >= 0) {
|
||||
// When inside a range of folded lines, move to the last char of the
|
||||
// last line.
|
||||
|
Reference in New Issue
Block a user