aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorMichael Ennen <brcolow@users.noreply.github.com>2016-10-25 12:15:43 -0700
committerJustin M. Keyes <justinkz@gmail.com>2016-10-25 21:15:43 +0200
commit0f32088ea23fbbe9557c89a9e075f2e9b9e158a4 (patch)
treebce831ea109473b7e324bf6bd156e317c4336699 /src/nvim/screen.c
parente828a5a76b097885ebd40d636e9ea95251b2995d (diff)
downloadrneovim-0f32088ea23fbbe9557c89a9e075f2e9b9e158a4.tar.gz
rneovim-0f32088ea23fbbe9557c89a9e075f2e9b9e158a4.tar.bz2
rneovim-0f32088ea23fbbe9557c89a9e075f2e9b9e158a4.zip
vim-patch:7.4.2109 (#5518)
vim-patch:7.4.2109 Problem: Setting 'display' to "lastline" is a drastic change, while omitting it results in lots of "@" lines. Solution: Add "truncate" to show "@@@" for a truncated line. https://github.com/vim/vim/commit/ad9c2a08f0509294269a2f11a59a438b944bdd5a
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c20
1 files changed, 15 insertions, 5 deletions
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),