diff options
author | Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> | 2017-06-09 19:33:17 +0100 |
---|---|---|
committer | Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> | 2017-06-09 19:33:17 +0100 |
commit | 6d35c5c7ec7ddd8ef0598565fbadb2d34551bd0d (patch) | |
tree | b4d0ac9b8836334d1ff985505b35312212cdc4f7 | |
parent | 2b35f40fc12dccd0f23c3f89f5f025207370196a (diff) | |
download | rneovim-6d35c5c7ec7ddd8ef0598565fbadb2d34551bd0d.tar.gz rneovim-6d35c5c7ec7ddd8ef0598565fbadb2d34551bd0d.tar.bz2 rneovim-6d35c5c7ec7ddd8ef0598565fbadb2d34551bd0d.zip |
tui: Another linux terminfo capability fix
For the linux terminal type apply the same fixup to the terminfo civis
string that is applied to the cnorm string.
-rw-r--r-- | src/nvim/tui/tui.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 2996d634a2..d017db3651 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -48,7 +48,8 @@ #define STARTS_WITH(str, prefix) (strlen(term) >= (sizeof(prefix) - 1) \ && 0 == memcmp((str), (prefix), sizeof(prefix) - 1)) #define TMUX_WRAP(is_tmux,seq) ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) -#define LINUXRESETC "\x1b[?0c" +#define LINUXSET0C "\x1b[?0c" +#define LINUXSET1C "\x1b[?1c" // Per the commentary in terminfo, only a minus sign is a true suffix // separator. @@ -1270,12 +1271,23 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_str(ut, unibi_cursor_normal, fix_normal); } if (linuxvt - && strlen(fix_normal) >= (sizeof LINUXRESETC - 1) - && !memcmp(strchr(fix_normal,0) - (sizeof LINUXRESETC - 1), LINUXRESETC, sizeof LINUXRESETC - 1)) { + && strlen(fix_normal) >= (sizeof LINUXSET0C - 1) + && !memcmp(strchr(fix_normal,0) - (sizeof LINUXSET0C - 1), LINUXSET0C, sizeof LINUXSET0C - 1)) { // The Linux terminfo entry similarly includes a Linux-idiosyncractic // cursor shape reset in cnorm, which similarly interferes with // set_cursor_style. - fix_normal[strlen(fix_normal) - (sizeof LINUXRESETC - 1)] = 0; + fix_normal[strlen(fix_normal) - (sizeof LINUXSET0C - 1)] = 0; + } + } + char *fix_invisible = (char *)unibi_get_str(ut, unibi_cursor_invisible); + if (fix_invisible) { + if (linuxvt + && strlen(fix_invisible) >= (sizeof LINUXSET1C - 1) + && !memcmp(strchr(fix_invisible,0) - (sizeof LINUXSET1C - 1), LINUXSET1C, sizeof LINUXSET1C - 1)) { + // The Linux terminfo entry similarly includes a Linux-idiosyncractic + // cursor shape reset in cinvis, which similarly interferes with + // set_cursor_style. + fix_invisible[strlen(fix_invisible) - (sizeof LINUXSET1C - 1)] = 0; } } |