• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionaeabc666a119c29f50094216dd91fd842ce91b38 (tree)
Zeit2019-09-20 20:45:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.1.2059: fix for "x" deleting a fold has side effects

Commit: https://github.com/vim/vim/commit/56ebbabea1d8409ba67127b9674f6c714739c8e0
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 20 13:40:14 2019 +0200

patch 8.1.2059: fix for "x" deleting a fold has side effects
Problem: Fix for "x" deleting a fold has side effects.
Solution: Fix it where the fold is included.

Ändern Zusammenfassung

Diff

diff -r 3a7a8ae0864f -r aeabc666a119 src/normal.c
--- a/src/normal.c Thu Sep 19 23:30:04 2019 +0200
+++ b/src/normal.c Fri Sep 20 13:45:04 2019 +0200
@@ -1535,7 +1535,8 @@
15351535 {
15361536 if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL))
15371537 oap->start.col = 0;
1538- if (hasFolding(curwin->w_cursor.lnum, NULL,
1538+ if ((curwin->w_cursor.col > 0 || oap->inclusive)
1539+ && hasFolding(curwin->w_cursor.lnum, NULL,
15391540 &curwin->w_cursor.lnum))
15401541 curwin->w_cursor.col = (colnr_T)STRLEN(ml_get_curline());
15411542 }
@@ -6001,8 +6002,7 @@
60016002 else
60026003 {
60036004 if (has_mbyte)
6004- curwin->w_cursor.col +=
6005- (*mb_ptr2len)(ml_get_cursor());
6005+ curwin->w_cursor.col += (*mb_ptr2len)(ml_get_cursor());
60066006 else
60076007 ++curwin->w_cursor.col;
60086008 }
@@ -7400,13 +7400,7 @@
74007400 {
74017401 if (cap->count0)
74027402 stuffnumReadbuff(cap->count0);
7403- // If on an empty line and using 'x' and "l" is included in the
7404- // whichwrap option, do not delete the next line.
7405- if (cap->cmdchar == 'x' && vim_strchr(p_ww, 'l') != NULL
7406- && gchar_cursor() == NUL)
7407- stuffReadbuff((char_u *)"dd");
7408- else
7409- stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]);
7403+ stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]);
74107404 }
74117405 }
74127406 cap->opcount = 0;
diff -r 3a7a8ae0864f -r aeabc666a119 src/version.c
--- a/src/version.c Thu Sep 19 23:30:04 2019 +0200
+++ b/src/version.c Fri Sep 20 13:45:04 2019 +0200
@@ -758,6 +758,8 @@
758758 static int included_patches[] =
759759 { /* Add new patch number below this line */
760760 /**/
761+ 2059,
762+/**/
761763 2058,
762764 /**/
763765 2057,
Show on old repository browser