From 03683c375cb3ded56f7edbcc70619bab1e8dd4f9 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Thu, 25 May 2017 17:39:27 +0100 Subject: tui: Disable interference in guicursor by higher layers. Ironically, higher layers trying to be "smart" about the terminal type but not actually being very smart at all, makes it more difficult rather than less to correct the TUI layer. Note that this orphans the os_term_is_nice() function and down the road, presuming that we do not have to revert this, that function can be removed. It incorporates knowledge of terminal types and behaviours in the wrong place. --- src/nvim/option.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 392a2f3908..0c423c900f 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -969,10 +969,12 @@ void set_init_2(bool headless) p_window = Rows - 1; } set_number_default("window", Rows - 1); +#if 0 // This bodges around problems that should properly be fixed in the TUI layer. if (!headless && !os_term_is_nice()) { set_string_option_direct((char_u *)"guicursor", -1, (char_u *)"", OPT_GLOBAL, SID_NONE); } +#endif parse_shape_opt(SHAPE_CURSOR); // set cursor shapes from 'guicursor' (void)parse_printoptions(); // parse 'printoptions' default value } -- cgit From 6140396d97d700ab6390b4ecfc4fd7da0ebdfd9f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 18:29:42 +0300 Subject: *: Adjust usages of modified functions --- src/nvim/option.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index b48ffae85b..bc101ba703 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5175,9 +5175,12 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, int e * CTRL-V or backslash */ if (valuep == &p_pt) { s = *valuep; - while (*s != NUL) - if (put_escstr(fd, str2special(&s, FALSE), 2) == FAIL) + while (*s != NUL) { + if (put_escstr(fd, (char_u *)str2special((const char **)&s, false), 2) + == FAIL) { return FAIL; + } + } } else if (expand) { buf = xmalloc(MAXPATHL); home_replace(NULL, *valuep, buf, MAXPATHL, FALSE); @@ -6173,15 +6176,16 @@ option_value2string ( } } else { // P_STRING varp = *(char_u **)(varp); - if (varp == NULL) /* just in case */ + if (varp == NULL) { // Just in case. NameBuff[0] = NUL; - else if (opp->flags & P_EXPAND) - home_replace(NULL, varp, NameBuff, MAXPATHL, FALSE); - /* Translate 'pastetoggle' into special key names */ - else if ((char_u **)opp->var == &p_pt) - str2specialbuf(p_pt, NameBuff, MAXPATHL); - else + } else if (opp->flags & P_EXPAND) { + home_replace(NULL, varp, NameBuff, MAXPATHL, false); + // Translate 'pastetoggle' into special key names. + } else if ((char_u **)opp->var == &p_pt) { + str2specialbuf((const char *)p_pt, (char *)NameBuff, MAXPATHL); + } else { STRLCPY(NameBuff, varp, MAXPATHL); + } } } -- cgit From 24f0056ca5cb392f1e1bf38d648a6037acf1f1ef Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 2 Jul 2017 19:37:21 +0300 Subject: message: Add support for replacing `<` to str2special --- src/nvim/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index bc101ba703..7287db6eb8 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5176,7 +5176,8 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, int e if (valuep == &p_pt) { s = *valuep; while (*s != NUL) { - if (put_escstr(fd, (char_u *)str2special((const char **)&s, false), 2) + if (put_escstr(fd, (char_u *)str2special((const char **)&s, false, + false), 2) == FAIL) { return FAIL; } -- cgit From 1ae7744f42fe60ebc2caa383be4d17e714c71c5f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 7 Jul 2017 00:33:20 +0200 Subject: lint --- src/nvim/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 0c423c900f..cc7f8333ff 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -969,7 +969,8 @@ void set_init_2(bool headless) p_window = Rows - 1; } set_number_default("window", Rows - 1); -#if 0 // This bodges around problems that should properly be fixed in the TUI layer. +#if 0 + // This bodges around problems that should be fixed in the TUI layer. if (!headless && !os_term_is_nice()) { set_string_option_direct((char_u *)"guicursor", -1, (char_u *)"", OPT_GLOBAL, SID_NONE); -- cgit From 0ea7e45bc1d1881f505da2b77e0b3e4eb56f12fe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 13:21:38 +0200 Subject: 'cpoptions': remove "<" flag; ignore Closes #6937 "nvim_get_keymap output is unreliable" --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index ed058c420d..37b37e2859 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3034,7 +3034,7 @@ did_set_string_option ( /* 'pastetoggle': translate key codes like in a mapping */ else if (varp == &p_pt) { if (*p_pt) { - (void)replace_termcodes(p_pt, STRLEN(p_pt), &p, true, true, false, + (void)replace_termcodes(p_pt, STRLEN(p_pt), &p, true, true, true, CPO_TO_CPO_FLAGS); if (p != NULL) { if (new_value_alloced) -- cgit