mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 12:08:33 +00:00
fix(options): increase t_Co buffer size (#35859)
This commit is contained in:
@@ -2993,8 +2993,6 @@ bool is_tty_option(const char *name)
|
|||||||
return find_tty_option_end(name) != NULL;
|
return find_tty_option_end(name) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TCO_BUFFER_SIZE 8
|
|
||||||
|
|
||||||
/// Get value of TTY option.
|
/// Get value of TTY option.
|
||||||
///
|
///
|
||||||
/// @param name Name of TTY option.
|
/// @param name Name of TTY option.
|
||||||
@@ -3008,8 +3006,8 @@ OptVal get_tty_option(const char *name)
|
|||||||
if (t_colors <= 1) {
|
if (t_colors <= 1) {
|
||||||
value = xstrdup("");
|
value = xstrdup("");
|
||||||
} else {
|
} else {
|
||||||
value = xmalloc(TCO_BUFFER_SIZE);
|
value = xmalloc(NUMBUFLEN);
|
||||||
snprintf(value, TCO_BUFFER_SIZE, "%d", t_colors);
|
snprintf(value, NUMBUFLEN, "%d", t_colors);
|
||||||
}
|
}
|
||||||
} else if (strequal(name, "term")) {
|
} else if (strequal(name, "term")) {
|
||||||
value = p_term ? xstrdup(p_term) : xstrdup("nvim");
|
value = p_term ? xstrdup(p_term) : xstrdup("nvim");
|
||||||
|
@@ -228,7 +228,12 @@ describe('UI can set terminal option', function()
|
|||||||
it('term_colors', function()
|
it('term_colors', function()
|
||||||
eq('256', eval '&t_Co')
|
eq('256', eval '&t_Co')
|
||||||
|
|
||||||
local _ = Screen.new(20, 5, { term_colors = 8 })
|
local screen = Screen.new(20, 5, { term_colors = 8 })
|
||||||
eq('8', eval '&t_Co')
|
eq('8', eval '&t_Co')
|
||||||
|
screen:detach()
|
||||||
|
|
||||||
|
screen = Screen.new(20, 5, { term_colors = 16777216 })
|
||||||
|
eq('16777216', eval '&t_Co')
|
||||||
|
screen:detach()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user