summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-15 13:42:17 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-15 13:42:17 +0100
commiteb4de629315f2682d8b314462d02422ec98d751a (patch)
tree8e560e33e3fdf9a596a265c04f5b6d2bbfddf8f0 /src/drawline.c
parent4ccaedfcd7526983f4b6b3b06b0bfb54f333f1f3 (diff)
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'v9.0.0757
Problem: Line number not visisble with 'smoothscroll', 'nu' and 'rnu'. Solution: Put the ">>>" after the line number instead of on top.
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/drawline.c b/src/drawline.c
index b2a5951435..f3024c2fcc 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -370,7 +370,8 @@ handle_lnum_col(
#ifdef FEAT_PROP_POPUP
+ wlv->text_prop_above_count
#endif
- && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
+ && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow
+ || (wp->w_p_nu && wp->w_p_rnu)))
{
long num;
char *fmt = "%*ld ";
@@ -770,8 +771,18 @@ wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
)
{
int off = (int)(current_ScreenLine - ScreenLines);
+ int skip = 0;
- for (int i = 0; i < 3; ++i)
+ if (wp->w_p_nu && wp->w_p_rnu)
+ // Do not overwrite the line number, change "123 text" to
+ // "123>>>xt".
+ while (skip < wp->w_width && VIM_ISDIGIT(ScreenLines[off]))
+ {
+ ++off;
+ ++skip;
+ }
+
+ for (int i = 0; i < 3 && i + skip < wp->w_width; ++i)
{
ScreenLines[off] = '<';
if (enc_utf8)