aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-27 19:08:20 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:47 +0200
commit26a9f0e94eb62047f0c2bb99401a8ac09840d0dd (patch)
tree87ba6d225ca418bf91092ee8735196a8cff4b7e1 /src/nvim/mouse.c
parent3621604029119a8806da006eb0468cf65e23b980 (diff)
downloadrneovim-26a9f0e94eb62047f0c2bb99401a8ac09840d0dd.tar.gz
rneovim-26a9f0e94eb62047f0c2bb99401a8ac09840d0dd.tar.bz2
rneovim-26a9f0e94eb62047f0c2bb99401a8ac09840d0dd.zip
vim-patch:9.0.0901: setting w_leftcol and handling side effects is confusing
Problem: Setting w_leftcol and handling side effects is confusing. Solution: Use a function to set w_leftcol() and handle side effects. https://github.com/vim/vim/commit/0c34d562647f029faca40f7733ccfb7b5377672b Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r--src/nvim/mouse.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index 09352b370e..ead8dc2195 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -1648,8 +1648,6 @@ bool mouse_scroll_horiz(int dir)
return false;
}
- curwin->w_leftcol = (colnr_T)leftcol;
-
// When the line of the cursor is too short, move the cursor to the
// longest visible line.
if (!virtual_active()
@@ -1658,7 +1656,7 @@ bool mouse_scroll_horiz(int dir)
curwin->w_cursor.col = 0;
}
- return leftcol_changed();
+ return set_leftcol(leftcol);
}
/// Adjusts the clicked column position when 'conceallevel' > 0