Mercurial > vim
changeset 18428:9f7a2cfabfba v8.1.2208
patch 8.1.2208: Unix: Tabs in output might be expanded to spaces
Commit: https://github.com/vim/vim/commit/faf626e5d1ca128e4bf943c4e505f08d428ed77e
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 24 17:43:25 2019 +0200
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 https://github.com/vim/vim/issues/5108)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Oct 2019 17:45:05 +0200 |
parents | 089d9b0658cc |
children | eb34c93ff760 |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 18 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -2201,9 +2201,9 @@ mch_settitle(char_u *title, char_u *icon if (*T_CIS != NUL) { - out_str(T_CIS); /* set icon start */ + out_str(T_CIS); // set icon start out_str_nf(icon); - out_str(T_CIE); /* set icon end */ + out_str(T_CIE); // set icon end out_flush(); } #ifdef FEAT_X11 @@ -3456,11 +3456,21 @@ mch_settmode(int tmode) /* but it breaks function keys on MINT */ # endif ); -# ifdef ONLCR /* don't map NL -> CR NL, we do it ourselves */ +# ifdef ONLCR + // Don't map NL -> CR NL, we do it ourselves. + // Also disable expanding tabs if possible. +# ifdef XTABS + tnew.c_oflag &= ~(ONLCR | XTABS); +# else +# ifdef TAB3 + tnew.c_oflag &= ~(ONLCR | TAB3); +# else tnew.c_oflag &= ~ONLCR; -# endif - tnew.c_cc[VMIN] = 1; /* return after 1 char */ - tnew.c_cc[VTIME] = 0; /* don't wait */ +# endif +# endif +# endif + tnew.c_cc[VMIN] = 1; // return after 1 char + tnew.c_cc[VTIME] = 0; // don't wait } else if (tmode == TMODE_SLEEP) {