Mercurial > vim
comparison src/move.c @ 32361:9ac987a467d5 v9.0.1512
patch 9.0.1512: inserting lines when scrolling with 'smoothscroll' set
Commit: https://github.com/vim/vim/commit/c8502f9b880b6d23baa4f9d28b60e1ceb442e35f
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Sat May 6 12:40:15 2023 +0100
patch 9.0.1512: inserting lines when scrolling with 'smoothscroll' set
Problem: Inserting lines when scrolling with 'smoothscroll' set.
Solution: Adjust line height computation for w_skipcol. (Luuk van Baal,
closes #12350)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 May 2023 13:45:04 +0200 |
parents | 73c5881c1793 |
children | 1ddef52ea786 |
comparison
equal
deleted
inserted
replaced
32360:d0c44a70b750 | 32361:9ac987a467d5 |
---|---|
36 static void botline_forw(lineoff_T *lp); | 36 static void botline_forw(lineoff_T *lp); |
37 | 37 |
38 /* | 38 /* |
39 * Reduce "n" for the screen lines skipped with "wp->w_skipcol". | 39 * Reduce "n" for the screen lines skipped with "wp->w_skipcol". |
40 */ | 40 */ |
41 static int | 41 int |
42 adjust_plines_for_skipcol(win_T *wp, int n) | 42 adjust_plines_for_skipcol(win_T *wp, int n) |
43 { | 43 { |
44 if (wp->w_skipcol == 0) | 44 if (wp->w_skipcol == 0) |
45 return n; | 45 return n; |
46 | 46 |
237 skipcol += (width1 + win_col_off2(wp)) * (plines_off - 1); | 237 skipcol += (width1 + win_col_off2(wp)) * (plines_off - 1); |
238 return skipcol; | 238 return skipcol; |
239 } | 239 } |
240 | 240 |
241 /* | 241 /* |
242 * Set curwin->s_skipcol to zero and redraw later if needed. | 242 * Set curwin->w_skipcol to zero and redraw later if needed. |
243 */ | 243 */ |
244 static void | 244 static void |
245 reset_skipcol(void) | 245 reset_skipcol(void) |
246 { | 246 { |
247 if (curwin->w_skipcol == 0) | 247 if (curwin->w_skipcol == 0) |
2988 ) | 2988 ) |
2989 return; | 2989 return; |
2990 | 2990 |
2991 if (curwin->w_p_sms && !curwin->w_p_wrap) | 2991 if (curwin->w_p_sms && !curwin->w_p_wrap) |
2992 { | 2992 { |
2993 // 'smoothscroll is active | 2993 // 'smoothscroll' is active |
2994 if (curwin->w_cline_height == curwin->w_height) | 2994 if (curwin->w_cline_height == curwin->w_height) |
2995 { | 2995 { |
2996 // The cursor line just fits in the window, don't scroll. | 2996 // The cursor line just fits in the window, don't scroll. |
2997 reset_skipcol(); | 2997 reset_skipcol(); |
2998 return; | 2998 return; |