aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/drawline.c3
-rw-r--r--src/nvim/drawscreen.c20
2 files changed, 22 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 45cfbb6d47..35038f4717 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -596,7 +596,8 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si
int sign_num_attr, int sign_cul_attr)
{
if ((wp->w_p_nu || wp->w_p_rnu)
- && (wlv->row == wlv->startrow + wlv->filler_lines
+ && ((wlv->row == wlv->startrow + wlv->filler_lines
+ && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
|| vim_strchr(p_cpo, CPO_NUMCOL) == NULL)) {
// If 'signcolumn' is set to 'number' and a sign is present
// in "lnum", then display the sign instead of the line
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index b5e516005b..36ff53aacb 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -1447,6 +1447,26 @@ static void win_update(win_T *wp, DecorProviders *providers)
init_search_hl(wp, &screen_search_hl);
+ // Make sure skipcol is valid, it depends on various options and the window
+ // width.
+ if (wp->w_skipcol > 0) {
+ int w = 0;
+ int width1 = wp->w_width - win_col_off(wp);
+ int width2 = width1 + win_col_off2(wp);
+ int add = width1;
+
+ while (w < wp->w_skipcol) {
+ if (w > 0) {
+ add = width2;
+ }
+ w += add;
+ }
+ if (w != wp->w_skipcol) {
+ // always round down, the higher value may not be valid
+ wp->w_skipcol = w - add;
+ }
+ }
+
// Force redraw when width of 'number' or 'relativenumber' column
// changes.
int nrwidth = (wp->w_p_nu || wp->w_p_rnu || *wp->w_p_stc) ? number_width(wp) : 0;