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.

0c34d56264

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Luuk van Baal
2023-04-27 19:08:20 +02:00
parent 3621604029
commit 26a9f0e94e
3 changed files with 23 additions and 27 deletions

View File

@@ -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