aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-10-06 06:49:23 +0800
committerGitHub <noreply@github.com>2024-10-06 06:49:23 +0800
commit9f26bdc4165adf7de9bf0c231a386b02e85cbce0 (patch)
tree4fa1c30eae559986dcf408b60bdef3ed974ed7f1 /src
parent8801b77ed09876605e42f4a3fddf8c020c14b711 (diff)
downloadrneovim-9f26bdc4165adf7de9bf0c231a386b02e85cbce0.tar.gz
rneovim-9f26bdc4165adf7de9bf0c231a386b02e85cbce0.tar.bz2
rneovim-9f26bdc4165adf7de9bf0c231a386b02e85cbce0.zip
vim-patch:9.1.0759: screenpos() may return invalid position (#30681)
Problem: screenpos() may return invalid position after switching buffers (Greg Hurrell) Solution: reset w_leftcol if wrapping has been set after copying wrap option fixes: vim/vim#15792 closes: vim/vim#15803 https://github.com/vim/vim/commit/b065a10e245d020c11b521a2a5062300ca9891fc Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/option.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 72b633ceb2..aa6f330dfc 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5096,6 +5096,12 @@ void clear_winopt(winopt_T *wop)
void didset_window_options(win_T *wp, bool valid_cursor)
{
+ // Set w_leftcol or w_skipcol to zero.
+ if (wp->w_p_wrap) {
+ wp->w_leftcol = 0;
+ } else {
+ wp->w_skipcol = 0;
+ }
check_colorcolumn(wp);
briopt_check(wp);
fill_culopt_flags(NULL, wp);