Mercurial > vim
diff src/ops.c @ 18882:f9e41ffd3539 v8.2.0002
patch 8.2.0002: "dj" only deletes first line of closed fold
Commit: https://github.com/vim/vim/commit/3b68123cd271fb781da4055cf1a1cf52f4fee6a5
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 13 19:35:55 2019 +0100
patch 8.2.0002: "dj" only deletes first line of closed fold
Problem: "dj" only deletes first line of closed fold.
Solution: Adjust last line of operator for linewise motion. (closes https://github.com/vim/vim/issues/5354)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 13 Dec 2019 19:45:04 +0100 |
parents | 7982f65d8f54 |
children | 4c0b420e7327 |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -4233,7 +4233,8 @@ do_pending_operator(cmdarg_T *cap, int o { 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());