diff options
author | Daniel Hahler <git@thequod.de> | 2019-09-22 19:49:03 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-09-22 20:11:04 +0200 |
commit | 97b82553e09b949cae90c6e755d218d5cdca8f12 (patch) | |
tree | 8e1b36302490df8331213af293b4038978c7e0e7 /src/nvim/normal.c | |
parent | 6807779c68220e738b99486118c97c0ebc108b0e (diff) | |
download | rneovim-97b82553e09b949cae90c6e755d218d5cdca8f12.tar.gz rneovim-97b82553e09b949cae90c6e755d218d5cdca8f12.tar.bz2 rneovim-97b82553e09b949cae90c6e755d218d5cdca8f12.zip |
vim-patch:8.1.2052: using "x" before a closed fold may delete that fold
Problem: Using "x" before a closed fold may delete that fold.
Solution: Do not translate 'x' do "dl". (Christian Brabandt, closes vim/vim#4927)
https://github.com/vim/vim/commit/7a9bd7c1e0ce1baf5a02daf36eeae3638aa315c7
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index e7e6d2b365..ffdc8e23d7 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -6248,7 +6248,14 @@ static void nv_optrans(cmdarg_T *cap) if (cap->count0) { stuffnumReadbuff(cap->count0); } - stuffReadbuff(ar[strchr(str, (char)cap->cmdchar) - str]); + // If on an empty line and using 'x' and "l" is included in the + // whichwrap option, do not delete the next line. + if (cap->cmdchar == 'x' && vim_strchr(p_ww, 'l') != NULL + && gchar_cursor() == NUL) { + stuffReadbuff((char *)"dd"); + } else { + stuffReadbuff(ar[strchr(str, (char)cap->cmdchar) - str]); + } } cap->opcount = 0; } |