mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +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:
@@ -38,6 +38,10 @@ DIAGNOSTICS
|
|||||||
- The "cursor_position" parameter of |vim.diagnostic.JumpOpts| is renamed to
|
- The "cursor_position" parameter of |vim.diagnostic.JumpOpts| is renamed to
|
||||||
"pos"
|
"pos"
|
||||||
|
|
||||||
|
HIGHLIGHTS
|
||||||
|
• *TermCursorNC* As of Nvim 0.11, unfocused |terminal| windows no
|
||||||
|
longer have any cursor.
|
||||||
|
|
||||||
TREESITTER
|
TREESITTER
|
||||||
• *TSNode:child_containing_descendant()* Use
|
• *TSNode:child_containing_descendant()* Use
|
||||||
|TSNode:child_with_descendant()| instead; it is identical except that it can
|
|TSNode:child_with_descendant()| instead; it is identical except that it can
|
||||||
|
@@ -87,6 +87,11 @@ EVENTS
|
|||||||
• |vim.ui_attach()| callbacks for |ui-messages| `msg_show` events are executed in
|
• |vim.ui_attach()| callbacks for |ui-messages| `msg_show` events are executed in
|
||||||
|api-fast| context.
|
|api-fast| context.
|
||||||
|
|
||||||
|
HIGHLIGHTS
|
||||||
|
|
||||||
|
• |TermCursorNC| is removed and no longer supported. Unfocused terminals no
|
||||||
|
longer have a cursor.
|
||||||
|
|
||||||
LSP
|
LSP
|
||||||
|
|
||||||
• Improved rendering of LSP hover docs. |K-lsp-default|
|
• Improved rendering of LSP hover docs. |K-lsp-default|
|
||||||
@@ -281,6 +286,12 @@ TERMINAL
|
|||||||
'scrollback' are not reflown.
|
'scrollback' are not reflown.
|
||||||
• The |terminal| now supports OSC 8 escape sequences and will display
|
• The |terminal| now supports OSC 8 escape sequences and will display
|
||||||
hyperlinks in supporting host terminals.
|
hyperlinks in supporting host terminals.
|
||||||
|
• The |terminal| now uses the actual cursor, rather than a "virtual" cursor.
|
||||||
|
This means that escape codes sent by applications running in a terminal
|
||||||
|
buffer can change the cursor shape and visibility. However, it also
|
||||||
|
means that the |TermCursorNC| highlight group is no longer supported: an
|
||||||
|
unfocused terminal window will have no cursor at all (so there is nothing to
|
||||||
|
highlight).
|
||||||
|
|
||||||
TREESITTER
|
TREESITTER
|
||||||
|
|
||||||
|
@@ -2977,7 +2977,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
An |OptionSet| autocmd can be used to set it up to match automatically.
|
An |OptionSet| autocmd can be used to set it up to match automatically.
|
||||||
|
|
||||||
*'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
|
*'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
|
||||||
'guicursor' 'gcr' string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20")
|
'guicursor' 'gcr' string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20,t:block-blinkon500-blinkoff500-TermCursor")
|
||||||
global
|
global
|
||||||
Configures the cursor style for each mode. Works in the GUI and many
|
Configures the cursor style for each mode. Works in the GUI and many
|
||||||
terminals. See |tui-cursor-shape|.
|
terminals. See |tui-cursor-shape|.
|
||||||
@@ -3005,6 +3005,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
ci Command-line Insert mode
|
ci Command-line Insert mode
|
||||||
cr Command-line Replace mode
|
cr Command-line Replace mode
|
||||||
sm showmatch in Insert mode
|
sm showmatch in Insert mode
|
||||||
|
t Terminal mode
|
||||||
a all modes
|
a all modes
|
||||||
The argument-list is a dash separated list of these arguments:
|
The argument-list is a dash separated list of these arguments:
|
||||||
hor{N} horizontal bar, {N} percent of the character height
|
hor{N} horizontal bar, {N} percent of the character height
|
||||||
@@ -3021,7 +3022,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
cursor is not shown. Times are in msec. When one of
|
cursor is not shown. Times are in msec. When one of
|
||||||
the numbers is zero, there is no blinking. E.g.: >vim
|
the numbers is zero, there is no blinking. E.g.: >vim
|
||||||
set guicursor=n:blinkon0
|
set guicursor=n:blinkon0
|
||||||
< - Default is "blinkon0" for each mode.
|
<
|
||||||
|
Default is "blinkon0" for each mode.
|
||||||
{group-name}
|
{group-name}
|
||||||
Highlight group that decides the color and font of the
|
Highlight group that decides the color and font of the
|
||||||
cursor.
|
cursor.
|
||||||
|
@@ -5162,8 +5162,6 @@ EndOfBuffer Filler lines (~) after the end of the buffer.
|
|||||||
By default, this is highlighted like |hl-NonText|.
|
By default, this is highlighted like |hl-NonText|.
|
||||||
*hl-TermCursor*
|
*hl-TermCursor*
|
||||||
TermCursor Cursor in a focused terminal.
|
TermCursor Cursor in a focused terminal.
|
||||||
*hl-TermCursorNC*
|
|
||||||
TermCursorNC Cursor in an unfocused terminal.
|
|
||||||
*hl-ErrorMsg*
|
*hl-ErrorMsg*
|
||||||
ErrorMsg Error messages on the command line.
|
ErrorMsg Error messages on the command line.
|
||||||
*hl-WinSeparator*
|
*hl-WinSeparator*
|
||||||
|
@@ -101,7 +101,7 @@ Configuration *terminal-config*
|
|||||||
|
|
||||||
Options: 'modified', 'scrollback'
|
Options: 'modified', 'scrollback'
|
||||||
Events: |TermOpen|, |TermEnter|, |TermLeave|, |TermClose|
|
Events: |TermOpen|, |TermEnter|, |TermLeave|, |TermClose|
|
||||||
Highlight groups: |hl-TermCursor|, |hl-TermCursorNC|
|
Highlight groups: |hl-TermCursor|
|
||||||
|
|
||||||
Terminal sets local defaults for some options, which may differ from your
|
Terminal sets local defaults for some options, which may differ from your
|
||||||
global configuration.
|
global configuration.
|
||||||
|
@@ -325,7 +325,6 @@ Highlight groups:
|
|||||||
- |hl-MsgSeparator| highlights separator for scrolled messages
|
- |hl-MsgSeparator| highlights separator for scrolled messages
|
||||||
- |hl-Substitute|
|
- |hl-Substitute|
|
||||||
- |hl-TermCursor|
|
- |hl-TermCursor|
|
||||||
- |hl-TermCursorNC|
|
|
||||||
- |hl-WinSeparator| highlights window separators
|
- |hl-WinSeparator| highlights window separators
|
||||||
- |hl-Whitespace| highlights 'listchars' whitespace
|
- |hl-Whitespace| highlights 'listchars' whitespace
|
||||||
- |hl-WinBar| highlights 'winbar'
|
- |hl-WinBar| highlights 'winbar'
|
||||||
|
6
runtime/lua/vim/_meta/options.lua
generated
6
runtime/lua/vim/_meta/options.lua
generated
@@ -2783,6 +2783,7 @@ vim.go.gp = vim.go.grepprg
|
|||||||
--- ci Command-line Insert mode
|
--- ci Command-line Insert mode
|
||||||
--- cr Command-line Replace mode
|
--- cr Command-line Replace mode
|
||||||
--- sm showmatch in Insert mode
|
--- sm showmatch in Insert mode
|
||||||
|
--- t Terminal mode
|
||||||
--- a all modes
|
--- a all modes
|
||||||
--- The argument-list is a dash separated list of these arguments:
|
--- The argument-list is a dash separated list of these arguments:
|
||||||
--- hor{N} horizontal bar, {N} percent of the character height
|
--- hor{N} horizontal bar, {N} percent of the character height
|
||||||
@@ -2802,7 +2803,8 @@ vim.go.gp = vim.go.grepprg
|
|||||||
--- ```vim
|
--- ```vim
|
||||||
--- set guicursor=n:blinkon0
|
--- set guicursor=n:blinkon0
|
||||||
--- ```
|
--- ```
|
||||||
--- - Default is "blinkon0" for each mode.
|
---
|
||||||
|
--- Default is "blinkon0" for each mode.
|
||||||
--- {group-name}
|
--- {group-name}
|
||||||
--- Highlight group that decides the color and font of the
|
--- Highlight group that decides the color and font of the
|
||||||
--- cursor.
|
--- cursor.
|
||||||
@@ -2848,7 +2850,7 @@ vim.go.gp = vim.go.grepprg
|
|||||||
---
|
---
|
||||||
---
|
---
|
||||||
--- @type string
|
--- @type string
|
||||||
vim.o.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20"
|
vim.o.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20,t:block-blinkon500-blinkoff500-TermCursor"
|
||||||
vim.o.gcr = vim.o.guicursor
|
vim.o.gcr = vim.o.guicursor
|
||||||
vim.go.guicursor = vim.o.guicursor
|
vim.go.guicursor = vim.o.guicursor
|
||||||
vim.go.gcr = vim.go.guicursor
|
vim.go.gcr = vim.go.guicursor
|
||||||
|
@@ -63,7 +63,7 @@ syn keyword vimGroup contained Comment Constant String Character Number Boolean
|
|||||||
syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC CursorIM LineNrAbove LineNrBelow
|
syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC CursorIM LineNrAbove LineNrBelow
|
||||||
syn match vimHLGroup contained "\<Conceal\>"
|
syn match vimHLGroup contained "\<Conceal\>"
|
||||||
syn keyword vimOnlyHLGroup contained Menu Scrollbar ToolbarButton ToolbarLine Tooltip VisualNOS
|
syn keyword vimOnlyHLGroup contained Menu Scrollbar ToolbarButton ToolbarLine Tooltip VisualNOS
|
||||||
syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor TermCursorNC VisualNC Whitespace WinBar WinBarNC WinSeparator
|
syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor VisualNC Whitespace WinBar WinBarNC WinSeparator
|
||||||
"}}}2
|
"}}}2
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
|
@@ -341,9 +341,11 @@ void check_cursor_col(win_T *win)
|
|||||||
} else if (win->w_cursor.col >= len) {
|
} else if (win->w_cursor.col >= len) {
|
||||||
// Allow cursor past end-of-line when:
|
// Allow cursor past end-of-line when:
|
||||||
// - in Insert mode or restarting Insert mode
|
// - in Insert mode or restarting Insert mode
|
||||||
|
// - in Terminal mode
|
||||||
// - in Visual mode and 'selection' isn't "old"
|
// - in Visual mode and 'selection' isn't "old"
|
||||||
// - 'virtualedit' is set
|
// - 'virtualedit' is set
|
||||||
if ((State & MODE_INSERT) || restart_edit
|
if ((State & MODE_INSERT) || restart_edit
|
||||||
|
|| (State & MODE_TERMINAL)
|
||||||
|| (VIsual_active && *p_sel != 'o')
|
|| (VIsual_active && *p_sel != 'o')
|
||||||
|| (cur_ve_flags & kOptVeFlagOnemore)
|
|| (cur_ve_flags & kOptVeFlagOnemore)
|
||||||
|| virtual_active(win)) {
|
|| virtual_active(win)) {
|
||||||
|
@@ -45,6 +45,7 @@ cursorentry_T shape_table[SHAPE_IDX_COUNT] = {
|
|||||||
{ "more", 0, 0, 0, 0, 0, 0, 0, 0, "m", SHAPE_MOUSE },
|
{ "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 },
|
{ "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 },
|
{ "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
|
/// Converts cursor_shapes into an Array of Dictionaries
|
||||||
@@ -321,6 +322,8 @@ int cursor_get_mode_idx(void)
|
|||||||
{
|
{
|
||||||
if (State == MODE_SHOWMATCH) {
|
if (State == MODE_SHOWMATCH) {
|
||||||
return SHAPE_IDX_SM;
|
return SHAPE_IDX_SM;
|
||||||
|
} else if (State == MODE_TERMINAL) {
|
||||||
|
return SHAPE_IDX_TERM;
|
||||||
} else if (State & VREPLACE_FLAG) {
|
} else if (State & VREPLACE_FLAG) {
|
||||||
return SHAPE_IDX_R;
|
return SHAPE_IDX_R;
|
||||||
} else if (State & REPLACE_FLAG) {
|
} else if (State & REPLACE_FLAG) {
|
||||||
|
@@ -23,7 +23,8 @@ typedef enum {
|
|||||||
SHAPE_IDX_MORE = 14, ///< Hit-return or More
|
SHAPE_IDX_MORE = 14, ///< Hit-return or More
|
||||||
SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line
|
SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line
|
||||||
SHAPE_IDX_SM = 16, ///< showing matching paren
|
SHAPE_IDX_SM = 16, ///< showing matching paren
|
||||||
SHAPE_IDX_COUNT = 17,
|
SHAPE_IDX_TERM = 17, ///< Terminal mode
|
||||||
|
SHAPE_IDX_COUNT = 18,
|
||||||
} ModeShape;
|
} ModeShape;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@@ -15,7 +15,6 @@ EXTERN const char *hlf_names[] INIT( = {
|
|||||||
[HLF_8] = "SpecialKey",
|
[HLF_8] = "SpecialKey",
|
||||||
[HLF_EOB] = "EndOfBuffer",
|
[HLF_EOB] = "EndOfBuffer",
|
||||||
[HLF_TERM] = "TermCursor",
|
[HLF_TERM] = "TermCursor",
|
||||||
[HLF_TERMNC] = "TermCursorNC",
|
|
||||||
[HLF_AT] = "NonText",
|
[HLF_AT] = "NonText",
|
||||||
[HLF_D] = "Directory",
|
[HLF_D] = "Directory",
|
||||||
[HLF_E] = "ErrorMsg",
|
[HLF_E] = "ErrorMsg",
|
||||||
|
@@ -63,7 +63,6 @@ typedef enum {
|
|||||||
///< displayed different from what it is
|
///< displayed different from what it is
|
||||||
HLF_EOB, ///< after the last line in the buffer
|
HLF_EOB, ///< after the last line in the buffer
|
||||||
HLF_TERM, ///< terminal cursor focused
|
HLF_TERM, ///< terminal cursor focused
|
||||||
HLF_TERMNC, ///< terminal cursor unfocused
|
|
||||||
HLF_AT, ///< @ characters at end of screen, characters that don't really exist in the text
|
HLF_AT, ///< @ characters at end of screen, characters that don't really exist in the text
|
||||||
HLF_D, ///< directories in CTRL-D listing
|
HLF_D, ///< directories in CTRL-D listing
|
||||||
HLF_E, ///< error messages
|
HLF_E, ///< error messages
|
||||||
|
@@ -178,7 +178,6 @@ static const char *highlight_init_both[] = {
|
|||||||
"default link StatusLineTermNC StatusLineNC",
|
"default link StatusLineTermNC StatusLineNC",
|
||||||
"default link TabLine StatusLineNC",
|
"default link TabLine StatusLineNC",
|
||||||
"default link TabLineFill TabLine",
|
"default link TabLineFill TabLine",
|
||||||
"default link TermCursorNC NONE",
|
|
||||||
"default link VertSplit WinSeparator",
|
"default link VertSplit WinSeparator",
|
||||||
"default link VisualNOS Visual",
|
"default link VisualNOS Visual",
|
||||||
"default link Whitespace NonText",
|
"default link Whitespace NonText",
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
// option_vars.h: definition of global variables for settable options
|
// option_vars.h: definition of global variables for settable options
|
||||||
|
|
||||||
#define HIGHLIGHT_INIT \
|
#define HIGHLIGHT_INIT \
|
||||||
"8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg," \
|
"8:SpecialKey,~:EndOfBuffer,z:TermCursor,@:NonText,d:Directory,e:ErrorMsg," \
|
||||||
"i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow," \
|
"i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow," \
|
||||||
"N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC," \
|
"N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC," \
|
||||||
"c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn," \
|
"c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn," \
|
||||||
|
@@ -3631,7 +3631,9 @@ return {
|
|||||||
{
|
{
|
||||||
abbreviation = 'gcr',
|
abbreviation = 'gcr',
|
||||||
cb = 'did_set_guicursor',
|
cb = 'did_set_guicursor',
|
||||||
defaults = { if_true = 'n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20' },
|
defaults = {
|
||||||
|
if_true = 'n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20,t:block-blinkon500-blinkoff500-TermCursor',
|
||||||
|
},
|
||||||
deny_duplicates = true,
|
deny_duplicates = true,
|
||||||
desc = [=[
|
desc = [=[
|
||||||
Configures the cursor style for each mode. Works in the GUI and many
|
Configures the cursor style for each mode. Works in the GUI and many
|
||||||
@@ -3660,6 +3662,7 @@ return {
|
|||||||
ci Command-line Insert mode
|
ci Command-line Insert mode
|
||||||
cr Command-line Replace mode
|
cr Command-line Replace mode
|
||||||
sm showmatch in Insert mode
|
sm showmatch in Insert mode
|
||||||
|
t Terminal mode
|
||||||
a all modes
|
a all modes
|
||||||
The argument-list is a dash separated list of these arguments:
|
The argument-list is a dash separated list of these arguments:
|
||||||
hor{N} horizontal bar, {N} percent of the character height
|
hor{N} horizontal bar, {N} percent of the character height
|
||||||
@@ -3676,7 +3679,8 @@ return {
|
|||||||
cursor is not shown. Times are in msec. When one of
|
cursor is not shown. Times are in msec. When one of
|
||||||
the numbers is zero, there is no blinking. E.g.: >vim
|
the numbers is zero, there is no blinking. E.g.: >vim
|
||||||
set guicursor=n:blinkon0
|
set guicursor=n:blinkon0
|
||||||
< - Default is "blinkon0" for each mode.
|
<
|
||||||
|
Default is "blinkon0" for each mode.
|
||||||
{group-name}
|
{group-name}
|
||||||
Highlight group that decides the color and font of the
|
Highlight group that decides the color and font of the
|
||||||
cursor.
|
cursor.
|
||||||
|
@@ -138,14 +138,20 @@ void state_handle_k_event(void)
|
|||||||
/// Return true if in the current mode we need to use virtual.
|
/// Return true if in the current mode we need to use virtual.
|
||||||
bool virtual_active(win_T *wp)
|
bool virtual_active(win_T *wp)
|
||||||
{
|
{
|
||||||
unsigned cur_ve_flags = get_ve_flags(wp);
|
|
||||||
|
|
||||||
// While an operator is being executed we return "virtual_op", because
|
// While an operator is being executed we return "virtual_op", because
|
||||||
// VIsual_active has already been reset, thus we can't check for "block"
|
// VIsual_active has already been reset, thus we can't check for "block"
|
||||||
// being used.
|
// being used.
|
||||||
if (virtual_op != kNone) {
|
if (virtual_op != kNone) {
|
||||||
return virtual_op;
|
return virtual_op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In Terminal mode the cursor can be positioned anywhere by the application
|
||||||
|
if (State & MODE_TERMINAL) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned cur_ve_flags = get_ve_flags(wp);
|
||||||
|
|
||||||
return cur_ve_flags == kOptVeFlagAll
|
return cur_ve_flags == kOptVeFlagAll
|
||||||
|| ((cur_ve_flags & kOptVeFlagBlock) && VIsual_active && VIsual_mode == Ctrl_V)
|
|| ((cur_ve_flags & kOptVeFlagBlock) && VIsual_active && VIsual_mode == Ctrl_V)
|
||||||
|| ((cur_ve_flags & kOptVeFlagInsert) && (State & MODE_INSERT));
|
|| ((cur_ve_flags & kOptVeFlagInsert) && (State & MODE_INSERT));
|
||||||
|
@@ -52,6 +52,7 @@
|
|||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
#include "nvim/channel_defs.h"
|
#include "nvim/channel_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
|
#include "nvim/cursor_shape.h"
|
||||||
#include "nvim/drawline.h"
|
#include "nvim/drawline.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
@@ -160,15 +161,19 @@ struct terminal {
|
|||||||
int invalid_start, invalid_end; // invalid rows in libvterm screen
|
int invalid_start, invalid_end; // invalid rows in libvterm screen
|
||||||
struct {
|
struct {
|
||||||
int row, col;
|
int row, col;
|
||||||
|
int shape;
|
||||||
bool visible;
|
bool visible;
|
||||||
|
bool blink;
|
||||||
} cursor;
|
} cursor;
|
||||||
bool pending_resize; // pending width/height
|
|
||||||
|
struct {
|
||||||
|
bool resize; ///< pending width/height
|
||||||
|
bool cursor; ///< pending cursor shape or blink change
|
||||||
|
StringBuilder *send; ///< When there is a pending TermRequest autocommand, block and store input.
|
||||||
|
} pending;
|
||||||
|
|
||||||
bool color_set[16];
|
bool color_set[16];
|
||||||
|
|
||||||
// When there is a pending TermRequest autocommand, block and store input.
|
|
||||||
StringBuilder *pending_send;
|
|
||||||
|
|
||||||
char *selection_buffer; /// libvterm selection buffer
|
char *selection_buffer; /// libvterm selection buffer
|
||||||
StringBuilder selection; /// Growable array containing full selection data
|
StringBuilder selection; /// Growable array containing full selection data
|
||||||
|
|
||||||
@@ -207,24 +212,24 @@ static void emit_termrequest(void **argv)
|
|||||||
apply_autocmds_group(EVENT_TERMREQUEST, NULL, NULL, false, AUGROUP_ALL, buf, NULL, &data);
|
apply_autocmds_group(EVENT_TERMREQUEST, NULL, NULL, false, AUGROUP_ALL, buf, NULL, &data);
|
||||||
xfree(payload);
|
xfree(payload);
|
||||||
|
|
||||||
StringBuilder *term_pending_send = term->pending_send;
|
StringBuilder *term_pending_send = term->pending.send;
|
||||||
term->pending_send = NULL;
|
term->pending.send = NULL;
|
||||||
if (kv_size(*pending_send)) {
|
if (kv_size(*pending_send)) {
|
||||||
terminal_send(term, pending_send->items, pending_send->size);
|
terminal_send(term, pending_send->items, pending_send->size);
|
||||||
kv_destroy(*pending_send);
|
kv_destroy(*pending_send);
|
||||||
}
|
}
|
||||||
if (term_pending_send != pending_send) {
|
if (term_pending_send != pending_send) {
|
||||||
term->pending_send = term_pending_send;
|
term->pending.send = term_pending_send;
|
||||||
}
|
}
|
||||||
xfree(pending_send);
|
xfree(pending_send);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void schedule_termrequest(Terminal *term, char *payload, size_t payload_length)
|
static void schedule_termrequest(Terminal *term, char *payload, size_t payload_length)
|
||||||
{
|
{
|
||||||
term->pending_send = xmalloc(sizeof(StringBuilder));
|
term->pending.send = xmalloc(sizeof(StringBuilder));
|
||||||
kv_init(*term->pending_send);
|
kv_init(*term->pending.send);
|
||||||
multiqueue_put(main_loop.events, emit_termrequest, term, payload, (void *)payload_length,
|
multiqueue_put(main_loop.events, emit_termrequest, term, payload, (void *)payload_length,
|
||||||
term->pending_send);
|
term->pending.send);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_osc8(VTermStringFragment frag, int *attr)
|
static int parse_osc8(VTermStringFragment frag, int *attr)
|
||||||
@@ -363,7 +368,7 @@ void terminal_open(Terminal **termpp, buf_T *buf, TerminalOptions opts)
|
|||||||
// Create a new terminal instance and configure it
|
// Create a new terminal instance and configure it
|
||||||
Terminal *term = *termpp = xcalloc(1, sizeof(Terminal));
|
Terminal *term = *termpp = xcalloc(1, sizeof(Terminal));
|
||||||
term->opts = opts;
|
term->opts = opts;
|
||||||
term->cursor.visible = true;
|
|
||||||
// Associate the terminal instance with the new buffer
|
// Associate the terminal instance with the new buffer
|
||||||
term->buf_handle = buf->handle;
|
term->buf_handle = buf->handle;
|
||||||
buf->terminal = term;
|
buf->terminal = term;
|
||||||
@@ -387,6 +392,28 @@ void terminal_open(Terminal **termpp, buf_T *buf, TerminalOptions opts)
|
|||||||
vterm_state_set_selection_callbacks(state, &vterm_selection_callbacks, term,
|
vterm_state_set_selection_callbacks(state, &vterm_selection_callbacks, term,
|
||||||
term->selection_buffer, SELECTIONBUF_SIZE);
|
term->selection_buffer, SELECTIONBUF_SIZE);
|
||||||
|
|
||||||
|
VTermValue cursor_shape;
|
||||||
|
switch (shape_table[SHAPE_IDX_TERM].shape) {
|
||||||
|
case SHAPE_BLOCK:
|
||||||
|
cursor_shape.number = VTERM_PROP_CURSORSHAPE_BLOCK;
|
||||||
|
break;
|
||||||
|
case SHAPE_HOR:
|
||||||
|
cursor_shape.number = VTERM_PROP_CURSORSHAPE_UNDERLINE;
|
||||||
|
break;
|
||||||
|
case SHAPE_VER:
|
||||||
|
cursor_shape.number = VTERM_PROP_CURSORSHAPE_BAR_LEFT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vterm_state_set_termprop(state, VTERM_PROP_CURSORSHAPE, &cursor_shape);
|
||||||
|
|
||||||
|
VTermValue cursor_blink;
|
||||||
|
if (shape_table[SHAPE_IDX_TERM].blinkon != 0 && shape_table[SHAPE_IDX_TERM].blinkoff != 0) {
|
||||||
|
cursor_blink.boolean = true;
|
||||||
|
} else {
|
||||||
|
cursor_blink.boolean = false;
|
||||||
|
}
|
||||||
|
vterm_state_set_termprop(state, VTERM_PROP_CURSORBLINK, &cursor_blink);
|
||||||
|
|
||||||
// force a initial refresh of the screen to ensure the buffer will always
|
// force a initial refresh of the screen to ensure the buffer will always
|
||||||
// have as many lines as screen rows when refresh_scrollback is called
|
// have as many lines as screen rows when refresh_scrollback is called
|
||||||
term->invalid_start = 0;
|
term->invalid_start = 0;
|
||||||
@@ -565,7 +592,7 @@ void terminal_check_size(Terminal *term)
|
|||||||
|
|
||||||
vterm_set_size(term->vt, height, width);
|
vterm_set_size(term->vt, height, width);
|
||||||
vterm_screen_flush_damage(term->vts);
|
vterm_screen_flush_damage(term->vts);
|
||||||
term->pending_resize = true;
|
term->pending.resize = true;
|
||||||
invalidate_terminal(term, -1, -1);
|
invalidate_terminal(term, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,16 +641,28 @@ bool terminal_enter(void)
|
|||||||
curwin->w_p_so = 0;
|
curwin->w_p_so = 0;
|
||||||
curwin->w_p_siso = 0;
|
curwin->w_p_siso = 0;
|
||||||
|
|
||||||
|
// Save the existing cursor entry since it may be modified by the application
|
||||||
|
cursorentry_T save_cursorentry = shape_table[SHAPE_IDX_TERM];
|
||||||
|
|
||||||
|
// Update the cursor shape table and flush changes to the UI
|
||||||
|
s->term->pending.cursor = true;
|
||||||
|
refresh_cursor(s->term);
|
||||||
|
|
||||||
adjust_topline(s->term, buf, 0); // scroll to end
|
adjust_topline(s->term, buf, 0); // scroll to end
|
||||||
// erase the unfocused cursor
|
|
||||||
invalidate_terminal(s->term, s->term->cursor.row, s->term->cursor.row + 1);
|
|
||||||
showmode();
|
showmode();
|
||||||
curwin->w_redr_status = true; // For mode() in statusline. #8323
|
curwin->w_redr_status = true; // For mode() in statusline. #8323
|
||||||
redraw_custom_title_later();
|
redraw_custom_title_later();
|
||||||
ui_busy_start();
|
if (!s->term->cursor.visible) {
|
||||||
|
// Hide cursor if it should be hidden
|
||||||
|
ui_busy_start();
|
||||||
|
}
|
||||||
|
ui_cursor_shape();
|
||||||
apply_autocmds(EVENT_TERMENTER, NULL, NULL, false, curbuf);
|
apply_autocmds(EVENT_TERMENTER, NULL, NULL, false, curbuf);
|
||||||
may_trigger_modechanged();
|
may_trigger_modechanged();
|
||||||
|
|
||||||
|
// Tell the terminal it has focus
|
||||||
|
terminal_focus(s->term, true);
|
||||||
|
|
||||||
s->state.execute = terminal_execute;
|
s->state.execute = terminal_execute;
|
||||||
s->state.check = terminal_check;
|
s->state.check = terminal_check;
|
||||||
state_enter(&s->state);
|
state_enter(&s->state);
|
||||||
@@ -635,6 +674,9 @@ bool terminal_enter(void)
|
|||||||
RedrawingDisabled = s->save_rd;
|
RedrawingDisabled = s->save_rd;
|
||||||
apply_autocmds(EVENT_TERMLEAVE, NULL, NULL, false, curbuf);
|
apply_autocmds(EVENT_TERMLEAVE, NULL, NULL, false, curbuf);
|
||||||
|
|
||||||
|
shape_table[SHAPE_IDX_TERM] = save_cursorentry;
|
||||||
|
ui_mode_info_set();
|
||||||
|
|
||||||
if (save_curwin == curwin->handle) { // Else: window was closed.
|
if (save_curwin == curwin->handle) { // Else: window was closed.
|
||||||
curwin->w_p_cul = save_w_p_cul;
|
curwin->w_p_cul = save_w_p_cul;
|
||||||
if (save_w_p_culopt) {
|
if (save_w_p_culopt) {
|
||||||
@@ -649,8 +691,9 @@ bool terminal_enter(void)
|
|||||||
free_string_option(save_w_p_culopt);
|
free_string_option(save_w_p_culopt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the unfocused cursor
|
// Tell the terminal it lost focus
|
||||||
invalidate_terminal(s->term, s->term->cursor.row, s->term->cursor.row + 1);
|
terminal_focus(s->term, false);
|
||||||
|
|
||||||
if (curbuf->terminal == s->term && !s->close) {
|
if (curbuf->terminal == s->term && !s->close) {
|
||||||
terminal_check_cursor();
|
terminal_check_cursor();
|
||||||
}
|
}
|
||||||
@@ -659,7 +702,11 @@ bool terminal_enter(void)
|
|||||||
} else {
|
} else {
|
||||||
unshowmode(true);
|
unshowmode(true);
|
||||||
}
|
}
|
||||||
ui_busy_stop();
|
if (!s->term->cursor.visible) {
|
||||||
|
// If cursor was hidden, show it again
|
||||||
|
ui_busy_stop();
|
||||||
|
}
|
||||||
|
ui_cursor_shape();
|
||||||
if (s->close) {
|
if (s->close) {
|
||||||
bool wipe = s->term->buf_handle != 0;
|
bool wipe = s->term->buf_handle != 0;
|
||||||
s->term->destroy = true;
|
s->term->destroy = true;
|
||||||
@@ -810,6 +857,19 @@ static int terminal_execute(VimState *state, int key)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (s->term != curbuf->terminal) {
|
if (s->term != curbuf->terminal) {
|
||||||
|
// Active terminal buffer changed, flush terminal's cursor state to the UI
|
||||||
|
curbuf->terminal->pending.cursor = true;
|
||||||
|
|
||||||
|
if (!s->term->cursor.visible) {
|
||||||
|
// If cursor was hidden, show it again
|
||||||
|
ui_busy_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!curbuf->terminal->cursor.visible) {
|
||||||
|
// Hide cursor if it should be hidden
|
||||||
|
ui_busy_start();
|
||||||
|
}
|
||||||
|
|
||||||
invalidate_terminal(s->term, s->term->cursor.row, s->term->cursor.row + 1);
|
invalidate_terminal(s->term, s->term->cursor.row, s->term->cursor.row + 1);
|
||||||
invalidate_terminal(curbuf->terminal,
|
invalidate_terminal(curbuf->terminal,
|
||||||
curbuf->terminal->cursor.row,
|
curbuf->terminal->cursor.row,
|
||||||
@@ -857,8 +917,8 @@ static void terminal_send(Terminal *term, const char *data, size_t size)
|
|||||||
if (term->closed) {
|
if (term->closed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (term->pending_send) {
|
if (term->pending.send) {
|
||||||
kv_concat_len(*term->pending_send, data, size);
|
kv_concat_len(*term->pending.send, data, size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
term->opts.write_cb(data, size, term->opts.data);
|
term->opts.write_cb(data, size, term->opts.data);
|
||||||
@@ -1063,14 +1123,6 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr, int *te
|
|||||||
attr_id = hl_combine_attr(attr_id, cell.uri);
|
attr_id = hl_combine_attr(attr_id, cell.uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (term->cursor.visible && term->cursor.row == row
|
|
||||||
&& term->cursor.col == col) {
|
|
||||||
attr_id = hl_combine_attr(attr_id,
|
|
||||||
is_focused(term) && wp == curwin
|
|
||||||
? win_hl_attr(wp, HLF_TERM)
|
|
||||||
: win_hl_attr(wp, HLF_TERMNC));
|
|
||||||
}
|
|
||||||
|
|
||||||
term_attrs[col] = attr_id;
|
term_attrs[col] = attr_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1085,6 +1137,17 @@ bool terminal_running(const Terminal *term)
|
|||||||
return !term->closed;
|
return !term->closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void terminal_focus(const Terminal *term, bool focus)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
|
{
|
||||||
|
VTermState *state = vterm_obtain_state(term->vt);
|
||||||
|
if (focus) {
|
||||||
|
vterm_state_focus_in(state);
|
||||||
|
} else {
|
||||||
|
vterm_state_focus_out(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
// libvterm callbacks {{{
|
// libvterm callbacks {{{
|
||||||
|
|
||||||
@@ -1106,8 +1169,7 @@ static int term_movecursor(VTermPos new_pos, VTermPos old_pos, int visible, void
|
|||||||
Terminal *term = data;
|
Terminal *term = data;
|
||||||
term->cursor.row = new_pos.row;
|
term->cursor.row = new_pos.row;
|
||||||
term->cursor.col = new_pos.col;
|
term->cursor.col = new_pos.col;
|
||||||
invalidate_terminal(term, old_pos.row, old_pos.row + 1);
|
invalidate_terminal(term, -1, -1);
|
||||||
invalidate_terminal(term, new_pos.row, new_pos.row + 1);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1135,8 +1197,17 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *data)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VTERM_PROP_CURSORVISIBLE:
|
case VTERM_PROP_CURSORVISIBLE:
|
||||||
|
if (is_focused(term)) {
|
||||||
|
if (!val->boolean && term->cursor.visible) {
|
||||||
|
// Hide the cursor
|
||||||
|
ui_busy_start();
|
||||||
|
} else if (val->boolean && !term->cursor.visible) {
|
||||||
|
// Unhide the cursor
|
||||||
|
ui_busy_stop();
|
||||||
|
}
|
||||||
|
invalidate_terminal(term, -1, -1);
|
||||||
|
}
|
||||||
term->cursor.visible = val->boolean;
|
term->cursor.visible = val->boolean;
|
||||||
invalidate_terminal(term, term->cursor.row, term->cursor.row + 1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VTERM_PROP_TITLE: {
|
case VTERM_PROP_TITLE: {
|
||||||
@@ -1172,6 +1243,18 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *data)
|
|||||||
term->forward_mouse = (bool)val->number;
|
term->forward_mouse = (bool)val->number;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case VTERM_PROP_CURSORBLINK:
|
||||||
|
term->cursor.blink = val->boolean;
|
||||||
|
term->pending.cursor = true;
|
||||||
|
invalidate_terminal(term, -1, -1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VTERM_PROP_CURSORSHAPE:
|
||||||
|
term->cursor.shape = val->number;
|
||||||
|
term->pending.cursor = true;
|
||||||
|
invalidate_terminal(term, -1, -1);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1849,12 +1932,47 @@ static void refresh_terminal(Terminal *term)
|
|||||||
refresh_size(term, buf);
|
refresh_size(term, buf);
|
||||||
refresh_scrollback(term, buf);
|
refresh_scrollback(term, buf);
|
||||||
refresh_screen(term, buf);
|
refresh_screen(term, buf);
|
||||||
|
refresh_cursor(term);
|
||||||
aucmd_restbuf(&aco);
|
aucmd_restbuf(&aco);
|
||||||
|
|
||||||
int ml_added = buf->b_ml.ml_line_count - ml_before;
|
int ml_added = buf->b_ml.ml_line_count - ml_before;
|
||||||
adjust_topline(term, buf, ml_added);
|
adjust_topline(term, buf, ml_added);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void refresh_cursor(Terminal *term)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
|
{
|
||||||
|
if (!is_focused(term) || !term->pending.cursor) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
term->pending.cursor = false;
|
||||||
|
|
||||||
|
if (term->cursor.blink) {
|
||||||
|
// For the TUI, this value doesn't actually matter, as long as it's non-zero. The terminal
|
||||||
|
// emulator dictates the blink frequency, not the application.
|
||||||
|
// For GUIs we just pick an arbitrary value, for now.
|
||||||
|
shape_table[SHAPE_IDX_TERM].blinkon = 500;
|
||||||
|
shape_table[SHAPE_IDX_TERM].blinkoff = 500;
|
||||||
|
} else {
|
||||||
|
shape_table[SHAPE_IDX_TERM].blinkon = 0;
|
||||||
|
shape_table[SHAPE_IDX_TERM].blinkoff = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (term->cursor.shape) {
|
||||||
|
case VTERM_PROP_CURSORSHAPE_BLOCK:
|
||||||
|
shape_table[SHAPE_IDX_TERM].shape = SHAPE_BLOCK;
|
||||||
|
break;
|
||||||
|
case VTERM_PROP_CURSORSHAPE_UNDERLINE:
|
||||||
|
shape_table[SHAPE_IDX_TERM].shape = SHAPE_HOR;
|
||||||
|
break;
|
||||||
|
case VTERM_PROP_CURSORSHAPE_BAR_LEFT:
|
||||||
|
shape_table[SHAPE_IDX_TERM].shape = SHAPE_VER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_mode_info_set();
|
||||||
|
}
|
||||||
|
|
||||||
/// Calls refresh_terminal() on all invalidated_terminals.
|
/// Calls refresh_terminal() on all invalidated_terminals.
|
||||||
static void refresh_timer_cb(TimeWatcher *watcher, void *data)
|
static void refresh_timer_cb(TimeWatcher *watcher, void *data)
|
||||||
{
|
{
|
||||||
@@ -1875,11 +1993,11 @@ static void refresh_timer_cb(TimeWatcher *watcher, void *data)
|
|||||||
|
|
||||||
static void refresh_size(Terminal *term, buf_T *buf)
|
static void refresh_size(Terminal *term, buf_T *buf)
|
||||||
{
|
{
|
||||||
if (!term->pending_resize || term->closed) {
|
if (!term->pending.resize || term->closed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
term->pending_resize = false;
|
term->pending.resize = false;
|
||||||
int width, height;
|
int width, height;
|
||||||
vterm_get_size(term->vt, &height, &width);
|
vterm_get_size(term->vt, &height, &width);
|
||||||
term->invalid_start = 0;
|
term->invalid_start = 0;
|
||||||
|
@@ -1339,7 +1339,7 @@ static void tui_set_mode(TUIData *tui, ModeShape mode)
|
|||||||
case SHAPE_VER:
|
case SHAPE_VER:
|
||||||
shape = 5; break;
|
shape = 5; break;
|
||||||
}
|
}
|
||||||
UNIBI_SET_NUM_VAR(tui->params[0], shape + (int)(c.blinkon == 0));
|
UNIBI_SET_NUM_VAR(tui->params[0], shape + (int)(c.blinkon == 0 || c.blinkoff == 0));
|
||||||
unibi_out_ext(tui, tui->unibi_ext.set_cursor_style);
|
unibi_out_ext(tui, tui->unibi_ext.set_cursor_style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3785,7 +3785,7 @@ describe('API', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
|
|
|
|
||||||
{1:~}{102: }{4: }{1: }|
|
{1:~}{4:^ }{1: }|
|
||||||
{1:~}{4: }{1: }|*4
|
{1:~}{4: }{1: }|*4
|
||||||
{1:~ }|*3
|
{1:~ }|*3
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
@@ -3801,7 +3801,7 @@ describe('API', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
|
|
|
|
||||||
{1:~}{4:herrejösses!}{102: }{4: }{1: }|
|
{1:~}{4:herrejösses!^ }{1: }|
|
||||||
{1:~}{4: }{1: }|*4
|
{1:~}{4: }{1: }|*4
|
||||||
{1:~ }|*3
|
{1:~ }|*3
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
|
@@ -47,7 +47,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
|||||||
|
|
||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*3
|
{4:~ }|*3
|
||||||
{5:[No Name] }|
|
{5:[No Name] }|
|
||||||
|
|
|
|
||||||
@@ -57,7 +57,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
|||||||
feed_command('edit ' .. path)
|
feed_command('edit ' .. path)
|
||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*3
|
{4:~ }|*3
|
||||||
{5:xtest-foo }|
|
{5:xtest-foo }|
|
||||||
:edit xtest-foo |
|
:edit xtest-foo |
|
||||||
@@ -68,7 +68,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
|||||||
feed_data('\027[O')
|
feed_data('\027[O')
|
||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*3
|
{4:~ }|*3
|
||||||
{5:xtest-foo }|
|
{5:xtest-foo }|
|
||||||
:edit xtest-foo |
|
:edit xtest-foo |
|
||||||
@@ -83,7 +83,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
|||||||
|
|
||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
{1:l}ine 1 |
|
^line 1 |
|
||||||
line 2 |
|
line 2 |
|
||||||
line 3 |
|
line 3 |
|
||||||
line 4 |
|
line 4 |
|
||||||
|
@@ -1198,7 +1198,7 @@ describe('jobs', function()
|
|||||||
})
|
})
|
||||||
-- Wait for startup to complete, so that all terminal responses are received.
|
-- Wait for startup to complete, so that all terminal responses are received.
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
^ |
|
||||||
~ |*3
|
~ |*3
|
||||||
{1:[No Name] 0,0-1 All}|
|
{1:[No Name] 0,0-1 All}|
|
||||||
|
|
|
|
||||||
@@ -1208,7 +1208,7 @@ describe('jobs', function()
|
|||||||
feed(':q<CR>')
|
feed(':q<CR>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
|
|
|
|
||||||
[Process exited 0]{1: } |
|
[Process exited 0]^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
|
@@ -46,7 +46,7 @@ describe('log', function()
|
|||||||
env = env,
|
env = env,
|
||||||
})
|
})
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
^ |
|
||||||
~ |*4
|
~ |*4
|
||||||
|
|
|
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
|
@@ -120,7 +120,7 @@ describe('command-line option', function()
|
|||||||
feed('i:cq<CR>')
|
feed('i:cq<CR>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
|
|
|
|
||||||
[Process exited 1]{2: } |
|
[Process exited 1]^ |
|
||||||
|*5
|
|*5
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
|
@@ -1153,7 +1153,7 @@ describe('user config init', function()
|
|||||||
-- `i` to enter Terminal mode, `a` to allow
|
-- `i` to enter Terminal mode, `a` to allow
|
||||||
feed('ia')
|
feed('ia')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
|
|
^ |
|
||||||
~ |*4
|
~ |*4
|
||||||
[No Name] 0,0-1 All|
|
[No Name] 0,0-1 All|
|
||||||
|
|
|
|
||||||
@@ -1162,7 +1162,7 @@ describe('user config init', function()
|
|||||||
feed(':echo g:exrc_file<CR>')
|
feed(':echo g:exrc_file<CR>')
|
||||||
screen:expect(string.format(
|
screen:expect(string.format(
|
||||||
[[
|
[[
|
||||||
|
|
^ |
|
||||||
~ |*4
|
~ |*4
|
||||||
[No Name] 0,0-1 All|
|
[No Name] 0,0-1 All|
|
||||||
%s%s|
|
%s%s|
|
||||||
|
@@ -29,8 +29,8 @@ describe(':highlight', function()
|
|||||||
|
|
|
|
||||||
TermCursor {2:xxx} {18:cterm=}reverse |
|
TermCursor {2:xxx} {18:cterm=}reverse |
|
||||||
{18:gui=}reverse |
|
{18:gui=}reverse |
|
||||||
TermCursorNC xxx cleared |
|
|
||||||
NonText {1:xxx} {18:ctermfg=}12 |
|
NonText {1:xxx} {18:ctermfg=}12 |
|
||||||
|
{18:gui=}bold |
|
||||||
{6:-- More --}^ |
|
{6:-- More --}^ |
|
||||||
]])
|
]])
|
||||||
feed('q')
|
feed('q')
|
||||||
|
@@ -263,7 +263,7 @@ describe('vim.ui_attach', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'E122: Function Foo already exists, add ! to replace it', 9, 7 } },
|
content = { { 'E122: Function Foo already exists, add ! to replace it', 9, 6 } },
|
||||||
kind = 'emsg',
|
kind = 'emsg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -280,7 +280,7 @@ describe('vim.ui_attach', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'replace with Replacement (y/n/a/q/l/^E/^Y)?', 6, 19 } },
|
content = { { 'replace with Replacement (y/n/a/q/l/^E/^Y)?', 6, 18 } },
|
||||||
kind = 'confirm_sub',
|
kind = 'confirm_sub',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -348,7 +348,7 @@ describe('vim.ui_attach', function()
|
|||||||
foo^ |
|
foo^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- INSERT --', 5, 12 } },
|
showmode = { { '-- INSERT --', 5, 11 } },
|
||||||
})
|
})
|
||||||
feed('<esc>:1mes clear<cr>:mes<cr>')
|
feed('<esc>:1mes clear<cr>:mes<cr>')
|
||||||
screen:expect({
|
screen:expect({
|
||||||
@@ -375,7 +375,7 @@ describe('vim.ui_attach', function()
|
|||||||
{
|
{
|
||||||
'Error executing vim.schedule lua callback: [string "<nvim>"]:2: attempt to index global \'err\' (a nil value)\nstack traceback:\n\t[string "<nvim>"]:2: in function <[string "<nvim>"]:2>',
|
'Error executing vim.schedule lua callback: [string "<nvim>"]:2: attempt to index global \'err\' (a nil value)\nstack traceback:\n\t[string "<nvim>"]:2: in function <[string "<nvim>"]:2>',
|
||||||
9,
|
9,
|
||||||
7,
|
6,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
kind = 'lua_error',
|
kind = 'lua_error',
|
||||||
@@ -385,13 +385,13 @@ describe('vim.ui_attach', function()
|
|||||||
{
|
{
|
||||||
'Error executing vim.schedule lua callback: [string "<nvim>"]:2: attempt to index global \'err\' (a nil value)\nstack traceback:\n\t[string "<nvim>"]:2: in function <[string "<nvim>"]:2>',
|
'Error executing vim.schedule lua callback: [string "<nvim>"]:2: attempt to index global \'err\' (a nil value)\nstack traceback:\n\t[string "<nvim>"]:2: in function <[string "<nvim>"]:2>',
|
||||||
9,
|
9,
|
||||||
7,
|
6,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
kind = 'lua_error',
|
kind = 'lua_error',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 100, 19 } },
|
content = { { 'Press ENTER or type command to continue', 100, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -35,13 +35,13 @@ describe(':terminal altscreen', function()
|
|||||||
line6 |
|
line6 |
|
||||||
line7 |
|
line7 |
|
||||||
line8 |
|
line8 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
enter_altscreen()
|
enter_altscreen()
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*5
|
|*5
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq(10, api.nvim_buf_line_count(0))
|
eq(10, api.nvim_buf_line_count(0))
|
||||||
@@ -68,7 +68,7 @@ describe(':terminal altscreen', function()
|
|||||||
line6 |
|
line6 |
|
||||||
line7 |
|
line7 |
|
||||||
line8 |
|
line8 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<c-\\><c-n>gg')
|
feed('<c-\\><c-n>gg')
|
||||||
@@ -103,7 +103,7 @@ describe(':terminal altscreen', function()
|
|||||||
line14 |
|
line14 |
|
||||||
line15 |
|
line15 |
|
||||||
line16 |
|
line16 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -132,7 +132,7 @@ describe(':terminal altscreen', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*2
|
|*2
|
||||||
rows: 4, cols: 50 |
|
rows: 4, cols: 50 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
@@ -160,7 +160,7 @@ describe(':terminal altscreen', function()
|
|||||||
line5 |
|
line5 |
|
||||||
line6 |
|
line6 |
|
||||||
line7 |
|
line7 |
|
||||||
line8 |
|
^line8 |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
@@ -33,7 +33,7 @@ describe('api', function()
|
|||||||
it('qa! RPC request during insert-mode', function()
|
it('qa! RPC request during insert-mode', function()
|
||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*4
|
{4:~ }|*4
|
||||||
|
|
|
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -45,7 +45,7 @@ describe('api', function()
|
|||||||
|
|
||||||
-- Wait for socket creation.
|
-- Wait for socket creation.
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*4
|
{4:~ }|*4
|
||||||
]] .. socket_name .. [[ |
|
]] .. socket_name .. [[ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -57,7 +57,7 @@ describe('api', function()
|
|||||||
tt.feed_data('i[tui] insert-mode')
|
tt.feed_data('i[tui] insert-mode')
|
||||||
-- Wait for stdin to be processed.
|
-- Wait for stdin to be processed.
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
[tui] insert-mode{1: } |
|
[tui] insert-mode^ |
|
||||||
{4:~ }|*4
|
{4:~ }|*4
|
||||||
{3:-- INSERT --} |
|
{3:-- INSERT --} |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -73,7 +73,7 @@ describe('api', function()
|
|||||||
[tui] insert-mode |
|
[tui] insert-mode |
|
||||||
[socket 1] this is more t |
|
[socket 1] this is more t |
|
||||||
han 25 columns |
|
han 25 columns |
|
||||||
[socket 2] input{1: } |
|
[socket 2] input^ |
|
||||||
{4:~ } |
|
{4:~ } |
|
||||||
{3:-- INSERT --} |
|
{3:-- INSERT --} |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
|
@@ -89,7 +89,7 @@ describe(':terminal buffer', function()
|
|||||||
feed('<c-\\><c-n>')
|
feed('<c-\\><c-n>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
^ |
|
||||||
|*5
|
|*5
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -109,7 +109,7 @@ describe(':terminal buffer', function()
|
|||||||
feed('<c-\\><c-n>dd')
|
feed('<c-\\><c-n>dd')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{8:E21: Cannot make changes, 'modifiable' is off} |
|
{8:E21: Cannot make changes, 'modifiable' is off} |
|
||||||
]])
|
]])
|
||||||
@@ -122,7 +122,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
^tty ready |
|
^tty ready |
|
||||||
appended tty ready |*2
|
appended tty ready |*2
|
||||||
{2: } |
|
|
|
||||||
|*2
|
|*2
|
||||||
:let @a = "appended " . @a |
|
:let @a = "appended " . @a |
|
||||||
]])
|
]])
|
||||||
@@ -142,7 +142,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
^tty ready |
|
^tty ready |
|
||||||
appended tty ready |
|
appended tty ready |
|
||||||
{2: } |
|
|
|
||||||
|*3
|
|*3
|
||||||
:put a |
|
:put a |
|
||||||
]])
|
]])
|
||||||
@@ -151,7 +151,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
appended tty ready |*2
|
appended tty ready |*2
|
||||||
{2: } |
|
|
|
||||||
|
|
|
|
||||||
^ |
|
^ |
|
||||||
:6put a |
|
:6put a |
|
||||||
@@ -198,7 +198,7 @@ describe(':terminal buffer', function()
|
|||||||
{4:~ }|
|
{4:~ }|
|
||||||
{5:========== }|
|
{5:========== }|
|
||||||
rows: 2, cols: 50 |
|
rows: 2, cols: 50 |
|
||||||
{2: } |
|
|
|
||||||
{18:========== }|
|
{18:========== }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -234,7 +234,7 @@ describe(':terminal buffer', function()
|
|||||||
command('set rightleft')
|
command('set rightleft')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
ydaer ytt|
|
ydaer ytt|
|
||||||
{1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -277,7 +277,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- (terminal) --} |
|
{3:-- (terminal) --} |
|
||||||
]],
|
]],
|
||||||
@@ -288,7 +288,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2: } |
|
|
|
||||||
|*4
|
|*4
|
||||||
:let g:x = 17^ |
|
:let g:x = 17^ |
|
||||||
]],
|
]],
|
||||||
@@ -298,7 +298,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
tty ready |
|
tty ready |
|
||||||
{1: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]],
|
]],
|
||||||
@@ -534,7 +534,7 @@ describe('terminal input', function()
|
|||||||
'while 1 | redraw | echo keytrans(getcharstr()) | endwhile',
|
'while 1 | redraw | echo keytrans(getcharstr()) | endwhile',
|
||||||
})
|
})
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*3
|
{4:~ }|*3
|
||||||
{5:[No Name] 0,0-1 All}|
|
{5:[No Name] 0,0-1 All}|
|
||||||
|
|
|
|
||||||
@@ -594,7 +594,7 @@ describe('terminal input', function()
|
|||||||
|
|
|
|
||||||
{4:~ }|*3
|
{4:~ }|*3
|
||||||
{5:[No Name] 0,0-1 All}|
|
{5:[No Name] 0,0-1 All}|
|
||||||
%s{1: }{MATCH: *}|
|
%s^ {MATCH: *}|
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]]):format(key))
|
]]):format(key))
|
||||||
end
|
end
|
||||||
@@ -624,7 +624,7 @@ if is_os('win') then
|
|||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
> :: tty ready |
|
> :: tty ready |
|
||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
^> {2: } |
|
^> |
|
||||||
:let @a = @a . "\n:: appended " . @a . "\n\n" |
|
:let @a = @a . "\n:: appended " . @a . "\n\n" |
|
||||||
]])
|
]])
|
||||||
-- operator count is also taken into consideration
|
-- operator count is also taken into consideration
|
||||||
@@ -635,7 +635,7 @@ if is_os('win') then
|
|||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
> :: tty ready |
|
> :: tty ready |
|
||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
^> {2: } |
|
^> |
|
||||||
:let @a = @a . "\n:: appended " . @a . "\n\n" |
|
:let @a = @a . "\n:: appended " . @a . "\n\n" |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -649,7 +649,7 @@ if is_os('win') then
|
|||||||
|
|
|
|
||||||
> :: tty ready |
|
> :: tty ready |
|
||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
> {2: } |
|
> |
|
||||||
|
|
|
|
||||||
^ |
|
^ |
|
||||||
:put a |
|
:put a |
|
||||||
@@ -662,7 +662,7 @@ if is_os('win') then
|
|||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
> :: tty ready |
|
> :: tty ready |
|
||||||
> :: appended :: tty ready |
|
> :: appended :: tty ready |
|
||||||
^> {2: } |
|
^> |
|
||||||
:6put a |
|
:6put a |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
@@ -1,13 +1,12 @@
|
|||||||
local t = require('test.testutil')
|
local t = require('test.testutil')
|
||||||
local n = require('test.functional.testnvim')()
|
local n = require('test.functional.testnvim')()
|
||||||
local Screen = require('test.functional.ui.screen')
|
|
||||||
local tt = require('test.functional.testterm')
|
local tt = require('test.functional.testterm')
|
||||||
|
|
||||||
local feed, clear = n.feed, n.clear
|
local feed, clear = n.feed, n.clear
|
||||||
local testprg, command = n.testprg, n.command
|
local testprg, command = n.testprg, n.command
|
||||||
local eq, eval = t.eq, n.eval
|
local eq, eval = t.eq, n.eval
|
||||||
local matches = t.matches
|
local matches = t.matches
|
||||||
local poke_eventloop = n.poke_eventloop
|
local call = n.call
|
||||||
local hide_cursor = tt.hide_cursor
|
local hide_cursor = tt.hide_cursor
|
||||||
local show_cursor = tt.show_cursor
|
local show_cursor = tt.show_cursor
|
||||||
local is_os = t.is_os
|
local is_os = t.is_os
|
||||||
@@ -25,7 +24,7 @@ describe(':terminal cursor', function()
|
|||||||
tt.feed_data('testing cursor')
|
tt.feed_data('testing cursor')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
testing cursor{1: } |
|
testing cursor^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -35,7 +34,7 @@ describe(':terminal cursor', function()
|
|||||||
feed('<c-\\><c-n>')
|
feed('<c-\\><c-n>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
^ |
|
||||||
|*5
|
|*5
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -49,7 +48,7 @@ describe(':terminal cursor', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
{7: 1 }tty ready |
|
{7: 1 }tty ready |
|
||||||
{7: 2 }^rows: 6, cols: 46 |
|
{7: 2 }^rows: 6, cols: 46 |
|
||||||
{7: 3 }{2: } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 } |
|
{7: 5 } |
|
||||||
{7: 6 } |
|
{7: 6 } |
|
||||||
@@ -61,7 +60,7 @@ describe(':terminal cursor', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
{7: 1 }tty ready |
|
{7: 1 }tty ready |
|
||||||
{7: 2 }^rows: 6, cols: 46 |
|
{7: 2 }^rows: 6, cols: 46 |
|
||||||
{7: 3 }{2: } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 } |
|
{7: 5 } |
|
||||||
{7: 6 } |
|
{7: 6 } |
|
||||||
@@ -72,7 +71,7 @@ describe(':terminal cursor', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
{7: 1 }tty ready |
|
{7: 1 }tty ready |
|
||||||
{7: 2 }rows: 6, cols: 46 |
|
{7: 2 }rows: 6, cols: 46 |
|
||||||
{7: 3 }{1: } |
|
{7: 3 }^ |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 } |
|
{7: 5 } |
|
||||||
{7: 6 } |
|
{7: 6 } |
|
||||||
@@ -82,8 +81,8 @@ describe(':terminal cursor', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe('when invisible', function()
|
describe('when invisible', function()
|
||||||
it('is not highlighted and is detached from screen cursor', function()
|
it('is not highlighted', function()
|
||||||
skip(is_os('win'))
|
skip(is_os('win'), '#31587')
|
||||||
hide_cursor()
|
hide_cursor()
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
@@ -93,58 +92,238 @@ describe(':terminal cursor', function()
|
|||||||
show_cursor()
|
show_cursor()
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{1: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
-- same for when the terminal is unfocused
|
-- same for when the terminal is unfocused
|
||||||
feed('<c-\\><c-n>')
|
feed('<c-\\><c-n>')
|
||||||
hide_cursor()
|
hide_cursor()
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
|
tty ready |
|
||||||
|
^ |
|
||||||
|
|*5
|
||||||
|
]],
|
||||||
|
unchanged = true,
|
||||||
|
})
|
||||||
|
show_cursor()
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
|
tty ready |
|
||||||
|
^ |
|
||||||
|
|*5
|
||||||
|
]],
|
||||||
|
unchanged = true,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('becomes visible when exiting Terminal mode', function()
|
||||||
|
skip(is_os('win'), '#31587')
|
||||||
|
hide_cursor()
|
||||||
|
screen:expect([[
|
||||||
|
tty ready |
|
||||||
|
|*5
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]])
|
||||||
|
feed('<c-\\><c-n>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
^ |
|
^ |
|
||||||
|*5
|
|*5
|
||||||
]])
|
]])
|
||||||
show_cursor()
|
feed('i')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
|
||||||
|*5
|
|*5
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
|
||||||
|
|
||||||
describe('cursor with customized highlighting', function()
|
it('can be modified by application #3681', function()
|
||||||
local screen
|
skip(is_os('win'), '#31587')
|
||||||
|
local idx ---@type number
|
||||||
|
for i, v in ipairs(screen._mode_info) do
|
||||||
|
if v.name == 'terminal' then
|
||||||
|
idx = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
assert(idx)
|
||||||
|
|
||||||
before_each(function()
|
local states = {
|
||||||
clear()
|
[1] = { blink = true, shape = 'block' },
|
||||||
command('highlight TermCursor ctermfg=45 ctermbg=46 cterm=NONE')
|
[2] = { blink = false, shape = 'block' },
|
||||||
command('highlight TermCursorNC ctermfg=55 ctermbg=56 cterm=NONE')
|
[3] = { blink = true, shape = 'horizontal' },
|
||||||
screen = Screen.new(50, 7, { rgb = false })
|
[4] = { blink = false, shape = 'horizontal' },
|
||||||
screen:set_default_attr_ids({
|
[5] = { blink = true, shape = 'vertical' },
|
||||||
[1] = { foreground = 45, background = 46 },
|
[6] = { blink = false, shape = 'vertical' },
|
||||||
[2] = { foreground = 55, background = 56 },
|
}
|
||||||
[3] = { bold = true },
|
|
||||||
})
|
for k, v in pairs(states) do
|
||||||
command('call termopen(["' .. testprg('tty-test') .. '"])')
|
tt.feed_csi(('%d q'):format(k))
|
||||||
feed('i')
|
screen:expect({
|
||||||
poke_eventloop()
|
grid = [[
|
||||||
|
tty ready |
|
||||||
|
^ |
|
||||||
|
|*4
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]],
|
||||||
|
condition = function()
|
||||||
|
if v.blink then
|
||||||
|
eq(500, screen._mode_info[idx].blinkon)
|
||||||
|
eq(500, screen._mode_info[idx].blinkoff)
|
||||||
|
else
|
||||||
|
eq(0, screen._mode_info[idx].blinkon)
|
||||||
|
eq(0, screen._mode_info[idx].blinkoff)
|
||||||
|
end
|
||||||
|
eq(v.shape, screen._mode_info[idx].cursor_shape)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
feed([[<C-\><C-N>]])
|
||||||
|
|
||||||
|
screen:expect([[
|
||||||
|
tty ready |
|
||||||
|
^ |
|
||||||
|
|*5
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- Cursor returns to default on TermLeave
|
||||||
|
eq(500, screen._mode_info[idx].blinkon)
|
||||||
|
eq(500, screen._mode_info[idx].blinkoff)
|
||||||
|
eq('block', screen._mode_info[idx].cursor_shape)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('overrides the default highlighting', function()
|
it('can be modified per terminal', function()
|
||||||
screen:expect([[
|
skip(is_os('win'), '#31587')
|
||||||
|
local idx ---@type number
|
||||||
|
for i, v in ipairs(screen._mode_info) do
|
||||||
|
if v.name == 'terminal' then
|
||||||
|
idx = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
assert(idx)
|
||||||
|
|
||||||
|
-- Set cursor to vertical bar with blink
|
||||||
|
tt.feed_csi('5 q')
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
tty ready |
|
tty ready |
|
||||||
{1: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]],
|
||||||
feed('<c-\\><c-n>')
|
condition = function()
|
||||||
screen:expect([[
|
eq(500, screen._mode_info[idx].blinkon)
|
||||||
|
eq(500, screen._mode_info[idx].blinkoff)
|
||||||
|
eq('vertical', screen._mode_info[idx].cursor_shape)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
tt.hide_cursor()
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
|
|
||||||
|*5
|
|*4
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]],
|
||||||
|
condition = function()
|
||||||
|
eq(500, screen._mode_info[idx].blinkon)
|
||||||
|
eq(500, screen._mode_info[idx].blinkoff)
|
||||||
|
eq('vertical', screen._mode_info[idx].cursor_shape)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Exit terminal mode to reset terminal cursor settings to default and
|
||||||
|
-- create a new terminal window
|
||||||
|
feed([[<C-\><C-N>]])
|
||||||
|
command('set statusline=~~~')
|
||||||
|
command('new')
|
||||||
|
call('termopen', { testprg('tty-test') })
|
||||||
|
feed('i')
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
|
tty ready |
|
||||||
|
^ |
|
||||||
|
{17:~~~ }|
|
||||||
|
rows: 2, cols: 50 |
|
||||||
|
|
|
||||||
|
{18:~~~ }|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]],
|
||||||
|
condition = function()
|
||||||
|
-- New terminal, cursor resets to defaults
|
||||||
|
eq(500, screen._mode_info[idx].blinkon)
|
||||||
|
eq(500, screen._mode_info[idx].blinkoff)
|
||||||
|
eq('block', screen._mode_info[idx].cursor_shape)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Set cursor to underline, no blink
|
||||||
|
tt.feed_csi('4 q')
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
|
tty ready |
|
||||||
|
^ |
|
||||||
|
{17:~~~ }|
|
||||||
|
rows: 2, cols: 50 |
|
||||||
|
|
|
||||||
|
{18:~~~ }|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]],
|
||||||
|
condition = function()
|
||||||
|
eq(0, screen._mode_info[idx].blinkon)
|
||||||
|
eq(0, screen._mode_info[idx].blinkoff)
|
||||||
|
eq('horizontal', screen._mode_info[idx].cursor_shape)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Switch back to first terminal, cursor should still be hidden
|
||||||
|
command('wincmd p')
|
||||||
|
screen:expect({
|
||||||
|
grid = [[
|
||||||
|
tty ready |
|
||||||
|
|
|
||||||
|
{18:~~~ }|
|
||||||
|
rows: 2, cols: 50 |
|
||||||
|
|
|
||||||
|
{17:~~~ }|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]],
|
||||||
|
condition = function()
|
||||||
|
eq(500, screen._mode_info[idx].blinkon)
|
||||||
|
eq(500, screen._mode_info[idx].blinkoff)
|
||||||
|
eq('vertical', screen._mode_info[idx].cursor_shape)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('can be positioned arbitrarily', function()
|
||||||
|
clear()
|
||||||
|
screen = tt.setup_child_nvim({
|
||||||
|
'-u',
|
||||||
|
'NONE',
|
||||||
|
'-i',
|
||||||
|
'NONE',
|
||||||
|
'--cmd',
|
||||||
|
n.nvim_set .. ' noshowmode',
|
||||||
|
})
|
||||||
|
screen:expect([[
|
||||||
|
^ |
|
||||||
|
~ |*4
|
||||||
|
|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]])
|
||||||
|
|
||||||
|
feed('i<Tab>')
|
||||||
|
screen:expect([[
|
||||||
|
^ |
|
||||||
|
~ |*4
|
||||||
|
|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
@@ -183,7 +362,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:{2:^ } |
|
:^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
@@ -200,7 +379,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:aaaaaaaa{2:^ } |
|
:aaaaaaaa^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 9 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 9 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -208,7 +387,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:aaaaaaa^a{4: } |
|
:aaaaaaa^a |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 8 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 8 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -219,7 +398,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:aaaaaa{2:^a}a |
|
:aaaaaa^aa |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 7 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 7 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -227,7 +406,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:aaaaa^a{4:a}a |
|
:aaaaa^aaa |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 6 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 6 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -238,7 +417,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:a{2:^a}aaaaaa |
|
:a^aaaaaaa |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 2 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 2 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -246,7 +425,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:^a{4:a}aaaaaa |
|
:^aaaaaaaa |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -263,7 +442,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µµµµµµµµ{2:^ } |
|
:µµµµµµµµ^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 17 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 17 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -271,7 +450,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µµµµµµµ^µ{4: } |
|
:µµµµµµµ^µ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 15 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 15 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -282,7 +461,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µµµµµµ{2:^µ}µ |
|
:µµµµµµ^µµ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 13 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 13 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -290,7 +469,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µµµµµ^µ{4:µ}µ |
|
:µµµµµ^µµµ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 11 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 11 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -301,7 +480,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µ{2:^µ}µµµµµµ |
|
:µ^µµµµµµµ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 3 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 3 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -309,7 +488,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:^µ{4:µ}µµµµµµ |
|
:^µµµµµµµµ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -326,7 +505,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{2:^ } |
|
:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 33 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 33 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -334,7 +513,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{4: } |
|
:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 29 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 29 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -346,7 +525,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µ̳µ̳µ̳µ̳µ̳µ̳{2:^µ̳}µ̳ |
|
:µ̳µ̳µ̳µ̳µ̳µ̳^µ̳µ̳ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -354,7 +533,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µ̳µ̳µ̳µ̳µ̳^µ̳{4:µ̳}µ̳ |
|
:µ̳µ̳µ̳µ̳µ̳^µ̳µ̳µ̳ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 21 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 21 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -366,7 +545,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:µ̳{2:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
:µ̳^µ̳µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 5 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 5 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -374,7 +553,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:^µ̳{4:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
:^µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -391,7 +570,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:哦哦哦哦哦哦哦哦{2:^ } |
|
:哦哦哦哦哦哦哦哦^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -399,7 +578,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:哦哦哦哦哦哦哦^哦{4: } |
|
:哦哦哦哦哦哦哦^哦 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 22 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 22 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -410,7 +589,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:哦哦哦哦哦哦{2:^哦}哦 |
|
:哦哦哦哦哦哦^哦哦 |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 19 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 19 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -418,7 +597,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:哦哦哦哦哦^哦{4:哦}哦 |
|
:哦哦哦哦哦^哦哦哦 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 16 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 16 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -429,7 +608,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:哦{2:^哦}哦哦哦哦哦哦 |
|
:哦^哦哦哦哦哦哦哦 |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 4 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 4 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -437,7 +616,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:^哦{4:哦}哦哦哦哦哦哦 |
|
:^哦哦哦哦哦哦哦哦 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -450,7 +629,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:aaaaaaaa {2:^ } |
|
:aaaaaaaa ^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()'))
|
matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()'))
|
||||||
@@ -459,7 +638,7 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
|*4
|
|*4
|
||||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
:aaaaaaaa ^ {4: } |
|
:aaaaaaaa ^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 12 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 12 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -504,7 +683,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:{2:^ } |
|
{7: 6 }:^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
@@ -527,7 +706,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:aaaaaaaa{2:^ } |
|
{7: 6 }:aaaaaaaa^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 9 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 9 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -538,7 +717,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:aaaaaaa^a{4: } |
|
{7: 6 }:aaaaaaa^a |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 8 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 8 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -552,7 +731,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:aaaaaa{2:^a}a |
|
{7: 6 }:aaaaaa^aa |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 7 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 7 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -563,7 +742,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:aaaaa^a{4:a}a |
|
{7: 6 }:aaaaa^aaa |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 6 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 6 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -577,7 +756,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:a{2:^a}aaaaaa |
|
{7: 6 }:a^aaaaaaa |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 2 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 2 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -588,7 +767,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:^a{4:a}aaaaaa |
|
{7: 6 }:^aaaaaaaa |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -608,7 +787,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µµµµµµµµ{2:^ } |
|
{7: 6 }:µµµµµµµµ^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 17 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 17 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -619,7 +798,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µµµµµµµ^µ{4: } |
|
{7: 6 }:µµµµµµµ^µ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 15 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 15 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -633,7 +812,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µµµµµµ{2:^µ}µ |
|
{7: 6 }:µµµµµµ^µµ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 13 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 13 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -644,7 +823,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µµµµµ^µ{4:µ}µ |
|
{7: 6 }:µµµµµ^µµµ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 11 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 11 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -658,7 +837,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µ{2:^µ}µµµµµµ |
|
{7: 6 }:µ^µµµµµµµ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 3 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 3 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -669,7 +848,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:^µ{4:µ}µµµµµµ |
|
{7: 6 }:^µµµµµµµµ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -689,7 +868,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{2:^ } |
|
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 33 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 33 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -700,7 +879,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{4: } |
|
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 29 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 29 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -715,7 +894,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳{2:^µ̳}µ̳ |
|
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳^µ̳µ̳ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -726,7 +905,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳^µ̳{4:µ̳}µ̳ |
|
{7: 6 }:µ̳µ̳µ̳µ̳µ̳^µ̳µ̳µ̳ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 21 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 21 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -741,7 +920,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:µ̳{2:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
{7: 6 }:µ̳^µ̳µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 5 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 5 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -752,7 +931,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:^µ̳{4:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
{7: 6 }:^µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -772,7 +951,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:哦哦哦哦哦哦哦哦{2:^ } |
|
{7: 6 }:哦哦哦哦哦哦哦哦^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -783,7 +962,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:哦哦哦哦哦哦哦^哦{4: } |
|
{7: 6 }:哦哦哦哦哦哦哦^哦 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 22 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 22 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -797,7 +976,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:哦哦哦哦哦哦{2:^哦}哦 |
|
{7: 6 }:哦哦哦哦哦哦^哦哦 |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 19 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 19 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -808,7 +987,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:哦哦哦哦哦^哦{4:哦}哦 |
|
{7: 6 }:哦哦哦哦哦^哦哦哦 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 16 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 16 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -822,7 +1001,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:哦{2:^哦}哦哦哦哦哦哦 |
|
{7: 6 }:哦^哦哦哦哦哦哦哦 |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq({ 6, 4 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 4 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -833,7 +1012,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:^哦{4:哦}哦哦哦哦哦哦 |
|
{7: 6 }:^哦哦哦哦哦哦哦哦 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||||
@@ -849,7 +1028,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:aaaaaaaa {2:^ } |
|
{7: 6 }:aaaaaaaa ^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()'))
|
matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()'))
|
||||||
@@ -861,7 +1040,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||||||
{7: 3 } |
|
{7: 3 } |
|
||||||
{7: 4 } |
|
{7: 4 } |
|
||||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
{7: 6 }:aaaaaaaa ^ {4: } |
|
{7: 6 }:aaaaaaaa ^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq({ 6, 12 }, eval('nvim_win_get_cursor(0)'))
|
eq({ 6, 12 }, eval('nvim_win_get_cursor(0)'))
|
||||||
|
@@ -37,7 +37,7 @@ describe(':terminal highlight', function()
|
|||||||
feed('i')
|
feed('i')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{10: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -61,7 +61,7 @@ describe(':terminal highlight', function()
|
|||||||
skip(is_os('win'))
|
skip(is_os('win'))
|
||||||
screen:expect(sub([[
|
screen:expect(sub([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{NUM:text}text{10: } |
|
{NUM:text}text^ |
|
||||||
|*4
|
|*4
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
]]))
|
]]))
|
||||||
@@ -84,7 +84,7 @@ describe(':terminal highlight', function()
|
|||||||
line6 |
|
line6 |
|
||||||
line7 |
|
line7 |
|
||||||
line8 |
|
line8 |
|
||||||
{10: } |
|
^ |
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<c-\\><c-n>gg')
|
feed('<c-\\><c-n>gg')
|
||||||
@@ -195,7 +195,7 @@ it('CursorLine and CursorColumn work in :terminal buffer in Normal mode', functi
|
|||||||
local screen = Screen.new(50, 7)
|
local screen = Screen.new(50, 7)
|
||||||
screen:set_default_attr_ids({
|
screen:set_default_attr_ids({
|
||||||
[1] = { background = Screen.colors.Grey90 }, -- CursorLine, CursorColumn
|
[1] = { background = Screen.colors.Grey90 }, -- CursorLine, CursorColumn
|
||||||
[2] = { reverse = true }, -- TermCursor
|
[2] = { reverse = true },
|
||||||
[3] = { bold = true }, -- ModeMsg
|
[3] = { bold = true }, -- ModeMsg
|
||||||
[4] = { background = Screen.colors.Grey90, reverse = true },
|
[4] = { background = Screen.colors.Grey90, reverse = true },
|
||||||
[5] = { background = Screen.colors.Red },
|
[5] = { background = Screen.colors.Red },
|
||||||
@@ -234,7 +234,7 @@ it('CursorLine and CursorColumn work in :terminal buffer in Normal mode', functi
|
|||||||
foobar foobar foobar foobar foobar foobar foobar f|
|
foobar foobar foobar foobar foobar foobar foobar f|
|
||||||
oobar foobar foobar foobar foobar foobar foobar fo|
|
oobar foobar foobar foobar foobar foobar foobar fo|
|
||||||
obar foobar foobar foobar foobar foobar foobar foo|
|
obar foobar foobar foobar foobar foobar foobar foo|
|
||||||
bar foobar{2: } |
|
bar foobar^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
-- Leaving terminal mode restores old values.
|
-- Leaving terminal mode restores old values.
|
||||||
@@ -248,46 +248,60 @@ it('CursorLine and CursorColumn work in :terminal buffer in Normal mode', functi
|
|||||||
{1:bar fooba^r }|
|
{1:bar fooba^r }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
-- CursorLine and CursorColumn are combined with TermCursorNC.
|
|
||||||
command('highlight TermCursorNC gui=reverse')
|
-- Skip the rest of these tests on Windows #31587
|
||||||
|
if is_os('win') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- CursorLine and CursorColumn are combined with terminal colors.
|
||||||
|
tt.set_reverse()
|
||||||
|
tt.feed_data(' foobar')
|
||||||
|
tt.clear_attrs()
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready{1: } |
|
tty ready{1: } |
|
||||||
foobar f{1:o}obar foobar foobar foobar foobar foobar |
|
foobar f{1:o}obar foobar foobar foobar foobar foobar |
|
||||||
foobar fo{1:o}bar foobar foobar foobar foobar foobar f|
|
foobar fo{1:o}bar foobar foobar foobar foobar foobar f|
|
||||||
oobar foo{1:b}ar foobar foobar foobar foobar foobar fo|
|
oobar foo{1:b}ar foobar foobar foobar foobar foobar fo|
|
||||||
obar foob{1:a}r foobar foobar foobar foobar foobar foo|
|
obar foob{1:a}r foobar foobar foobar foobar foobar foo|
|
||||||
{1:bar fooba^r}{4: }{1: }|
|
{1:bar fooba^r}{4: foobar}{1: }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
feed('2gg11|')
|
feed('2gg15|')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready {1: } |
|
tty ready {1: } |
|
||||||
{1: foobar fo^obar foobar foobar foobar foobar foobar }|
|
{1: foobar foobar^ foobar foobar foobar foobar foobar }|
|
||||||
foobar foo{1:b}ar foobar foobar foobar foobar foobar f|
|
foobar foobar {1:f}oobar foobar foobar foobar foobar f|
|
||||||
oobar foob{1:a}r foobar foobar foobar foobar foobar fo|
|
oobar foobar f{1:o}obar foobar foobar foobar foobar fo|
|
||||||
obar fooba{1:r} foobar foobar foobar foobar foobar foo|
|
obar foobar fo{1:o}bar foobar foobar foobar foobar foo|
|
||||||
bar foobar{4: } |
|
bar foobar{2: foo}{4:b}{2:ar} |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
-- TermCursorNC has higher precedence.
|
|
||||||
command('highlight TermCursorNC gui=NONE guibg=Red')
|
-- Set bg color to red
|
||||||
|
tt.feed_csi('48;2;255:0:0m')
|
||||||
|
tt.feed_data(' foobar')
|
||||||
|
tt.clear_attrs()
|
||||||
|
feed('2gg20|')
|
||||||
|
|
||||||
|
-- Terminal color has higher precedence
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready {1: } |
|
tty ready {1: } |
|
||||||
{1: foobar fo^obar foobar foobar foobar foobar foobar }|
|
{1: foobar foobar foob^ar foobar foobar foobar foobar }|
|
||||||
foobar foo{1:b}ar foobar foobar foobar foobar foobar f|
|
foobar foobar fooba{1:r} foobar foobar foobar foobar f|
|
||||||
oobar foob{1:a}r foobar foobar foobar foobar foobar fo|
|
oobar foobar foobar{1: }foobar foobar foobar foobar fo|
|
||||||
obar fooba{1:r} foobar foobar foobar foobar foobar foo|
|
obar foobar foobar {1:f}oobar foobar foobar foobar foo|
|
||||||
bar foobar{5: } |
|
bar foobar{2: foobar}{5: foobar} |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
feed('G$')
|
feed('G$')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready{1: } |
|
tty ready {1: } |
|
||||||
foobar f{1:o}obar foobar foobar foobar foobar foobar |
|
foobar foobar foobar f{1:o}obar foobar foobar foobar |
|
||||||
foobar fo{1:o}bar foobar foobar foobar foobar foobar f|
|
foobar foobar foobar fo{1:o}bar foobar foobar foobar f|
|
||||||
oobar foo{1:b}ar foobar foobar foobar foobar foobar fo|
|
oobar foobar foobar foo{1:b}ar foobar foobar foobar fo|
|
||||||
obar foob{1:a}r foobar foobar foobar foobar foobar foo|
|
obar foobar foobar foob{1:a}r foobar foobar foobar foo|
|
||||||
{1:bar fooba^r}{5: }{1: }|
|
{1:bar foobar}{4: foobar}{5: fooba^r}{1: }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -300,18 +314,17 @@ describe(':terminal highlight forwarding', function()
|
|||||||
screen = Screen.new(50, 7)
|
screen = Screen.new(50, 7)
|
||||||
screen:set_rgb_cterm(true)
|
screen:set_rgb_cterm(true)
|
||||||
screen:set_default_attr_ids({
|
screen:set_default_attr_ids({
|
||||||
[1] = { { reverse = true }, { reverse = true } },
|
[1] = { { bold = true }, { bold = true } },
|
||||||
[2] = { { bold = true }, { bold = true } },
|
[2] = { { fg_indexed = true, foreground = tonumber('0xe0e000') }, { foreground = 3 } },
|
||||||
[3] = { { fg_indexed = true, foreground = tonumber('0xe0e000') }, { foreground = 3 } },
|
[3] = { { foreground = tonumber('0xff8000') }, {} },
|
||||||
[4] = { { foreground = tonumber('0xff8000') }, {} },
|
|
||||||
})
|
})
|
||||||
command(("enew | call termopen(['%s'])"):format(testprg('tty-test')))
|
command(("enew | call termopen(['%s'])"):format(testprg('tty-test')))
|
||||||
feed('i')
|
feed('i')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{1: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{2:-- TERMINAL --} |
|
{1:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -326,9 +339,9 @@ describe(':terminal highlight forwarding', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
tty ready |
|
tty ready |
|
||||||
{3:text}{4:color}text{1: } |
|
{2:text}{3:color}text^ |
|
||||||
|*4
|
|*4
|
||||||
{2:-- TERMINAL --} |
|
{1:-- TERMINAL --} |
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
@@ -355,7 +368,7 @@ describe(':terminal highlight with custom palette', function()
|
|||||||
feed('i')
|
feed('i')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{7: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{9:-- TERMINAL --} |
|
{9:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -369,7 +382,7 @@ describe(':terminal highlight with custom palette', function()
|
|||||||
tt.feed_data('text')
|
tt.feed_data('text')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{1:text}text{7: } |
|
{1:text}text^ |
|
||||||
|*4
|
|*4
|
||||||
{9:-- TERMINAL --} |
|
{9:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
|
@@ -32,7 +32,7 @@ describe(':terminal mouse', function()
|
|||||||
line28 |
|
line28 |
|
||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -107,7 +107,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -121,7 +121,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
"#{1: } |
|
"#^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftDrag><2,2>')
|
feed('<LeftDrag><2,2>')
|
||||||
@@ -131,7 +131,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
@##{1: } |
|
@##^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftDrag><3,2>')
|
feed('<LeftDrag><3,2>')
|
||||||
@@ -141,7 +141,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
@$#{1: } |
|
@$#^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftRelease><3,2>')
|
feed('<LeftRelease><3,2>')
|
||||||
@@ -151,7 +151,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
#$#{1: } |
|
#$#^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -165,7 +165,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
`!!{1: } |
|
`!!^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -179,7 +179,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
"#{1: } |
|
"#^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<ScrollWheelUp><1,2>')
|
feed('<ScrollWheelUp><1,2>')
|
||||||
@@ -189,7 +189,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
`"#{1: } |
|
`"#^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftDrag><2,2>')
|
feed('<LeftDrag><2,2>')
|
||||||
@@ -199,7 +199,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
@##{1: } |
|
@##^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<ScrollWheelUp><2,2>')
|
feed('<ScrollWheelUp><2,2>')
|
||||||
@@ -209,7 +209,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
`##{1: } |
|
`##^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftRelease><2,2>')
|
feed('<LeftRelease><2,2>')
|
||||||
@@ -219,7 +219,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
###{1: } |
|
###^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -237,7 +237,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 13 }line30 |
|
{7: 13 }line30 |
|
||||||
{7: 14 }mouse enabled |
|
{7: 14 }mouse enabled |
|
||||||
{7: 15 }rows: 6, cols: 46 |
|
{7: 15 }rows: 6, cols: 46 |
|
||||||
{7: 16 }{2: } |
|
{7: 16 } |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
-- If click on the coordinate (0,1) of the region of the terminal
|
-- If click on the coordinate (0,1) of the region of the terminal
|
||||||
@@ -249,7 +249,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 13 }line30 |
|
{7: 13 }line30 |
|
||||||
{7: 14 }mouse enabled |
|
{7: 14 }mouse enabled |
|
||||||
{7: 15 }rows: 6, cols: 46 |
|
{7: 15 }rows: 6, cols: 46 |
|
||||||
{7: 16 } !"{1: } |
|
{7: 16 } !"^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -261,7 +261,7 @@ describe(':terminal mouse', function()
|
|||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{1: } |
|
^ |
|
||||||
========== |
|
========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -271,7 +271,7 @@ describe(':terminal mouse', function()
|
|||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{2:^ } |
|
^ |
|
||||||
========== |
|
========== |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -280,7 +280,7 @@ describe(':terminal mouse', function()
|
|||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
rows: 4, cols: 50 |
|
rows: 4, cols: 50 |
|
||||||
{2:^ } |
|
^ |
|
||||||
========== |
|
========== |
|
||||||
|*2
|
|*2
|
||||||
]])
|
]])
|
||||||
@@ -293,7 +293,7 @@ describe(':terminal mouse', function()
|
|||||||
line30 │{4:~ }|
|
line30 │{4:~ }|
|
||||||
mouse enabled │{4:~ }|
|
mouse enabled │{4:~ }|
|
||||||
rows: 5, cols: 24 │{4:~ }|
|
rows: 5, cols: 24 │{4:~ }|
|
||||||
{1: } │{4:~ }|
|
^ │{4:~ }|
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -303,7 +303,7 @@ describe(':terminal mouse', function()
|
|||||||
line30 │{4:~ }|
|
line30 │{4:~ }|
|
||||||
mouse enabled │{4:~ }|
|
mouse enabled │{4:~ }|
|
||||||
rows: 5, cols: 24 │{4:~ }|
|
rows: 5, cols: 24 │{4:~ }|
|
||||||
{2:^ } │{4:~ }|
|
^ │{4:~ }|
|
||||||
========== ========== |
|
========== ========== |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -313,7 +313,7 @@ describe(':terminal mouse', function()
|
|||||||
mouse enabled │{4:~ }|
|
mouse enabled │{4:~ }|
|
||||||
rows: 5, cols: 24 │{4:~ }|
|
rows: 5, cols: 24 │{4:~ }|
|
||||||
rows: 5, cols: 23 │{4:~ }|
|
rows: 5, cols: 23 │{4:~ }|
|
||||||
{2:^ } │{4:~ }|
|
^ │{4:~ }|
|
||||||
========== ========== |
|
========== ========== |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -327,7 +327,7 @@ describe(':terminal mouse', function()
|
|||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftMouse><0,0>')
|
feed('<LeftMouse><0,0>')
|
||||||
@@ -337,7 +337,7 @@ describe(':terminal mouse', function()
|
|||||||
line30 |
|
line30 |
|
||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{2:^ } |
|
^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
command('set showtabline=2 tabline=TABLINE | startinsert')
|
command('set showtabline=2 tabline=TABLINE | startinsert')
|
||||||
@@ -347,7 +347,7 @@ describe(':terminal mouse', function()
|
|||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
rows: 4, cols: 50 |
|
rows: 4, cols: 50 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftMouse><0,0>')
|
feed('<LeftMouse><0,0>')
|
||||||
@@ -357,7 +357,7 @@ describe(':terminal mouse', function()
|
|||||||
mouse enabled |
|
mouse enabled |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
rows: 4, cols: 50 |
|
rows: 4, cols: 50 |
|
||||||
{2:^ } |
|
^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
command('setlocal winbar= | startinsert')
|
command('setlocal winbar= | startinsert')
|
||||||
@@ -367,7 +367,7 @@ describe(':terminal mouse', function()
|
|||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
rows: 4, cols: 50 |
|
rows: 4, cols: 50 |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<LeftMouse><0,0>')
|
feed('<LeftMouse><0,0>')
|
||||||
@@ -377,7 +377,7 @@ describe(':terminal mouse', function()
|
|||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
rows: 4, cols: 50 |
|
rows: 4, cols: 50 |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{2:^ } |
|
^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -391,7 +391,7 @@ describe(':terminal mouse', function()
|
|||||||
line29 │line29 |
|
line29 │line29 |
|
||||||
line30 │line30 |
|
line30 │line30 |
|
||||||
rows: 5, cols: 25 │rows: 5, cols: 25 |
|
rows: 5, cols: 25 │rows: 5, cols: 25 |
|
||||||
{2:^ } │{2: } |
|
^ │ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
:vsp |
|
:vsp |
|
||||||
]])
|
]])
|
||||||
@@ -401,7 +401,7 @@ describe(':terminal mouse', function()
|
|||||||
{4:~ }│line30 |
|
{4:~ }│line30 |
|
||||||
{4:~ }│rows: 5, cols: 25 |
|
{4:~ }│rows: 5, cols: 25 |
|
||||||
{4:~ }│rows: 5, cols: 24 |
|
{4:~ }│rows: 5, cols: 24 |
|
||||||
{4:~ }│{2: } |
|
{4:~ }│ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
:enew | set number |
|
:enew | set number |
|
||||||
]])
|
]])
|
||||||
@@ -411,7 +411,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 28 }line │line30 |
|
{7: 28 }line │line30 |
|
||||||
{7: 29 }line │rows: 5, cols: 25 |
|
{7: 29 }line │rows: 5, cols: 25 |
|
||||||
{7: 30 }line │rows: 5, cols: 24 |
|
{7: 30 }line │rows: 5, cols: 24 |
|
||||||
{7: 31 }^ │{2: } |
|
{7: 31 }^ │ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -421,7 +421,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 28 }line │line30 |
|
{7: 28 }line │line30 |
|
||||||
{7: 29 }line │rows: 5, cols: 25 |
|
{7: 29 }line │rows: 5, cols: 25 |
|
||||||
{7: 30 }line │rows: 5, cols: 24 |
|
{7: 30 }line │rows: 5, cols: 24 |
|
||||||
{7: 31 } │{1: } |
|
{7: 31 } │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -434,7 +434,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 28 }line │rows: 5, cols: 25 |
|
{7: 28 }line │rows: 5, cols: 25 |
|
||||||
{7: 29 }line │rows: 5, cols: 24 |
|
{7: 29 }line │rows: 5, cols: 24 |
|
||||||
{7: 30 }line │mouse enabled |
|
{7: 30 }line │mouse enabled |
|
||||||
{7: 31 } │{1: } |
|
{7: 31 } │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -447,7 +447,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 22 }line │rows: 5, cols: 25 |
|
{7: 22 }line │rows: 5, cols: 25 |
|
||||||
{7: 23 }line │rows: 5, cols: 24 |
|
{7: 23 }line │rows: 5, cols: 24 |
|
||||||
{7: 24 }line │mouse enabled |
|
{7: 24 }line │mouse enabled |
|
||||||
{7: 25 }line │{1: } |
|
{7: 25 }line │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -457,7 +457,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 27 }line │rows: 5, cols: 25 |
|
{7: 27 }line │rows: 5, cols: 25 |
|
||||||
{7: 28 }line │rows: 5, cols: 24 |
|
{7: 28 }line │rows: 5, cols: 24 |
|
||||||
{7: 29 }line │mouse enabled |
|
{7: 29 }line │mouse enabled |
|
||||||
{7: 30 }line │{1: } |
|
{7: 30 }line │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -468,7 +468,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 17 }line │rows: 5, cols: 25 |
|
{7: 17 }line │rows: 5, cols: 25 |
|
||||||
{7: 18 }line │rows: 5, cols: 24 |
|
{7: 18 }line │rows: 5, cols: 24 |
|
||||||
{7: 19 }line │mouse enabled |
|
{7: 19 }line │mouse enabled |
|
||||||
{7: 20 }line │{1: } |
|
{7: 20 }line │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -483,7 +483,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 2 }linelinelinelineline │rows: 5, cols: 25 |
|
{7: 2 }linelinelinelineline │rows: 5, cols: 25 |
|
||||||
{7: 3 }linelinelinelineline │rows: 5, cols: 24 |
|
{7: 3 }linelinelinelineline │rows: 5, cols: 24 |
|
||||||
{7: 4 }linelinelinelineline │mouse enabled |
|
{7: 4 }linelinelinelineline │mouse enabled |
|
||||||
{7: 5 }linelinelinelineline │{1: } |
|
{7: 5 }linelinelinelineline │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -493,7 +493,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 2 }nelinelineline │rows: 5, cols: 25 |
|
{7: 2 }nelinelineline │rows: 5, cols: 25 |
|
||||||
{7: 3 }nelinelineline │rows: 5, cols: 24 |
|
{7: 3 }nelinelineline │rows: 5, cols: 24 |
|
||||||
{7: 4 }nelinelineline │mouse enabled |
|
{7: 4 }nelinelineline │mouse enabled |
|
||||||
{7: 5 }nelinelineline │{1: } |
|
{7: 5 }nelinelineline │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -504,7 +504,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 2 }nelinelinelineline │rows: 5, cols: 25 |
|
{7: 2 }nelinelinelineline │rows: 5, cols: 25 |
|
||||||
{7: 3 }nelinelinelineline │rows: 5, cols: 24 |
|
{7: 3 }nelinelinelineline │rows: 5, cols: 24 |
|
||||||
{7: 4 }nelinelinelineline │mouse enabled |
|
{7: 4 }nelinelinelineline │mouse enabled |
|
||||||
{7: 5 }nelinelinelineline │{1: } |
|
{7: 5 }nelinelinelineline │^ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -517,7 +517,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 28 }l^ine │rows: 5, cols: 25 |
|
{7: 28 }l^ine │rows: 5, cols: 25 |
|
||||||
{7: 29 }line │rows: 5, cols: 24 |
|
{7: 29 }line │rows: 5, cols: 24 |
|
||||||
{7: 30 }line │mouse enabled |
|
{7: 30 }line │mouse enabled |
|
||||||
{7: 31 } │{2: } |
|
{7: 31 } │ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -531,7 +531,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 28 }line │rows: 5, cols: 25 |
|
{7: 28 }line │rows: 5, cols: 25 |
|
||||||
{7: 29 }line │rows: 5, cols: 24 |
|
{7: 29 }line │rows: 5, cols: 24 |
|
||||||
{7: 30 }line │mouse enabled |
|
{7: 30 }line │mouse enabled |
|
||||||
{7: 31 }^ │{2: } |
|
{7: 31 }^ │ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -541,7 +541,7 @@ describe(':terminal mouse', function()
|
|||||||
rows: 5, cols: 24 │rows: 5, cols: 24 |
|
rows: 5, cols: 24 │rows: 5, cols: 24 |
|
||||||
mouse enabled │mouse enabled |
|
mouse enabled │mouse enabled |
|
||||||
rows: 5, cols: 25 │rows: 5, cols: 25 |
|
rows: 5, cols: 25 │rows: 5, cols: 25 |
|
||||||
{2:^ } │{2: } |
|
^ │ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
:bn |
|
:bn |
|
||||||
]])
|
]])
|
||||||
@@ -551,7 +551,7 @@ describe(':terminal mouse', function()
|
|||||||
{7: 28 }line │mouse enabled |
|
{7: 28 }line │mouse enabled |
|
||||||
{7: 29 }line │rows: 5, cols: 25 |
|
{7: 29 }line │rows: 5, cols: 25 |
|
||||||
{7: 30 }line │rows: 5, cols: 24 |
|
{7: 30 }line │rows: 5, cols: 24 |
|
||||||
{7: 31 }^ │{2: } |
|
{7: 31 }^ │ |
|
||||||
========== ========== |
|
========== ========== |
|
||||||
:bn |
|
:bn |
|
||||||
]])
|
]])
|
||||||
|
@@ -39,7 +39,7 @@ describe(':terminal scrollback', function()
|
|||||||
line28 |
|
line28 |
|
||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -67,7 +67,7 @@ describe(':terminal scrollback', function()
|
|||||||
line2 |
|
line2 |
|
||||||
line3 |
|
line3 |
|
||||||
line4 |
|
line4 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -84,7 +84,7 @@ describe(':terminal scrollback', function()
|
|||||||
line3 |
|
line3 |
|
||||||
line4 |
|
line4 |
|
||||||
line5 |
|
line5 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq(7, api.nvim_buf_line_count(0))
|
eq(7, api.nvim_buf_line_count(0))
|
||||||
@@ -102,7 +102,7 @@ describe(':terminal scrollback', function()
|
|||||||
line5 |
|
line5 |
|
||||||
line6 |
|
line6 |
|
||||||
line7 |
|
line7 |
|
||||||
line8{1: } |
|
line8^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ describe(':terminal scrollback', function()
|
|||||||
line5 |
|
line5 |
|
||||||
line6 |
|
line6 |
|
||||||
line7 |
|
line7 |
|
||||||
^line8{2: } |
|
^line8 |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -151,7 +151,7 @@ describe(':terminal scrollback', function()
|
|||||||
line3 |
|
line3 |
|
||||||
line4 |
|
line4 |
|
||||||
rows: 5, cols: 28 |
|
rows: 5, cols: 28 |
|
||||||
{2:^ } |
|
^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
@@ -168,7 +168,7 @@ describe(':terminal scrollback', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
rows: 5, cols: 28 |
|
rows: 5, cols: 28 |
|
||||||
rows: 3, cols: 26 |
|
rows: 3, cols: 26 |
|
||||||
{2:^ } |
|
^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
eq(8, api.nvim_buf_line_count(0))
|
eq(8, api.nvim_buf_line_count(0))
|
||||||
@@ -201,7 +201,7 @@ describe(':terminal scrollback', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
rows: 4, cols: 30 |
|
rows: 4, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
|
|
|
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -220,7 +220,7 @@ describe(':terminal scrollback', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
rows: 4, cols: 30 |
|
rows: 4, cols: 30 |
|
||||||
rows: 3, cols: 30 |
|
rows: 3, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq(4, api.nvim_buf_line_count(0))
|
eq(4, api.nvim_buf_line_count(0))
|
||||||
@@ -235,7 +235,7 @@ describe(':terminal scrollback', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
rows: 4, cols: 30 |
|
rows: 4, cols: 30 |
|
||||||
rows: 3, cols: 30 |
|
rows: 3, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -252,14 +252,14 @@ describe(':terminal scrollback', function()
|
|||||||
line2 |
|
line2 |
|
||||||
line3 |
|
line3 |
|
||||||
line4 |
|
line4 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
screen:try_resize(screen._width, screen._height - 3)
|
screen:try_resize(screen._width, screen._height - 3)
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
line4 |
|
line4 |
|
||||||
rows: 3, cols: 30 |
|
rows: 3, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq(7, api.nvim_buf_line_count(0))
|
eq(7, api.nvim_buf_line_count(0))
|
||||||
@@ -278,7 +278,7 @@ describe(':terminal scrollback', function()
|
|||||||
line4 |
|
line4 |
|
||||||
rows: 3, cols: 30 |
|
rows: 3, cols: 30 |
|
||||||
rows: 4, cols: 30 |
|
rows: 4, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
@@ -300,7 +300,7 @@ describe(':terminal scrollback', function()
|
|||||||
rows: 3, cols: 30 |
|
rows: 3, cols: 30 |
|
||||||
rows: 4, cols: 30 |
|
rows: 4, cols: 30 |
|
||||||
rows: 7, cols: 30 |
|
rows: 7, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
eq(9, api.nvim_buf_line_count(0))
|
eq(9, api.nvim_buf_line_count(0))
|
||||||
@@ -337,7 +337,7 @@ describe(':terminal scrollback', function()
|
|||||||
rows: 4, cols: 30 |
|
rows: 4, cols: 30 |
|
||||||
rows: 7, cols: 30 |
|
rows: 7, cols: 30 |
|
||||||
rows: 11, cols: 30 |
|
rows: 11, cols: 30 |
|
||||||
{1: } |
|
^ |
|
||||||
|
|
|
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -362,7 +362,7 @@ describe(':terminal prints more lines than the screen height and exits', functio
|
|||||||
line8 |
|
line8 |
|
||||||
line9 |
|
line9 |
|
||||||
|
|
|
|
||||||
[Process exited 0]{2: } |
|
[Process exited 0]^ |
|
||||||
{5:-- TERMINAL --} |
|
{5:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed('<cr>')
|
feed('<cr>')
|
||||||
@@ -454,7 +454,7 @@ describe("'scrollback' option", function()
|
|||||||
39: line |
|
39: line |
|
||||||
40: line |
|
40: line |
|
||||||
|
|
|
|
||||||
${1: } |
|
$^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
@@ -493,7 +493,7 @@ describe("'scrollback' option", function()
|
|||||||
line28 |
|
line28 |
|
||||||
line29 |
|
line29 |
|
||||||
line30 |
|
line30 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
local term_height = 6 -- Actual terminal screen height, not the scrollback
|
local term_height = 6 -- Actual terminal screen height, not the scrollback
|
||||||
@@ -634,7 +634,7 @@ describe('pending scrollback line handling', function()
|
|||||||
screen:expect [[
|
screen:expect [[
|
||||||
hi |*4
|
hi |*4
|
||||||
|
|
|
|
||||||
[Process exited 0]{2: } |
|
[Process exited 0]^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]]
|
]]
|
||||||
assert_alive()
|
assert_alive()
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -62,7 +62,7 @@ describe(':terminal window', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
{7:1 }tty ready |
|
{7:1 }tty ready |
|
||||||
{7:2 }rows: 6, cols: 48 |
|
{7:2 }rows: 6, cols: 48 |
|
||||||
{7:3 }{1: } |
|
{7:3 }^ |
|
||||||
{7:4 } |
|
{7:4 } |
|
||||||
{7:5 } |
|
{7:5 } |
|
||||||
{7:6 } |
|
{7:6 } |
|
||||||
@@ -73,7 +73,7 @@ describe(':terminal window', function()
|
|||||||
{7:1 }tty ready |
|
{7:1 }tty ready |
|
||||||
{7:2 }rows: 6, cols: 48 |
|
{7:2 }rows: 6, cols: 48 |
|
||||||
{7:3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV|
|
{7:3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV|
|
||||||
{7:4 }WXYZ{1: } |
|
{7:4 }WXYZ^ |
|
||||||
{7:5 } |
|
{7:5 } |
|
||||||
{7:6 } |
|
{7:6 } |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -87,7 +87,7 @@ describe(':terminal window', function()
|
|||||||
{7: 2 }rows: 6, cols: 48 |
|
{7: 2 }rows: 6, cols: 48 |
|
||||||
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
|
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
|
||||||
{7: 4 }PQRSTUVWXYZrows: 6, cols: 41 |
|
{7: 4 }PQRSTUVWXYZrows: 6, cols: 41 |
|
||||||
{7: 5 }{1: } |
|
{7: 5 }^ |
|
||||||
{7: 6 } |
|
{7: 6 } |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -98,7 +98,7 @@ describe(':terminal window', function()
|
|||||||
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
|
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
|
||||||
{7: 4 }PQRSTUVWXYZrows: 6, cols: 41 |
|
{7: 4 }PQRSTUVWXYZrows: 6, cols: 41 |
|
||||||
{7: 5 } abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN|
|
{7: 5 } abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN|
|
||||||
{7: 6 }OPQRSTUVWXYZ{1: } |
|
{7: 6 }OPQRSTUVWXYZ^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -110,7 +110,7 @@ describe(':terminal window', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
{7:++1 }tty ready |
|
{7:++1 }tty ready |
|
||||||
{7:++2 }rows: 6, cols: 45 |
|
{7:++2 }rows: 6, cols: 45 |
|
||||||
{7:++3 }{1: } |
|
{7:++3 }^ |
|
||||||
{7:++4 } |
|
{7:++4 } |
|
||||||
{7:++5 } |
|
{7:++5 } |
|
||||||
{7:++6 } |
|
{7:++6 } |
|
||||||
@@ -123,7 +123,7 @@ describe(':terminal window', function()
|
|||||||
{7:++6 } |
|
{7:++6 } |
|
||||||
{7:++7 } |
|
{7:++7 } |
|
||||||
{7:++8 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS|
|
{7:++8 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS|
|
||||||
{7:++9 }TUVWXYZ{1: } |
|
{7:++9 }TUVWXYZ^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed_data('\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
feed_data('\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
||||||
@@ -133,7 +133,7 @@ describe(':terminal window', function()
|
|||||||
{7:++ 9 }STUVWXYZ |
|
{7:++ 9 }STUVWXYZ |
|
||||||
{7:++10 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR|
|
{7:++10 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR|
|
||||||
{7:++11 }STUVWXYZrows: 6, cols: 44 |
|
{7:++11 }STUVWXYZrows: 6, cols: 44 |
|
||||||
{7:++12 }{1: } |
|
{7:++12 }^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -144,7 +144,7 @@ describe(':terminal window', function()
|
|||||||
feed([[<C-\><C-N>]])
|
feed([[<C-\><C-N>]])
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{2:^ } |
|
^ |
|
||||||
|*5
|
|*5
|
||||||
]])
|
]])
|
||||||
feed(':set colorcolumn=20<CR>i')
|
feed(':set colorcolumn=20<CR>i')
|
||||||
@@ -153,7 +153,7 @@ describe(':terminal window', function()
|
|||||||
it('wont show the color column', function()
|
it('wont show the color column', function()
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
{1: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -170,7 +170,7 @@ describe(':terminal window', function()
|
|||||||
line2 |
|
line2 |
|
||||||
line3 |
|
line3 |
|
||||||
line4 |
|
line4 |
|
||||||
{1: } |
|
^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -184,7 +184,7 @@ describe(':terminal window', function()
|
|||||||
line2 |
|
line2 |
|
||||||
line3 |
|
line3 |
|
||||||
line4 |
|
line4 |
|
||||||
{2: } |
|
|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -206,7 +206,7 @@ describe(':terminal with multigrid', function()
|
|||||||
[3:--------------------------------------------------]|
|
[3:--------------------------------------------------]|
|
||||||
## grid 2
|
## grid 2
|
||||||
tty ready |
|
tty ready |
|
||||||
{1: } |
|
^ |
|
||||||
|*4
|
|*4
|
||||||
## grid 3
|
## grid 3
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -223,7 +223,7 @@ describe(':terminal with multigrid', function()
|
|||||||
## grid 2
|
## grid 2
|
||||||
tty ready |
|
tty ready |
|
||||||
rows: 10, cols: 20 |
|
rows: 10, cols: 20 |
|
||||||
{1: } |
|
^ |
|
||||||
|*7
|
|*7
|
||||||
## grid 3
|
## grid 3
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -241,7 +241,7 @@ describe(':terminal with multigrid', function()
|
|||||||
## grid 2
|
## grid 2
|
||||||
rows: 10, cols: 20 |
|
rows: 10, cols: 20 |
|
||||||
rows: 3, cols: 70 |
|
rows: 3, cols: 70 |
|
||||||
{1: } |
|
^ |
|
||||||
## grid 3
|
## grid 3
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@@ -260,7 +260,7 @@ describe(':terminal with multigrid', function()
|
|||||||
rows: 10, cols: 20 |
|
rows: 10, cols: 20 |
|
||||||
rows: 3, cols: 70 |
|
rows: 3, cols: 70 |
|
||||||
rows: 6, cols: 50 |
|
rows: 6, cols: 50 |
|
||||||
{1: } |
|
^ |
|
||||||
|
|
|
|
||||||
## grid 3
|
## grid 3
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
|
@@ -49,7 +49,7 @@ describe(':terminal', function()
|
|||||||
========== |
|
========== |
|
||||||
tty ready |
|
tty ready |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{2: } |
|
|
|
||||||
|*2
|
|*2
|
||||||
========== |
|
========== |
|
||||||
:2split |
|
:2split |
|
||||||
@@ -61,7 +61,7 @@ describe(':terminal', function()
|
|||||||
========== |
|
========== |
|
||||||
^tty ready |
|
^tty ready |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{2: } |
|
|
|
||||||
|*2
|
|*2
|
||||||
========== |
|
========== |
|
||||||
:wincmd p |
|
:wincmd p |
|
||||||
@@ -77,7 +77,7 @@ describe(':terminal', function()
|
|||||||
command('bprevious')
|
command('bprevious')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
^foo{2: } |
|
^foo |
|
||||||
|*8
|
|*8
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -102,7 +102,7 @@ describe(':terminal', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
tty ready |
|
||||||
rows: 7, cols: 47 |
|
rows: 7, cols: 47 |
|
||||||
{2: } |
|
|
|
||||||
|*3
|
|*3
|
||||||
^ |
|
^ |
|
||||||
|
|
|
|
||||||
@@ -112,7 +112,7 @@ describe(':terminal', function()
|
|||||||
tty ready |
|
tty ready |
|
||||||
rows: 7, cols: 47 |
|
rows: 7, cols: 47 |
|
||||||
rows: 4, cols: 41 |
|
rows: 4, cols: 41 |
|
||||||
{2:^ } |
|
^ |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
@@ -29,6 +29,10 @@ function M.feed_termcode(data)
|
|||||||
M.feed_data('\027' .. data)
|
M.feed_data('\027' .. data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.feed_csi(data)
|
||||||
|
M.feed_termcode('[' .. data)
|
||||||
|
end
|
||||||
|
|
||||||
function M.make_lua_executor(session)
|
function M.make_lua_executor(session)
|
||||||
return function(code, ...)
|
return function(code, ...)
|
||||||
local status, rv = session:request('nvim_exec_lua', code, { ... })
|
local status, rv = session:request('nvim_exec_lua', code, { ... })
|
||||||
@@ -78,6 +82,9 @@ end
|
|||||||
function M.set_undercurl()
|
function M.set_undercurl()
|
||||||
M.feed_termcode('[4:3m')
|
M.feed_termcode('[4:3m')
|
||||||
end
|
end
|
||||||
|
function M.set_reverse()
|
||||||
|
M.feed_termcode('[7m')
|
||||||
|
end
|
||||||
function M.set_strikethrough()
|
function M.set_strikethrough()
|
||||||
M.feed_termcode('[9m')
|
M.feed_termcode('[9m')
|
||||||
end
|
end
|
||||||
@@ -108,7 +115,6 @@ function M.setup_screen(extra_rows, cmd, cols, env, screen_opts)
|
|||||||
cols = cols and cols or 50
|
cols = cols and cols or 50
|
||||||
|
|
||||||
api.nvim_command('highlight TermCursor cterm=reverse')
|
api.nvim_command('highlight TermCursor cterm=reverse')
|
||||||
api.nvim_command('highlight TermCursorNC ctermbg=11')
|
|
||||||
api.nvim_command('highlight StatusLineTerm ctermbg=2 ctermfg=0')
|
api.nvim_command('highlight StatusLineTerm ctermbg=2 ctermfg=0')
|
||||||
api.nvim_command('highlight StatusLineTermNC ctermbg=2 ctermfg=8')
|
api.nvim_command('highlight StatusLineTermNC ctermbg=2 ctermfg=8')
|
||||||
|
|
||||||
@@ -154,7 +160,7 @@ function M.setup_screen(extra_rows, cmd, cols, env, screen_opts)
|
|||||||
local empty_line = (' '):rep(cols)
|
local empty_line = (' '):rep(cols)
|
||||||
local expected = {
|
local expected = {
|
||||||
'tty ready' .. (' '):rep(cols - 9),
|
'tty ready' .. (' '):rep(cols - 9),
|
||||||
'{1: }' .. (' '):rep(cols - 1),
|
'^' .. (' '):rep(cols),
|
||||||
empty_line,
|
empty_line,
|
||||||
empty_line,
|
empty_line,
|
||||||
empty_line,
|
empty_line,
|
||||||
|
@@ -190,6 +190,19 @@ describe('ui/cursor', function()
|
|||||||
attr_lm = {},
|
attr_lm = {},
|
||||||
short_name = 'sm',
|
short_name = 'sm',
|
||||||
},
|
},
|
||||||
|
[18] = {
|
||||||
|
blinkoff = 500,
|
||||||
|
blinkon = 500,
|
||||||
|
blinkwait = 0,
|
||||||
|
cell_percentage = 0,
|
||||||
|
cursor_shape = 'block',
|
||||||
|
name = 'terminal',
|
||||||
|
hl_id = 3,
|
||||||
|
id_lm = 3,
|
||||||
|
attr = { reverse = true },
|
||||||
|
attr_lm = { reverse = true },
|
||||||
|
short_name = 't',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
screen:expect(function()
|
screen:expect(function()
|
||||||
@@ -245,17 +258,20 @@ describe('ui/cursor', function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if m.hl_id then
|
if m.hl_id then
|
||||||
m.hl_id = 66
|
m.hl_id = 65
|
||||||
m.attr = { background = Screen.colors.DarkGray }
|
m.attr = { background = Screen.colors.DarkGray }
|
||||||
end
|
end
|
||||||
if m.id_lm then
|
if m.id_lm then
|
||||||
m.id_lm = 73
|
m.id_lm = 72
|
||||||
|
m.attr_lm = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Assert the new expectation.
|
-- Assert the new expectation.
|
||||||
screen:expect(function()
|
screen:expect(function()
|
||||||
eq(expected_mode_info, screen._mode_info)
|
for i, v in ipairs(expected_mode_info) do
|
||||||
|
eq(v, screen._mode_info[i])
|
||||||
|
end
|
||||||
eq(true, screen._cursor_style_enabled)
|
eq(true, screen._cursor_style_enabled)
|
||||||
eq('normal', screen.mode)
|
eq('normal', screen.mode)
|
||||||
end)
|
end)
|
||||||
|
@@ -227,7 +227,7 @@ describe('ext_hlstate detailed highlights', function()
|
|||||||
command(("enew | call termopen(['%s'])"):format(testprg('tty-test')))
|
command(("enew | call termopen(['%s'])"):format(testprg('tty-test')))
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^tty ready |
|
^tty ready |
|
||||||
{1: } |
|
|
|
||||||
|*5
|
|*5
|
||||||
{7: }|
|
{7: }|
|
||||||
]])
|
]])
|
||||||
@@ -242,7 +242,7 @@ describe('ext_hlstate detailed highlights', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
^tty ready |
|
^tty ready |
|
||||||
x {5:y z} |
|
x {5:y z} |
|
||||||
{1: } |
|
|
|
||||||
|*4
|
|*4
|
||||||
{7: }|
|
{7: }|
|
||||||
]])
|
]])
|
||||||
@@ -250,7 +250,7 @@ describe('ext_hlstate detailed highlights', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
^tty ready |
|
^tty ready |
|
||||||
x {2:y }{3:z} |
|
x {2:y }{3:z} |
|
||||||
{1: } |
|
|
|
||||||
|*4
|
|*4
|
||||||
{7: }|
|
{7: }|
|
||||||
]])
|
]])
|
||||||
@@ -268,7 +268,7 @@ describe('ext_hlstate detailed highlights', function()
|
|||||||
else
|
else
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^tty ready |
|
^tty ready |
|
||||||
x {4:y}{2: }{3:z} |
|
x {2:y }{3:z} |
|
||||||
|*5
|
|*5
|
||||||
{7: }|
|
{7: }|
|
||||||
]])
|
]])
|
||||||
|
@@ -49,7 +49,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { '\ntest\n[O]k: ', 6, 11 } },
|
content = { { '\ntest\n[O]k: ', 6, 10 } },
|
||||||
kind = 'confirm',
|
kind = 'confirm',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -77,7 +77,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { '\ntest\n[O]k: ', 6, 11 } },
|
content = { { '\ntest\n[O]k: ', 6, 10 } },
|
||||||
kind = 'confirm',
|
kind = 'confirm',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -91,7 +91,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { '\ntest\n[O]k: ', 6, 11 } },
|
content = { { '\ntest\n[O]k: ', 6, 10 } },
|
||||||
kind = 'confirm',
|
kind = 'confirm',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ describe('ui/ext_messages', function()
|
|||||||
kind = 'echo',
|
kind = 'echo',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -116,7 +116,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 6, 19 } },
|
content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 6, 18 } },
|
||||||
kind = 'confirm_sub',
|
kind = 'confirm_sub',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -135,7 +135,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'W10: Warning: Changing a readonly file', 19, 27 } },
|
content = { { 'W10: Warning: Changing a readonly file', 19, 26 } },
|
||||||
kind = 'wmsg',
|
kind = 'wmsg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -151,7 +151,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'search hit BOTTOM, continuing at TOP', 19, 27 } },
|
content = { { 'search hit BOTTOM, continuing at TOP', 19, 26 } },
|
||||||
kind = 'wmsg',
|
kind = 'wmsg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -167,15 +167,15 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Error detected while processing :', 9, 7 } },
|
content = { { 'Error detected while processing :', 9, 6 } },
|
||||||
kind = 'emsg',
|
kind = 'emsg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'E605: Exception not caught: foo', 9, 7 } },
|
content = { { 'E605: Exception not caught: foo', 9, 6 } },
|
||||||
kind = 'emsg',
|
kind = 'emsg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -225,15 +225,15 @@ describe('ui/ext_messages', function()
|
|||||||
{
|
{
|
||||||
content = {
|
content = {
|
||||||
{ '\nErrorMsg ' },
|
{ '\nErrorMsg ' },
|
||||||
{ 'xxx', 9, 7 },
|
{ 'xxx', 9, 6 },
|
||||||
{ ' ' },
|
{ ' ' },
|
||||||
{ 'ctermfg=', 18, 6 },
|
{ 'ctermfg=', 18, 5 },
|
||||||
{ '15 ' },
|
{ '15 ' },
|
||||||
{ 'ctermbg=', 18, 6 },
|
{ 'ctermbg=', 18, 5 },
|
||||||
{ '1 ' },
|
{ '1 ' },
|
||||||
{ 'guifg=', 18, 6 },
|
{ 'guifg=', 18, 5 },
|
||||||
{ 'White ' },
|
{ 'White ' },
|
||||||
{ 'guibg=', 18, 6 },
|
{ 'guibg=', 18, 5 },
|
||||||
{ 'Red' },
|
{ 'Red' },
|
||||||
},
|
},
|
||||||
kind = 'list_cmd',
|
kind = 'list_cmd',
|
||||||
@@ -280,7 +280,7 @@ describe('ui/ext_messages', function()
|
|||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
messages = { {
|
messages = { {
|
||||||
content = { { 'raa', 9, 7 } },
|
content = { { 'raa', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
} },
|
} },
|
||||||
}
|
}
|
||||||
@@ -307,15 +307,15 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'bork', 9, 7 } },
|
content = { { 'bork', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'fail', 9, 7 } },
|
content = { { 'fail', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -329,19 +329,19 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'bork', 9, 7 } },
|
content = { { 'bork', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'fail', 9, 7 } },
|
content = { { 'fail', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'extrafail', 9, 7 } },
|
content = { { 'extrafail', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -363,7 +363,7 @@ describe('ui/ext_messages', function()
|
|||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
messages = { {
|
messages = { {
|
||||||
content = { { 'problem', 9, 7 } },
|
content = { { 'problem', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
} },
|
} },
|
||||||
cmdline = {
|
cmdline = {
|
||||||
@@ -391,15 +391,15 @@ describe('ui/ext_messages', function()
|
|||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
msg_history = {
|
msg_history = {
|
||||||
{ kind = 'echoerr', content = { { 'raa', 9, 7 } } },
|
{ kind = 'echoerr', content = { { 'raa', 9, 6 } } },
|
||||||
{ kind = 'echoerr', content = { { 'bork', 9, 7 } } },
|
{ kind = 'echoerr', content = { { 'bork', 9, 6 } } },
|
||||||
{ kind = 'echoerr', content = { { 'fail', 9, 7 } } },
|
{ kind = 'echoerr', content = { { 'fail', 9, 6 } } },
|
||||||
{ kind = 'echoerr', content = { { 'extrafail', 9, 7 } } },
|
{ kind = 'echoerr', content = { { 'extrafail', 9, 6 } } },
|
||||||
{ kind = 'echoerr', content = { { 'problem', 9, 7 } } },
|
{ kind = 'echoerr', content = { { 'problem', 9, 6 } } },
|
||||||
},
|
},
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -424,7 +424,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'bork\nfail', 9, 7 } },
|
content = { { 'bork\nfail', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -438,13 +438,13 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
msg_history = {
|
msg_history = {
|
||||||
{
|
{
|
||||||
content = { { 'bork\nfail', 9, 7 } },
|
content = { { 'bork\nfail', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -492,7 +492,7 @@ describe('ui/ext_messages', function()
|
|||||||
{ content = { { 'x #1' } }, kind = 'list_cmd' },
|
{ content = { { 'x #1' } }, kind = 'list_cmd' },
|
||||||
{ content = { { 'y #2' } }, kind = 'list_cmd' },
|
{ content = { { 'y #2' } }, kind = 'list_cmd' },
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -507,7 +507,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- INSERT --', 5, 12 } },
|
showmode = { { '-- INSERT --', 5, 11 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('alphpabet<cr>alphanum<cr>')
|
feed('alphpabet<cr>alphanum<cr>')
|
||||||
@@ -518,7 +518,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*2
|
{1:~ }|*2
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- INSERT --', 5, 12 } },
|
showmode = { { '-- INSERT --', 5, 11 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('<c-x>')
|
feed('<c-x>')
|
||||||
@@ -529,7 +529,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*2
|
{1:~ }|*2
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 5, 12 } },
|
showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 5, 11 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('<c-p>')
|
feed('<c-p>')
|
||||||
@@ -545,7 +545,7 @@ describe('ui/ext_messages', function()
|
|||||||
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
|
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
|
||||||
pos = 1,
|
pos = 1,
|
||||||
},
|
},
|
||||||
showmode = { { '-- Keyword Local completion (^N^P) ', 5, 12 }, { 'match 1 of 2', 6, 19 } },
|
showmode = { { '-- Keyword Local completion (^N^P) ', 5, 11 }, { 'match 1 of 2', 6, 18 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- echomsg and showmode don't overwrite each other, this is the same
|
-- echomsg and showmode don't overwrite each other, this is the same
|
||||||
@@ -567,7 +567,7 @@ describe('ui/ext_messages', function()
|
|||||||
content = { { 'stuff' } },
|
content = { { 'stuff' } },
|
||||||
kind = 'echomsg',
|
kind = 'echomsg',
|
||||||
} },
|
} },
|
||||||
showmode = { { '-- Keyword Local completion (^N^P) ', 5, 12 }, { 'match 1 of 2', 6, 19 } },
|
showmode = { { '-- Keyword Local completion (^N^P) ', 5, 11 }, { 'match 1 of 2', 6, 18 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('<c-p>')
|
feed('<c-p>')
|
||||||
@@ -587,7 +587,7 @@ describe('ui/ext_messages', function()
|
|||||||
content = { { 'stuff' } },
|
content = { { 'stuff' } },
|
||||||
kind = 'echomsg',
|
kind = 'echomsg',
|
||||||
} },
|
} },
|
||||||
showmode = { { '-- Keyword Local completion (^N^P) ', 5, 12 }, { 'match 2 of 2', 6, 19 } },
|
showmode = { { '-- Keyword Local completion (^N^P) ', 5, 11 }, { 'match 2 of 2', 6, 18 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('<esc>:messages<cr>')
|
feed('<esc>:messages<cr>')
|
||||||
@@ -604,7 +604,7 @@ describe('ui/ext_messages', function()
|
|||||||
} },
|
} },
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -618,7 +618,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { 'recording @q', 5, 12 } },
|
showmode = { { 'recording @q', 5, 11 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('i')
|
feed('i')
|
||||||
@@ -627,7 +627,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- INSERT --recording @q', 5, 12 } },
|
showmode = { { '-- INSERT --recording @q', 5, 11 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('<esc>')
|
feed('<esc>')
|
||||||
@@ -636,7 +636,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { 'recording @q', 5, 12 } },
|
showmode = { { 'recording @q', 5, 11 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
feed('q')
|
feed('q')
|
||||||
@@ -655,7 +655,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { 'recording @q', 5, 12 } },
|
showmode = { { 'recording @q', 5, 11 } },
|
||||||
mode = 'normal',
|
mode = 'normal',
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -665,7 +665,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { 'recording @q', 5, 12 } },
|
showmode = { { 'recording @q', 5, 11 } },
|
||||||
mode = 'insert',
|
mode = 'insert',
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +675,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { 'recording @q', 5, 12 } },
|
showmode = { { 'recording @q', 5, 11 } },
|
||||||
mode = 'normal',
|
mode = 'normal',
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -697,7 +697,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
ruler = { { '0,0-1 All', 9, 62 } },
|
ruler = { { '0,0-1 All', 9, 61 } },
|
||||||
})
|
})
|
||||||
command('hi clear MsgArea')
|
command('hi clear MsgArea')
|
||||||
feed('i')
|
feed('i')
|
||||||
@@ -706,7 +706,7 @@ describe('ui/ext_messages', function()
|
|||||||
^ |
|
^ |
|
||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- INSERT --', 5, 12 } },
|
showmode = { { '-- INSERT --', 5, 11 } },
|
||||||
ruler = { { '0,1 All' } },
|
ruler = { { '0,1 All' } },
|
||||||
}
|
}
|
||||||
feed('abcde<cr>12345<esc>')
|
feed('abcde<cr>12345<esc>')
|
||||||
@@ -744,7 +744,7 @@ describe('ui/ext_messages', function()
|
|||||||
{17:123}45 |
|
{17:123}45 |
|
||||||
{1:~ }|*3
|
{1:~ }|*3
|
||||||
]],
|
]],
|
||||||
showmode = { { '-- VISUAL BLOCK --', 5, 12 } },
|
showmode = { { '-- VISUAL BLOCK --', 5, 11 } },
|
||||||
showcmd = { { '2x3' } },
|
showcmd = { { '2x3' } },
|
||||||
ruler = { { '1,3 All' } },
|
ruler = { { '1,3 All' } },
|
||||||
})
|
})
|
||||||
@@ -825,7 +825,7 @@ describe('ui/ext_messages', function()
|
|||||||
{1:~ }|*4
|
{1:~ }|*4
|
||||||
]],
|
]],
|
||||||
messages = { {
|
messages = { {
|
||||||
content = { { 'bork', 9, 7 } },
|
content = { { 'bork', 9, 6 } },
|
||||||
kind = 'echoerr',
|
kind = 'echoerr',
|
||||||
} },
|
} },
|
||||||
}
|
}
|
||||||
@@ -850,7 +850,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'E117: Unknown function: nosuchfunction', 9, 7 } },
|
content = { { 'E117: Unknown function: nosuchfunction', 9, 6 } },
|
||||||
kind = 'emsg',
|
kind = 'emsg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -865,12 +865,12 @@ describe('ui/ext_messages', function()
|
|||||||
msg_history = {
|
msg_history = {
|
||||||
{ kind = 'echomsg', content = { { 'howdy' } } },
|
{ kind = 'echomsg', content = { { 'howdy' } } },
|
||||||
{ kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } },
|
{ kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } },
|
||||||
{ kind = 'echoerr', content = { { 'bork', 9, 7 } } },
|
{ kind = 'echoerr', content = { { 'bork', 9, 6 } } },
|
||||||
{ kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 9, 7 } } },
|
{ kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 9, 6 } } },
|
||||||
},
|
},
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -943,7 +943,7 @@ stack traceback:
|
|||||||
[C]: in function 'error'
|
[C]: in function 'error'
|
||||||
[string ":lua"]:1: in main chunk]],
|
[string ":lua"]:1: in main chunk]],
|
||||||
9,
|
9,
|
||||||
7,
|
6,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
kind = 'lua_error',
|
kind = 'lua_error',
|
||||||
@@ -963,7 +963,7 @@ stack traceback:
|
|||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = {
|
content = {
|
||||||
{ "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 9, 7 },
|
{ "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 9, 6 },
|
||||||
},
|
},
|
||||||
kind = 'rpc_error',
|
kind = 'rpc_error',
|
||||||
},
|
},
|
||||||
@@ -1092,7 +1092,7 @@ stack traceback:
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'wow, ', 10, 9 }, { 'such\n\nvery ', 9, 7 }, { 'color', 8, 13 } },
|
content = { { 'wow, ', 10, 8 }, { 'such\n\nvery ', 9, 6 }, { 'color', 8, 12 } },
|
||||||
kind = 'echomsg',
|
kind = 'echomsg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1117,13 +1117,13 @@ stack traceback:
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
msg_history = {
|
msg_history = {
|
||||||
{
|
{
|
||||||
content = { { 'wow, ', 10, 9 }, { 'such\n\nvery ', 9, 7 }, { 'color', 8, 13 } },
|
content = { { 'wow, ', 10, 8 }, { 'such\n\nvery ', 9, 6 }, { 'color', 8, 12 } },
|
||||||
kind = 'echomsg',
|
kind = 'echomsg',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1783,7 +1783,7 @@ describe('ui/ext_messages', function()
|
|||||||
{1:~ }type :help iccf{18:<Enter>} for information {1: }|
|
{1:~ }type :help iccf{18:<Enter>} for information {1: }|
|
||||||
{1:~ }|*5
|
{1:~ }|*5
|
||||||
]]
|
]]
|
||||||
local showmode = { { '-- INSERT --', 5, 12 } }
|
local showmode = { { '-- INSERT --', 5, 11 } }
|
||||||
screen:expect(introscreen)
|
screen:expect(introscreen)
|
||||||
|
|
||||||
-- <c-l> (same as :mode) does _not_ clear intro message
|
-- <c-l> (same as :mode) does _not_ clear intro message
|
||||||
@@ -1858,7 +1858,7 @@ describe('ui/ext_messages', function()
|
|||||||
]],
|
]],
|
||||||
messages = {
|
messages = {
|
||||||
{
|
{
|
||||||
content = { { 'Press ENTER or type command to continue', 6, 19 } },
|
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||||
kind = 'return_prompt',
|
kind = 'return_prompt',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -34,7 +34,7 @@ describe('shell command :!', function()
|
|||||||
n.nvim_set .. ' notermguicolors',
|
n.nvim_set .. ' notermguicolors',
|
||||||
})
|
})
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
^ |
|
||||||
{4:~ }|*4
|
{4:~ }|*4
|
||||||
|
|
|
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
@@ -78,7 +78,7 @@ describe('shell command :!', function()
|
|||||||
29999: foo |
|
29999: foo |
|
||||||
30000: foo |
|
30000: foo |
|
||||||
|
|
|
|
||||||
{10:Press ENTER or type command to continue}{1: } |
|
{10:Press ENTER or type command to continue}^ |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]],
|
]],
|
||||||
{
|
{
|
||||||
|
@@ -967,11 +967,11 @@ function Screen:_handle_mode_info_set(cursor_style_enabled, mode_info)
|
|||||||
self._cursor_style_enabled = cursor_style_enabled
|
self._cursor_style_enabled = cursor_style_enabled
|
||||||
for _, item in pairs(mode_info) do
|
for _, item in pairs(mode_info) do
|
||||||
-- attr IDs are not stable, but their value should be
|
-- attr IDs are not stable, but their value should be
|
||||||
if item.attr_id ~= nil then
|
if item.attr_id ~= nil and self._attr_table[item.attr_id] ~= nil then
|
||||||
item.attr = self._attr_table[item.attr_id][1]
|
item.attr = self._attr_table[item.attr_id][1]
|
||||||
item.attr_id = nil
|
item.attr_id = nil
|
||||||
end
|
end
|
||||||
if item.attr_id_lm ~= nil then
|
if item.attr_id_lm ~= nil and self._attr_table[item.attr_id_lm] ~= nil then
|
||||||
item.attr_lm = self._attr_table[item.attr_id_lm][1]
|
item.attr_lm = self._attr_table[item.attr_id_lm][1]
|
||||||
item.attr_id_lm = nil
|
item.attr_id_lm = nil
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user