diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option_defs.h | 5 | ||||
-rw-r--r-- | src/nvim/screen.c | 20 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index e085b973ea..fdfcd1f428 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -397,10 +397,11 @@ EXTERN char_u *p_dir; /* 'directory' */ EXTERN char_u *p_dy; /* 'display' */ EXTERN unsigned dy_flags; #ifdef IN_OPTION_C -static char *(p_dy_values[]) = {"lastline", "uhex", NULL}; +static char *(p_dy_values[]) = { "lastline", "truncate", "uhex", NULL }; #endif #define DY_LASTLINE 0x001 -#define DY_UHEX 0x002 +#define DY_TRUNCATE 0x002 +#define DY_UHEX 0x004 EXTERN int p_ed; // 'edcompatible' EXTERN bool p_emoji; // 'emoji' EXTERN char_u *p_ead; // 'eadirection' diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 47dd640e59..3e4d016fe7 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1401,7 +1401,7 @@ static void win_update(win_T *wp) && wp->w_lines[idx].wl_valid && wp->w_lines[idx].wl_lnum == lnum && lnum > wp->w_topline - && !(dy_flags & DY_LASTLINE) + && !(dy_flags & (DY_LASTLINE | DY_TRUNCATE)) && srow + wp->w_lines[idx].wl_size > wp->w_height && diff_check_fill(wp, lnum) == 0 ) { @@ -1484,10 +1484,20 @@ static void win_update(win_T *wp) /* Window ends in filler lines. */ wp->w_botline = lnum; wp->w_filler_rows = wp->w_height - srow; - } else if (dy_flags & DY_LASTLINE) { /* 'display' has "lastline" */ - /* - * Last line isn't finished: Display "@@@" at the end. - */ + } else if (dy_flags & DY_TRUNCATE) { // 'display' has "truncate" + int scr_row = wp->w_winrow + wp->w_height - 1; + + // Last line isn't finished: Display "@@@" in the last screen line. + screen_puts_len((char_u *)"@@", 2, scr_row, wp->w_wincol, + hl_attr(HLF_AT)); + + screen_fill(scr_row, scr_row + 1, + (int)wp->w_wincol + 2, (int)W_ENDCOL(wp), + '@', ' ', hl_attr(HLF_AT)); + set_empty_rows(wp, srow); + wp->w_botline = lnum; + } else if (dy_flags & DY_LASTLINE) { // 'display' has "lastline" + // Last line isn't finished: Display "@@@" at the end. screen_fill(wp->w_winrow + wp->w_height - 1, wp->w_winrow + wp->w_height, W_ENDCOL(wp) - 3, W_ENDCOL(wp), diff --git a/src/nvim/version.c b/src/nvim/version.c index 54f03cd3dd..b4c76de580 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -332,7 +332,7 @@ static int included_patches[] = { 2112, // 2111, // 2110, - // 2109, + 2109, // 2108 NA // 2107, // 2106, |