mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
ad9c2a08f0
This commit is contained in:
parent
e828a5a76b
commit
0f32088ea2
@ -2110,11 +2110,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
Change the way text is displayed. This is comma separated list of
|
Change the way text is displayed. This is comma separated list of
|
||||||
flags:
|
flags:
|
||||||
lastline When included, as much as possible of the last line
|
lastline When included, as much as possible of the last line
|
||||||
in a window will be displayed. When not included, a
|
in a window will be displayed. "@@@" is put in the
|
||||||
last line that doesn't fit is replaced with "@" lines.
|
last columns of the last screen line to indicate the
|
||||||
|
rest of the line is not displayed.
|
||||||
|
truncate Like "lastline", but "@@@" is displayed in the first
|
||||||
|
column of the last screen line. Overrules "lastline".
|
||||||
uhex Show unprintable characters hexadecimal as <xx>
|
uhex Show unprintable characters hexadecimal as <xx>
|
||||||
instead of using ^C and ~C.
|
instead of using ^C and ~C.
|
||||||
|
|
||||||
|
When neither "lastline" or "truncate" is included, a last line that
|
||||||
|
doesn't fit is replaced with "@" lines.
|
||||||
|
|
||||||
*'eadirection'* *'ead'*
|
*'eadirection'* *'ead'*
|
||||||
'eadirection' 'ead' string (default "both")
|
'eadirection' 'ead' string (default "both")
|
||||||
global
|
global
|
||||||
|
@ -397,10 +397,11 @@ EXTERN char_u *p_dir; /* 'directory' */
|
|||||||
EXTERN char_u *p_dy; /* 'display' */
|
EXTERN char_u *p_dy; /* 'display' */
|
||||||
EXTERN unsigned dy_flags;
|
EXTERN unsigned dy_flags;
|
||||||
#ifdef IN_OPTION_C
|
#ifdef IN_OPTION_C
|
||||||
static char *(p_dy_values[]) = {"lastline", "uhex", NULL};
|
static char *(p_dy_values[]) = { "lastline", "truncate", "uhex", NULL };
|
||||||
#endif
|
#endif
|
||||||
#define DY_LASTLINE 0x001
|
#define DY_LASTLINE 0x001
|
||||||
#define DY_UHEX 0x002
|
#define DY_TRUNCATE 0x002
|
||||||
|
#define DY_UHEX 0x004
|
||||||
EXTERN int p_ed; // 'edcompatible'
|
EXTERN int p_ed; // 'edcompatible'
|
||||||
EXTERN bool p_emoji; // 'emoji'
|
EXTERN bool p_emoji; // 'emoji'
|
||||||
EXTERN char_u *p_ead; // 'eadirection'
|
EXTERN char_u *p_ead; // 'eadirection'
|
||||||
|
@ -1401,7 +1401,7 @@ static void win_update(win_T *wp)
|
|||||||
&& wp->w_lines[idx].wl_valid
|
&& wp->w_lines[idx].wl_valid
|
||||||
&& wp->w_lines[idx].wl_lnum == lnum
|
&& wp->w_lines[idx].wl_lnum == lnum
|
||||||
&& lnum > wp->w_topline
|
&& lnum > wp->w_topline
|
||||||
&& !(dy_flags & DY_LASTLINE)
|
&& !(dy_flags & (DY_LASTLINE | DY_TRUNCATE))
|
||||||
&& srow + wp->w_lines[idx].wl_size > wp->w_height
|
&& srow + wp->w_lines[idx].wl_size > wp->w_height
|
||||||
&& diff_check_fill(wp, lnum) == 0
|
&& diff_check_fill(wp, lnum) == 0
|
||||||
) {
|
) {
|
||||||
@ -1484,10 +1484,20 @@ static void win_update(win_T *wp)
|
|||||||
/* Window ends in filler lines. */
|
/* Window ends in filler lines. */
|
||||||
wp->w_botline = lnum;
|
wp->w_botline = lnum;
|
||||||
wp->w_filler_rows = wp->w_height - srow;
|
wp->w_filler_rows = wp->w_height - srow;
|
||||||
} else if (dy_flags & DY_LASTLINE) { /* 'display' has "lastline" */
|
} 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 "@@@" at the end.
|
|
||||||
*/
|
// 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,
|
screen_fill(wp->w_winrow + wp->w_height - 1,
|
||||||
wp->w_winrow + wp->w_height,
|
wp->w_winrow + wp->w_height,
|
||||||
W_ENDCOL(wp) - 3, W_ENDCOL(wp),
|
W_ENDCOL(wp) - 3, W_ENDCOL(wp),
|
||||||
|
@ -332,7 +332,7 @@ static int included_patches[] = {
|
|||||||
2112,
|
2112,
|
||||||
// 2111,
|
// 2111,
|
||||||
// 2110,
|
// 2110,
|
||||||
// 2109,
|
2109,
|
||||||
// 2108 NA
|
// 2108 NA
|
||||||
// 2107,
|
// 2107,
|
||||||
// 2106,
|
// 2106,
|
||||||
|
Loading…
Reference in New Issue
Block a user