summaryrefslogtreecommitdiffstats
path: root/src/mouse.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:58 +0000
commit0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa (patch)
tree25185226a8d172d94b0ff72f5a611659252c76d6 /src/mouse.c
parentReleasing progress-linux version 2:9.1.0377-1~progress7.99u1. (diff)
downloadvim-0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa.tar.xz
vim-0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa.zip
Merging upstream version 2:9.1.0496.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/mouse.c')
-rw-r--r--src/mouse.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/mouse.c b/src/mouse.c
index 247c6df..4e10e72 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -3029,16 +3029,22 @@ mouse_comp_pos(
if (win->w_skipcol > 0 && lnum == win->w_topline)
{
- // Adjust for 'smoothscroll' clipping the top screen lines.
- // A similar formula is used in curs_columns().
int width1 = win->w_width - win_col_off(win);
- int skip_lines = 0;
- if (win->w_skipcol > width1)
- skip_lines = (win->w_skipcol - width1)
+
+ if (width1 > 0)
+ {
+ int skip_lines = 0;
+
+ // Adjust for 'smoothscroll' clipping the top screen lines.
+ // A similar formula is used in curs_columns().
+ if (win->w_skipcol > width1)
+ skip_lines = (win->w_skipcol - width1)
/ (width1 + win_col_off2(win)) + 1;
- else if (win->w_skipcol > 0)
- skip_lines = 1;
- count -= skip_lines;
+ else if (win->w_skipcol > 0)
+ skip_lines = 1;
+
+ count -= skip_lines;
+ }
}
if (count > row)