summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-03 16:44:12 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-03 16:44:12 +0100
commit406b5d89e18742ac6e6256ffc72fb70a27f0148b (patch)
tree709c1f3edf5a459bd4f13cee7e759096b53c46c8 /src/drawline.c
parent0a016671b96ae7d27926e9d36dc11945c8f5749d (diff)
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'v9.0.0649
Problem: No indication when the first line is broken for 'smoothscroll'. Solution: Show "<<<" in the first line.
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 79ce5140e9..793d8a9996 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -740,6 +740,32 @@ text_prop_position(
#endif
/*
+ * Call screen_line() using values from "wlv".
+ * Also takes care of putting "<<<" on the first line for 'smoothscroll'.
+ */
+ static void
+wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
+{
+ if (wlv->row == 0 && wp->w_skipcol > 0)
+ {
+ int off = (int)(current_ScreenLine - ScreenLines);
+
+ for (int i = 0; i < 3; ++i)
+ {
+ ScreenLines[off] = '<';
+ if (enc_utf8)
+ ScreenLinesUC[off] = 0;
+ ScreenAttrs[off] = HL_ATTR(HLF_AT);
+ ++off;
+ }
+ }
+
+ screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col,
+ negative_width ? -wp->w_width : wp->w_width,
+ wlv->screen_line_flags);
+}
+
+/*
* Called when finished with the line: draw the screen line and handle any
* highlighting until the right of the window.
*/
@@ -820,8 +846,7 @@ draw_screen_line(win_T *wp, winlinevars_T *wlv)
}
#endif
- screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col,
- wp->w_width, wlv->screen_line_flags);
+ wlv_screen_line(wp, wlv, FALSE);
++wlv->row;
++wlv->screen_row;
}
@@ -1730,8 +1755,7 @@ win_line(
#endif
)
{
- screen_line(wp, wlv.screen_row, wp->w_wincol, wlv.col, -wp->w_width,
- wlv.screen_line_flags);
+ wlv_screen_line(wp, &wlv, TRUE);
// Pretend we have finished updating the window. Except when
// 'cursorcolumn' is set.
#ifdef FEAT_SYN_HL
@@ -3670,13 +3694,12 @@ win_line(
)
{
#ifdef FEAT_CONCEAL
- screen_line(wp, wlv.screen_row, wp->w_wincol,
- wlv.col - wlv.boguscols,
- wp->w_width, wlv.screen_line_flags);
+ wlv.col += wlv.boguscols;
+ wlv_screen_line(wp, &wlv, FALSE);
+ wlv.col -= wlv.boguscols;
wlv.boguscols = 0;
#else
- screen_line(wp, wlv.screen_row, wp->w_wincol, wlv.col,
- wp->w_width, wlv.screen_line_flags);
+ screen_line(wp, &wlv, FALSE);
#endif
++wlv.row;
++wlv.screen_row;