aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-25 19:12:06 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-25 20:30:35 +0800
commit611b43369e73b0da799226f70a6821c0c31ca222 (patch)
treedd2f96fa93d6263faa1fc728e5d9b00c35f19713 /src/nvim/move.c
parente12c62c1f7a7ebb957831ca1e0e49771e190a1a8 (diff)
downloadrneovim-611b43369e73b0da799226f70a6821c0c31ca222.tar.gz
rneovim-611b43369e73b0da799226f70a6821c0c31ca222.tar.bz2
rneovim-611b43369e73b0da799226f70a6821c0c31ca222.zip
vim-patch:8.2.5155: in diff mode windows may get out of sync
Problem: In diff mode windows may get out of sync. (Gary Johnson) Solution: Avoid that the other window scrolls for 'cursorbind'. https://github.com/vim/vim/commit/a315ce1f326b836167ca8b1037dafd93eb8d4d4e
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index bd68ad6f97..6d4eb8ef49 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -2271,7 +2271,13 @@ void do_check_cursorbind(void)
int restart_edit_save = restart_edit;
restart_edit = true;
check_cursor();
- validate_cursor();
+
+ // Avoid a scroll here for the cursor position, 'scrollbind' is
+ // more important.
+ if (!curwin->w_p_scb) {
+ validate_cursor();
+ }
+
restart_edit = restart_edit_save;
}
// Correct cursor for multi-byte character.