diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-22 12:32:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-22 12:32:46 -0700 |
commit | fb26c38434f82af2a601a91c99adb40ecefa0d89 (patch) | |
tree | c641bdaf14179c71be50af8f4c6442c3ca5a4deb /src/nvim/normal.c | |
parent | 6807779c68220e738b99486118c97c0ebc108b0e (diff) | |
parent | 6c3d34e4dfc7fd3f810dd78f9dec016540c13bda (diff) | |
download | rneovim-fb26c38434f82af2a601a91c99adb40ecefa0d89.tar.gz rneovim-fb26c38434f82af2a601a91c99adb40ecefa0d89.tar.bz2 rneovim-fb26c38434f82af2a601a91c99adb40ecefa0d89.zip |
Merge #11076 from blueyed/fix-fold-patches
Fix fold patches: vim-patch:8.1.2052, vim-patch:8.1.2059
fix #11002
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index e7e6d2b365..4dfde96e94 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1553,9 +1553,11 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) if (!VIsual_active) { if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL)) oap->start.col = 0; - if (hasFolding(curwin->w_cursor.lnum, NULL, - &curwin->w_cursor.lnum)) + if ((curwin->w_cursor.col > 0 || oap->inclusive) + && hasFolding(curwin->w_cursor.lnum, NULL, + &curwin->w_cursor.lnum)) { curwin->w_cursor.col = (colnr_T)STRLEN(get_cursor_line_ptr()); + } } oap->end = curwin->w_cursor; curwin->w_cursor = oap->start; @@ -5125,14 +5127,10 @@ static void nv_right(cmdarg_T *cap) break; } else if (PAST_LINE) { curwin->w_set_curswant = true; - if (virtual_active()) + if (virtual_active()) { oneright(); - else { - if (has_mbyte) - curwin->w_cursor.col += - (*mb_ptr2len)(get_cursor_pos_ptr()); - else - ++curwin->w_cursor.col; + } else { + curwin->w_cursor.col += (*mb_ptr2len)(get_cursor_pos_ptr()); } } } |