mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
feat(terminal)!: cursor shape and blink (#31562)
When a terminal application running inside the terminal emulator sets the cursor shape or blink status of the cursor, update the cursor in the parent terminal to match. This removes the "virtual cursor" that has been in use by the terminal emulator since the beginning. The original rationale for using the virtual cursor was to avoid having to support additional UI methods to change the cursor color for other (non-TUI) UIs, instead relying on the TermCursor and TermCursorNC highlight groups. The TermCursor highlight group is now used in the default 'guicursor' value, which has a new entry for Terminal mode. However, the TermCursorNC highlight group is no longer supported: since terminal windows now use the real cursor, when the window is not focused there is no cursor displayed in the window at all, so there is nothing to highlight. Users can still use the StatusLineTermNC highlight group to differentiate non-focused terminal windows. BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
This commit is contained in:
@@ -45,6 +45,7 @@ cursorentry_T shape_table[SHAPE_IDX_COUNT] = {
|
||||
{ "more", 0, 0, 0, 0, 0, 0, 0, 0, "m", SHAPE_MOUSE },
|
||||
{ "more_lastline", 0, 0, 0, 0, 0, 0, 0, 0, "ml", SHAPE_MOUSE },
|
||||
{ "showmatch", 0, 0, 0, 100, 100, 100, 0, 0, "sm", SHAPE_CURSOR },
|
||||
{ "terminal", 0, 0, 0, 0, 0, 0, 0, 0, "t", SHAPE_CURSOR },
|
||||
};
|
||||
|
||||
/// Converts cursor_shapes into an Array of Dictionaries
|
||||
@@ -321,6 +322,8 @@ int cursor_get_mode_idx(void)
|
||||
{
|
||||
if (State == MODE_SHOWMATCH) {
|
||||
return SHAPE_IDX_SM;
|
||||
} else if (State == MODE_TERMINAL) {
|
||||
return SHAPE_IDX_TERM;
|
||||
} else if (State & VREPLACE_FLAG) {
|
||||
return SHAPE_IDX_R;
|
||||
} else if (State & REPLACE_FLAG) {
|
||||
|
Reference in New Issue
Block a user