aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-04 21:19:03 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-05 11:29:35 -0400
commit62a3312b8873923faf276d22cbffa75448124a3c (patch)
tree108c60988b502cfa072baa65d2b9ec437c795452 /src/nvim/normal.c
parent2c4e9c5245285b5a0a76e044b72481dfe6c468ab (diff)
downloadrneovim-62a3312b8873923faf276d22cbffa75448124a3c.tar.gz
rneovim-62a3312b8873923faf276d22cbffa75448124a3c.tar.bz2
rneovim-62a3312b8873923faf276d22cbffa75448124a3c.zip
vim-patch:8.2.2711: "gj" in a closed fold does not move out of the fold
Problem: "gj" in a closed fold does not move out of the fold. (Marco Hinz) Solution: Add a check for being in a closed fold. (closes vim/vim#8062) https://github.com/vim/vim/commit/3c49e74e18993915a779cafe4af3749b39fd3e2a N/A patches for version.c: vim-patch:8.2.2709: the GTK GUI has a gap next to the scrollbar Problem: The GTK GUI has a gap next to the scrollbar. Solution: Calculate the scrollbar padding for GTK. (closes vim/vim#8027) https://github.com/vim/vim/commit/26af8e54ff0d423b7258ef84d175c8570740629a vim-patch:8.2.2717: GTK menu items don't show a tooltip Problem: GTK menu items don't show a tooltip. Solution: Add a callback to show the tooltip. (Leonid V. Fedorenchik, closes vim/vim#8067, closes vim/vim#7810) https://github.com/vim/vim/commit/ce5b06a6a972dcc36e460782e10e21a09b227b5d
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 3b40689f3e..f016ef6813 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -3971,7 +3971,8 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
while (dist--) {
if (dir == BACKWARD) {
- if (curwin->w_curswant >= width1) {
+ if (curwin->w_curswant >= width1
+ && !hasFolding(curwin->w_cursor.lnum, NULL, NULL)) {
// Move back within the line. This can give a negative value
// for w_curswant if width1 < width2 (with cpoptions+=n),
// which will get clipped to column 0.
@@ -4003,14 +4004,16 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
else
n = width1;
- if (curwin->w_curswant + width2 < (colnr_T)n)
- /* move forward within line */
+ if (curwin->w_curswant + width2 < (colnr_T)n
+ && !hasFolding(curwin->w_cursor.lnum, NULL, NULL)) {
+ // move forward within line
curwin->w_curswant += width2;
- else {
- /* to next line */
- /* Move to the end of a closed fold. */
+ } else {
+ // to next line
+
+ // Move to the end of a closed fold.
(void)hasFolding(curwin->w_cursor.lnum, NULL,
- &curwin->w_cursor.lnum);
+ &curwin->w_cursor.lnum);
if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count) {
retval = false;
break;