summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ops.c3
-rw-r--r--src/testdir/test_fold.vim25
-rw-r--r--src/version.c2
3 files changed, 29 insertions, 1 deletions
diff --git a/src/ops.c b/src/ops.c
index d3e1e47f32..2a625066c4 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -4233,7 +4233,8 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
{
if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL))
oap->start.col = 0;
- if ((curwin->w_cursor.col > 0 || oap->inclusive)
+ if ((curwin->w_cursor.col > 0 || oap->inclusive
+ || oap->motion_type == MLINE)
&& hasFolding(curwin->w_cursor.lnum, NULL,
&curwin->w_cursor.lnum))
curwin->w_cursor.col = (colnr_T)STRLEN(ml_get_curline());
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim
index 824a4f22f6..36de13656c 100644
--- a/src/testdir/test_fold.vim
+++ b/src/testdir/test_fold.vim
@@ -769,3 +769,28 @@ func Test_fold_delete_with_marker_and_whichwrap()
set fdm& ww&
bwipe!
endfunc
+
+func Test_fold_delete_first_line()
+ new
+ call setline(1, [
+ \ '" x {{{1',
+ \ '" a',
+ \ '" aa',
+ \ '" x {{{1',
+ \ '" b',
+ \ '" bb',
+ \ '" x {{{1',
+ \ '" c',
+ \ '" cc',
+ \ ])
+ set foldmethod=marker
+ 1
+ normal dj
+ call assert_equal([
+ \ '" x {{{1',
+ \ '" c',
+ \ '" cc',
+ \ ], getline(1,'$'))
+ bwipe!
+ set foldmethod&
+endfunc
diff --git a/src/version.c b/src/version.c
index b3f1fdb96b..4573e5af47 100644
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2,
+/**/
1,
/**/
0