diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-11-18 14:07:20 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-18 14:07:20 +0000 |
commit | 0c34d562647f029faca40f7733ccfb7b5377672b (patch) | |
tree | e9487c56c78625dc5047d67607caea7e3f6189d0 /src/mouse.c | |
parent | 81ba26e9de24ca6b1c05b6ec03e53b21793f1a4b (diff) |
patch 9.0.0901: setting w_leftcol and handling side effects is confusingv9.0.0901
Problem: Setting w_leftcol and handling side effects is confusing.
Solution: Use a function to set w_leftcol() and handle side effects.
Diffstat (limited to 'src/mouse.c')
-rw-r--r-- | src/mouse.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mouse.c b/src/mouse.c index 5ebf125dcf..8348ba1959 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -2035,8 +2035,6 @@ do_mousescroll_horiz(long_u leftcol) if (curwin->w_leftcol == (colnr_T)leftcol) return FALSE; // already there - curwin->w_leftcol = (colnr_T)leftcol; - // When the line of the cursor is too short, move the cursor to the // longest visible line. if ( @@ -2050,7 +2048,7 @@ do_mousescroll_horiz(long_u leftcol) curwin->w_cursor.col = 0; } - return leftcol_changed(); + return set_leftcol((colnr_T)leftcol); } /* @@ -2098,7 +2096,7 @@ do_mousescroll(int mode, cmdarg_T *cap) send_keys_to_term(curbuf->b_term, cap->cmdchar, mod_mask, FALSE); else # endif - // For insert mode, don't scroll the window in which completion is being + // For Insert mode, don't scroll the window in which completion is being // done. if (mode == MODE_NORMAL || !pum_visible() || curwin != old_curwin) { |