mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 19:48:32 +00:00
lint
This commit is contained in:
@@ -969,7 +969,8 @@ void set_init_2(bool headless)
|
|||||||
p_window = Rows - 1;
|
p_window = Rows - 1;
|
||||||
}
|
}
|
||||||
set_number_default("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()) {
|
if (!headless && !os_term_is_nice()) {
|
||||||
set_string_option_direct((char_u *)"guicursor", -1, (char_u *)"",
|
set_string_option_direct((char_u *)"guicursor", -1, (char_u *)"",
|
||||||
OPT_GLOBAL, SID_NONE);
|
OPT_GLOBAL, SID_NONE);
|
||||||
|
@@ -5824,13 +5824,12 @@ static void screen_char(unsigned off, int row, int col)
|
|||||||
if (row >= screen_Rows || col >= screen_Columns)
|
if (row >= screen_Rows || col >= screen_Columns)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Outputting the last character on the screen may scrollup the screen.
|
// Outputting the last character on the screen may scrollup the screen.
|
||||||
* Don't to it! Mark the character invalid (update it when scrolled up)
|
// Don't to it! Mark the character invalid (update it when scrolled up)
|
||||||
* FIXME: The premise here is not actually true. c.f. deferred wrap */
|
// FIXME: The premise here is not actually true (cf. deferred wrap).
|
||||||
if (row == screen_Rows - 1 && col == screen_Columns - 1
|
if (row == screen_Rows - 1 && col == screen_Columns - 1
|
||||||
/* account for first command-line character in rightleft mode */
|
// account for first command-line character in rightleft mode
|
||||||
&& !cmdmsg_rl
|
&& !cmdmsg_rl) {
|
||||||
) {
|
|
||||||
ScreenAttrs[off] = (sattr_T)-1;
|
ScreenAttrs[off] = (sattr_T)-1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -115,6 +115,7 @@ unibi_term *load_builtin_terminfo(const char * term)
|
|||||||
return unibi_from_mem((const char *)vte_256colour_terminfo,
|
return unibi_from_mem((const char *)vte_256colour_terminfo,
|
||||||
sizeof vte_256colour_terminfo);
|
sizeof vte_256colour_terminfo);
|
||||||
} else {
|
} else {
|
||||||
return unibi_from_mem((const char *)ansi_terminfo, sizeof ansi_terminfo);
|
return unibi_from_mem((const char *)ansi_terminfo,
|
||||||
|
sizeof ansi_terminfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
#ifndef NVIM_TUI_TERMINFO_H
|
#ifndef NVIM_TUI_TERMINFO_H
|
||||||
#define NVIM_TUI_TERMINFO_H
|
#define NVIM_TUI_TERMINFO_H
|
||||||
|
|
||||||
|
#include <unibilium.h>
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "tui/terminfo.h.generated.h"
|
# include "tui/terminfo.h.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1254,7 +1254,8 @@ static int unibi_find_ext_bool(unibi_term *ut, const char *name)
|
|||||||
/// external or a built-in database. In an ideal world, the real terminfo data
|
/// external or a built-in database. In an ideal world, the real terminfo data
|
||||||
/// would be correct and complete, and this function would be almost empty.
|
/// would be correct and complete, and this function would be almost empty.
|
||||||
static void patch_terminfo_bugs(TUIData *data, const char *term,
|
static void patch_terminfo_bugs(TUIData *data, const char *term,
|
||||||
const char *colorterm, long vte_version, bool konsole, bool iterm_env)
|
const char *colorterm, long vte_version,
|
||||||
|
bool konsole, bool iterm_env)
|
||||||
{
|
{
|
||||||
unibi_term *ut = data->ut;
|
unibi_term *ut = data->ut;
|
||||||
const char * xterm_version = os_getenv("XTERM_VERSION");
|
const char * xterm_version = os_getenv("XTERM_VERSION");
|
||||||
@@ -1411,8 +1412,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
|
|||||||
unibi_set_num(ut, unibi_max_colors, 256);
|
unibi_set_num(ut, unibi_max_colors, 256);
|
||||||
unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256);
|
unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF_256);
|
||||||
unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256);
|
unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB_256);
|
||||||
} else
|
} else if (konsole || xterm || gnome || rxvt || st || putty
|
||||||
if (konsole || xterm || gnome || rxvt || st || putty
|
|
||||||
|| linuxvt // Linux 4.8+ supports 256-colour SGR.
|
|| linuxvt // Linux 4.8+ supports 256-colour SGR.
|
||||||
|| mate_pretending_xterm || gnome_pretending_xterm
|
|| mate_pretending_xterm || gnome_pretending_xterm
|
||||||
|| tmux || tmux_pretending_screen
|
|| tmux || tmux_pretending_screen
|
||||||
@@ -1455,23 +1455,23 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
|
|||||||
// console-terminal-emulator from the nosh toolset, which does indeed
|
// console-terminal-emulator from the nosh toolset, which does indeed
|
||||||
// implement the xterm extension:
|
// implement the xterm extension:
|
||||||
|| (linuxvt && (xterm_version || (vte_version > 0) || colorterm))) {
|
|| (linuxvt && (xterm_version || (vte_version > 0) || colorterm))) {
|
||||||
data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss",
|
data->unibi_ext.set_cursor_style =
|
||||||
"\x1b[%p1%d q");
|
(int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q");
|
||||||
if (-1 == data->unibi_ext.reset_cursor_style) {
|
if (-1 == data->unibi_ext.reset_cursor_style) {
|
||||||
data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se",
|
data->unibi_ext.reset_cursor_style = (int)unibi_add_ext_str(ut, "Se",
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style,
|
unibi_set_ext_str(ut, (size_t)data->unibi_ext.reset_cursor_style,
|
||||||
"\x1b[ q");
|
"\x1b[ q");
|
||||||
} else
|
} else if (
|
||||||
if (putty // per MinTTY 0.4.3-1 release notes from 2009
|
// per MinTTY 0.4.3-1 release notes from 2009
|
||||||
|
putty
|
||||||
// per https://bugzilla.gnome.org/show_bug.cgi?id=720821
|
// per https://bugzilla.gnome.org/show_bug.cgi?id=720821
|
||||||
|| (vte_version >= 3900)
|
|| (vte_version >= 3900)
|
||||||
// per tmux manual page and per
|
// per tmux manual page and per
|
||||||
// https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html
|
// https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html
|
||||||
|| screen) {
|
|| screen) {
|
||||||
// Since we use the xterm extension, we have to map it to the unextended
|
// Since we use the xterm extension, we must map it to the unextended form
|
||||||
// form.
|
|
||||||
data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss",
|
data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss",
|
||||||
"\x1b[%?"
|
"\x1b[%?"
|
||||||
"%p1%{4}%>" "%t%p1%{2}%-" // a bit of a bodge for extension values
|
"%p1%{4}%>" "%t%p1%{2}%-" // a bit of a bodge for extension values
|
||||||
|
Reference in New Issue
Block a user