@@ -202,22 +202,26 @@ redraw_for_cursorcolumn(win_T *wp)
202
202
#endif
203
203
204
204
/*
205
- * Calculates how much overlap the smoothscroll marker "<<<" overlaps with
206
- * buffer text for curwin .
205
+ * Calculates how much the 'listchars' "precedes" or 'smoothscroll' "<<<"
206
+ * marker overlaps with buffer text for window "wp" .
207
207
* Parameter "extra2" should be the padding on the 2nd line, not the first
208
208
* line.
209
209
* Returns the number of columns of overlap with buffer text, excluding the
210
210
* extra padding on the ledge.
211
211
*/
212
- static int
213
- smoothscroll_marker_overlap ( int extra2 )
212
+ int
213
+ sms_marker_overlap ( win_T * wp , int extra2 )
214
214
{
215
215
#if defined(FEAT_LINEBREAK )
216
- // We don't draw the <<< marker when in showbreak mode, thus no need to
216
+ // There is no marker overlap when in showbreak mode, thus no need to
217
217
// account for it. See wlv_screen_line().
218
- if (* get_showbreak_value (curwin ) != NUL )
218
+ if (* get_showbreak_value (wp ) != NUL )
219
219
return 0 ;
220
220
#endif
221
+ // Overlap when 'list' and 'listchars' "precedes" are set is 1.
222
+ if (wp -> w_p_list && wp -> w_lcs_chars .prec )
223
+ return 1 ;
224
+
221
225
return extra2 > 3 ? 0 : 3 - extra2 ;
222
226
}
223
227
@@ -346,12 +350,11 @@ update_topline(void)
346
350
colnr_T vcol ;
347
351
348
352
// Check that the cursor position is visible. Add columns for
349
- // the smoothscroll marker "<<<" displayed in the top-left if
350
- // needed.
353
+ // the marker displayed in the top-left if needed.
351
354
getvvcol (curwin , & curwin -> w_cursor , & vcol , NULL , NULL );
352
- int smoothscroll_overlap = smoothscroll_marker_overlap (
353
- curwin_col_off () - curwin_col_off2 ());
354
- if (curwin -> w_skipcol + smoothscroll_overlap > vcol )
355
+ int overlap = sms_marker_overlap ( curwin , curwin_col_off ()
356
+ - curwin_col_off2 ());
357
+ if (curwin -> w_skipcol + overlap > vcol )
355
358
check_topline = TRUE;
356
359
}
357
360
}
@@ -1883,26 +1886,24 @@ scrollup(
1883
1886
int scrolloff_cols = so == 0 ? 0 : width1 + (so - 1 ) * width2 ;
1884
1887
int space_cols = (curwin -> w_height - 1 ) * width2 ;
1885
1888
1886
- // If we have non-zero scrolloff, just ignore the <<< marker as we are
1889
+ // If we have non-zero scrolloff, just ignore the marker as we are
1887
1890
// going past it anyway.
1888
- int smoothscroll_overlap = scrolloff_cols != 0 ? 0 :
1889
- smoothscroll_marker_overlap ( extra2 );
1891
+ int overlap = scrolloff_cols != 0 ? 0
1892
+ : sms_marker_overlap ( curwin , extra2 );
1890
1893
1891
1894
// Make sure the cursor is in a visible part of the line, taking
1892
1895
// 'scrolloff' into account, but using screen lines.
1893
1896
// If there are not enough screen lines put the cursor in the middle.
1894
1897
if (scrolloff_cols > space_cols / 2 )
1895
1898
scrolloff_cols = space_cols / 2 ;
1896
1899
validate_virtcol ();
1897
- if (curwin -> w_virtcol < curwin -> w_skipcol
1898
- + smoothscroll_overlap + scrolloff_cols )
1900
+ if (curwin -> w_virtcol < curwin -> w_skipcol + overlap + scrolloff_cols )
1899
1901
{
1900
1902
colnr_T col = curwin -> w_virtcol ;
1901
1903
1902
1904
if (col < width1 )
1903
1905
col += width1 ;
1904
- while (col < curwin -> w_skipcol
1905
- + smoothscroll_overlap + scrolloff_cols )
1906
+ while (col < curwin -> w_skipcol + overlap + scrolloff_cols )
1906
1907
col += width2 ;
1907
1908
curwin -> w_curswant = col ;
1908
1909
coladvance (curwin -> w_curswant );
@@ -1949,8 +1950,10 @@ adjust_skipcol(void)
1949
1950
}
1950
1951
1951
1952
validate_virtcol ();
1953
+ int overlap = sms_marker_overlap (curwin ,
1954
+ curwin_col_off () - curwin_col_off2 ());
1952
1955
while (curwin -> w_skipcol > 0
1953
- && curwin -> w_virtcol < curwin -> w_skipcol + 3 + scrolloff_cols )
1956
+ && curwin -> w_virtcol < curwin -> w_skipcol + overlap + scrolloff_cols )
1954
1957
{
1955
1958
// scroll a screen line down
1956
1959
if (curwin -> w_skipcol >= width1 + width2 )
0 commit comments