Skip to content

Commit faf626e

Browse files
committed
patch 8.1.2208: Unix: Tabs in output might be expanded to spaces
Problem: Unix: Tabs in output might be expanded to spaces. Solution: Reset the XTABS flag. (closes #5108)
1 parent edaad6e commit faf626e

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

src/os_unix.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,9 +2201,9 @@ mch_settitle(char_u *title, char_u *icon)
22012201

22022202
if (*T_CIS != NUL)
22032203
{
2204-
out_str(T_CIS); /* set icon start */
2204+
out_str(T_CIS); // set icon start
22052205
out_str_nf(icon);
2206-
out_str(T_CIE); /* set icon end */
2206+
out_str(T_CIE); // set icon end
22072207
out_flush();
22082208
}
22092209
#ifdef FEAT_X11
@@ -3456,11 +3456,21 @@ mch_settmode(int tmode)
34563456
/* but it breaks function keys on MINT */
34573457
# endif
34583458
);
3459-
# ifdef ONLCR /* don't map NL -> CR NL, we do it ourselves */
3459+
# ifdef ONLCR
3460+
// Don't map NL -> CR NL, we do it ourselves.
3461+
// Also disable expanding tabs if possible.
3462+
# ifdef XTABS
3463+
tnew.c_oflag &= ~(ONLCR | XTABS);
3464+
# else
3465+
# ifdef TAB3
3466+
tnew.c_oflag &= ~(ONLCR | TAB3);
3467+
# else
34603468
tnew.c_oflag &= ~ONLCR;
3469+
# endif
3470+
# endif
34613471
# endif
3462-
tnew.c_cc[VMIN] = 1; /* return after 1 char */
3463-
tnew.c_cc[VTIME] = 0; /* don't wait */
3472+
tnew.c_cc[VMIN] = 1; // return after 1 char
3473+
tnew.c_cc[VTIME] = 0; // don't wait
34643474
}
34653475
else if (tmode == TMODE_SLEEP)
34663476
{

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+
2208,
744746
/**/
745747
2207,
746748
/**/

0 commit comments

Comments
 (0)