Skip to content

Commit a178d92

Browse files
committed
updated for version 7.4.627
Problem: The last screen cell is not updated. Solution: Respect the "tn" termcap feature. (Hayaki Saito)
1 parent 63a85f7 commit a178d92

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

runtime/doc/term.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,11 @@ The options are listed below. The associated termcap code is always equal to
224224
the last two characters of the option name. Only one termcap code is
225225
required: Cursor motion, 't_cm'.
226226

227-
The options 't_da', 't_db', 't_ms', 't_xs' represent flags in the termcap.
228-
When the termcap flag is present, the option will be set to "y". But any
229-
non-empty string means that the flag is set. An empty string means that the
230-
flag is not set. 't_CS' works like this too, but it isn't a termcap flag.
227+
The options 't_da', 't_db', 't_ms', 't_xs', 't_xn' represent flags in the
228+
termcap. When the termcap flag is present, the option will be set to "y".
229+
But any non-empty string means that the flag is set. An empty string means
230+
that the flag is not set. 't_CS' works like this too, but it isn't a termcap
231+
flag.
231232

232233
OUTPUT CODES
233234
option meaning ~
@@ -281,6 +282,9 @@ OUTPUT CODES
281282
t_vs cursor very visible *t_vs* *'t_vs'*
282283
*t_xs* *'t_xs'*
283284
t_xs if non-empty, standout not erased by overwriting (hpterm)
285+
*t_xn* *'t_xn'*
286+
t_xn if non-empty, character writing at the last cell of screen
287+
didn't causes scrolling
284288
t_ZH italics mode *t_ZH* *'t_ZH'*
285289
t_ZR italics end *t_ZR* *'t_ZR'*
286290

src/option.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,6 +2978,7 @@ static struct vimoption
29782978
p_term("t_WS", T_CWS)
29792979
p_term("t_SI", T_CSI)
29802980
p_term("t_EI", T_CEI)
2981+
p_term("t_xn", T_XN)
29812982
p_term("t_xs", T_XS)
29822983
p_term("t_ZH", T_CZH)
29832984
p_term("t_ZR", T_CZR)

src/screen.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7968,9 +7968,11 @@ screen_char(off, row, col)
79687968
if (row >= screen_Rows || col >= screen_Columns)
79697969
return;
79707970

7971-
/* Outputting the last character on the screen may scrollup the screen.
7972-
* Don't to it! Mark the character invalid (update it when scrolled up) */
7973-
if (row == screen_Rows - 1 && col == screen_Columns - 1
7971+
/* Outputting a character in the last cell on the screen may scroll the
7972+
* screen up. Only do it when the "xn" termcap property is set, otherwise
7973+
* mark the character invalid (update it when scrolled up). */
7974+
if (*T_XN == NUL
7975+
&& row == screen_Rows - 1 && col == screen_Columns - 1
79747976
#ifdef FEAT_RIGHTLEFT
79757977
/* account for first command-line character in rightleft mode */
79767978
&& !cmdmsg_rl

src/term.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ static struct builtin_term builtin_termcaps[] =
200200
{(int)KS_VB, IF_EB("\033|f", ESC_STR "|f")},
201201
{(int)KS_MS, "y"},
202202
{(int)KS_UT, "y"},
203+
{(int)KS_XN, "y"},
203204
{(int)KS_LE, "\b"}, /* cursor-left = BS */
204205
{(int)KS_ND, "\014"}, /* cursor-right = CTRL-L */
205206
# ifdef TERMINFO
@@ -658,6 +659,7 @@ static struct builtin_term builtin_termcaps[] =
658659

659660
{(int)KS_MS, "y"}, /* save to move cur in reverse mode */
660661
{(int)KS_UT, "y"},
662+
{(int)KS_XN, "y"},
661663
{(int)KS_LE, "\b"},
662664
# ifdef TERMINFO
663665
{(int)KS_CM, "\033|%i%p1%d;%p2%dH"},/* cursor motion */
@@ -772,6 +774,7 @@ static struct builtin_term builtin_termcaps[] =
772774
{(int)KS_CSF, IF_EB("\033[101;%dm", ESC_STR "[101;%dm")}, /* set screen foreground color */
773775
{(int)KS_MS, "y"},
774776
{(int)KS_UT, "y"},
777+
{(int)KS_XN, "y"},
775778
{(int)KS_LE, "\b"},
776779
# ifdef TERMINFO
777780
{(int)KS_CM, IF_EB("\033[%i%p1%d;%p2%dH",
@@ -1207,6 +1210,7 @@ static struct builtin_term builtin_termcaps[] =
12071210
{(int)KS_UCS, "[UCS]"},
12081211
{(int)KS_MS, "[MS]"},
12091212
{(int)KS_UT, "[UT]"},
1213+
{(int)KS_XN, "[XN]"},
12101214
# ifdef TERMINFO
12111215
{(int)KS_CM, "[%p1%dCM%p2%d]"},
12121216
# else
@@ -1645,6 +1649,9 @@ set_termname(term)
16451649
if ((T_XS == NULL || T_XS == empty_option)
16461650
&& tgetflag("xs") > 0)
16471651
T_XS = (char_u *)"y";
1652+
if ((T_XN == NULL || T_XN == empty_option)
1653+
&& tgetflag("xn") > 0)
1654+
T_XN = (char_u *)"y";
16481655
if ((T_DB == NULL || T_DB == empty_option)
16491656
&& tgetflag("db") > 0)
16501657
T_DB = (char_u *)"y";

src/term.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ enum SpecialKey
6666
KS_CSF, /* set foreground color */
6767
KS_CSB, /* set background color */
6868
KS_XS, /* standout not erased by overwriting (hpterm) */
69+
KS_XN, /* newline glitch */
6970
KS_MB, /* blink mode */
7071
KS_CAF, /* set foreground color (ANSI) */
7172
KS_CAB, /* set background color (ANSI) */
@@ -144,6 +145,7 @@ extern char_u *(term_strings[]); /* current terminal strings */
144145
#define T_CSF (term_str(KS_CSF)) /* set foreground color */
145146
#define T_CSB (term_str(KS_CSB)) /* set background color */
146147
#define T_XS (term_str(KS_XS)) /* standout not erased by overwriting */
148+
#define T_XN (term_str(KS_XN)) /* newline glitch */
147149
#define T_MB (term_str(KS_MB)) /* blink mode */
148150
#define T_CAF (term_str(KS_CAF)) /* set foreground color (ANSI) */
149151
#define T_CAB (term_str(KS_CAB)) /* set background color (ANSI) */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
627,
744746
/**/
745747
626,
746748
/**/

0 commit comments

Comments
 (0)