aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/labeler.yml66
-rw-r--r--.github/scripts/labeler_configuration.yml71
-rw-r--r--.github/scripts/reviewers_add.js (renamed from .github/scripts/reviews.js)0
-rw-r--r--.github/scripts/reviewers_remove.js (renamed from .github/scripts/remove-reviewers.js)0
-rw-r--r--.github/workflows/backport.yml2
-rw-r--r--.github/workflows/codeql.yml2
-rw-r--r--.github/workflows/coverity.yml2
-rw-r--r--.github/workflows/docs.yml (renamed from .github/workflows/api-docs.yml)6
-rw-r--r--.github/workflows/labeler_issue.yml (renamed from .github/workflows/issue-open-check.yml)7
-rw-r--r--.github/workflows/labeler_pr.yml (renamed from .github/workflows/labeler.yml)15
-rw-r--r--.github/workflows/lintcommit.yml2
-rw-r--r--.github/workflows/news.yml2
-rw-r--r--.github/workflows/release.yml2
-rw-r--r--.github/workflows/reviewers_add.yml (renamed from .github/workflows/add-reviewers.yml)4
-rw-r--r--.github/workflows/reviewers_remove.yml (renamed from .github/workflows/remove-reviewers.yml)4
-rw-r--r--.github/workflows/test.yml11
-rw-r--r--.github/workflows/vim_patches.yml (renamed from .github/workflows/vim-patches.yml)0
-rw-r--r--MAINTAIN.md2
-rw-r--r--Makefile5
-rw-r--r--cmake.deps/deps.txt4
-rw-r--r--cmake/FindLibuv.cmake12
-rw-r--r--runtime/doc/autocmd.txt4
-rw-r--r--runtime/doc/builtin.txt4
-rw-r--r--runtime/doc/change.txt2
-rw-r--r--runtime/doc/cmdline.txt5
-rw-r--r--runtime/doc/editorconfig.txt2
-rw-r--r--runtime/doc/eval.txt2
-rw-r--r--runtime/doc/filetype.txt5
-rw-r--r--runtime/doc/indent.txt34
-rw-r--r--runtime/doc/lua-guide.txt2
-rw-r--r--runtime/doc/lua.txt13
-rw-r--r--runtime/doc/news.txt78
-rw-r--r--runtime/doc/options.txt4
-rw-r--r--runtime/doc/quickref.txt10
-rw-r--r--runtime/doc/syntax.txt109
-rw-r--r--runtime/doc/vim_diff.txt2
-rw-r--r--runtime/ftplugin/fortran.vim17
-rw-r--r--runtime/indent/fortran.vim7
-rw-r--r--runtime/lua/vim/_defaults.lua255
-rw-r--r--runtime/lua/vim/_meta.lua1
-rw-r--r--runtime/lua/vim/_meta/options.lua4
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua4
-rw-r--r--runtime/lua/vim/iter.lua12
-rw-r--r--runtime/lua/vim/lsp/_meta/protocol.lua2
-rw-r--r--runtime/lua/vim/snippet.lua4
-rw-r--r--runtime/lua/vim/termcap.lua52
-rw-r--r--runtime/lua/vim/treesitter/_fold.lua211
-rw-r--r--runtime/plugin/osc52.lua8
-rw-r--r--runtime/syntax/cpp.vim3
-rw-r--r--runtime/syntax/fortran.vim329
-rw-r--r--runtime/syntax/squirrel.vim3
-rw-r--r--runtime/syntax/vim.vim2
-rw-r--r--scripts/gen_lsp.lua71
-rwxr-xr-xsrc/clint.py5
-rw-r--r--src/nvim/CMakeLists.txt19
-rw-r--r--src/nvim/api/buffer.c1
-rw-r--r--src/nvim/api/deprecated.c11
-rw-r--r--src/nvim/api/keysets_defs.h8
-rw-r--r--src/nvim/api/options.c110
-rw-r--r--src/nvim/api/private/converter.c31
-rw-r--r--src/nvim/api/private/helpers.c4
-rw-r--r--src/nvim/api/vim.c7
-rw-r--r--src/nvim/api/vimscript.c9
-rw-r--r--src/nvim/autocmd.c4
-rw-r--r--src/nvim/autocmd.h6
-rw-r--r--src/nvim/buffer.c76
-rw-r--r--src/nvim/buffer_defs.h11
-rw-r--r--src/nvim/channel.c4
-rw-r--r--src/nvim/context.c10
-rw-r--r--src/nvim/decoration.c170
-rw-r--r--src/nvim/decoration.h2
-rw-r--r--src/nvim/diff.c4
-rw-r--r--src/nvim/drawline.c4
-rw-r--r--src/nvim/drawscreen.c52
-rw-r--r--src/nvim/eval.c69
-rw-r--r--src/nvim/eval.lua4
-rw-r--r--src/nvim/eval/decode.c14
-rw-r--r--src/nvim/eval/funcs.c31
-rw-r--r--src/nvim/eval/userfunc.c4
-rw-r--r--src/nvim/eval/vars.c26
-rw-r--r--src/nvim/ex_cmds.c18
-rw-r--r--src/nvim/ex_docmd.c6
-rw-r--r--src/nvim/ex_getln.c13
-rw-r--r--src/nvim/extmark.c26
-rw-r--r--src/nvim/extmark.h8
-rw-r--r--src/nvim/fileio.c4
-rw-r--r--src/nvim/generators/gen_options.lua23
-rw-r--r--src/nvim/globals.h3
-rw-r--r--src/nvim/help.c8
-rw-r--r--src/nvim/highlight_group.c7
-rw-r--r--src/nvim/indent.c4
-rw-r--r--src/nvim/log.c2
-rw-r--r--src/nvim/lua/converter.c8
-rw-r--r--src/nvim/lua/executor.c2
-rw-r--r--src/nvim/lua/stdlib.c7
-rw-r--r--src/nvim/main.c24
-rw-r--r--src/nvim/map.c3
-rw-r--r--src/nvim/map_defs.h3
-rw-r--r--src/nvim/mapping.c4
-rw-r--r--src/nvim/mark.c6
-rw-r--r--src/nvim/marktree.c15
-rw-r--r--src/nvim/marktree.h83
-rw-r--r--src/nvim/marktree_defs.h83
-rw-r--r--src/nvim/memline.c2
-rw-r--r--src/nvim/message.c2
-rw-r--r--src/nvim/move.c2
-rw-r--r--src/nvim/ops.c4
-rw-r--r--src/nvim/option.c651
-rw-r--r--src/nvim/option.h11
-rw-r--r--src/nvim/option_defs.h5
-rw-r--r--src/nvim/options.lua586
-rw-r--r--src/nvim/optionstr.c87
-rw-r--r--src/nvim/path.c2
-rw-r--r--src/nvim/plines.c1
-rw-r--r--src/nvim/plines.h4
-rw-r--r--src/nvim/popupmenu.c10
-rw-r--r--src/nvim/quickfix.c16
-rw-r--r--src/nvim/runtime.c2
-rw-r--r--src/nvim/shada.c2
-rw-r--r--src/nvim/spell.c6
-rw-r--r--src/nvim/spellfile.c2
-rw-r--r--src/nvim/statusline.c38
-rw-r--r--src/nvim/statusline.h1
-rw-r--r--src/nvim/terminal.c6
-rw-r--r--src/nvim/textformat.c6
-rw-r--r--src/nvim/tui/input.c24
-rw-r--r--src/nvim/tui/input.h3
-rw-r--r--src/nvim/tui/tui.c178
-rw-r--r--src/nvim/types_defs.h7
-rw-r--r--src/nvim/ui.c23
-rw-r--r--src/nvim/ui_client.c9
-rw-r--r--src/nvim/undo.c2
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/window.c2
-rw-r--r--test/functional/api/buffer_spec.lua70
-rw-r--r--test/functional/api/buffer_updates_spec.lua6
-rw-r--r--test/functional/api/extmark_spec.lua55
-rw-r--r--test/functional/api/vim_spec.lua153
-rw-r--r--test/functional/api/window_spec.lua56
-rw-r--r--test/functional/autocmd/autocmd_oldtest_spec.lua2
-rw-r--r--test/functional/autocmd/autocmd_spec.lua53
-rw-r--r--test/functional/autocmd/cmdline_spec.lua15
-rw-r--r--test/functional/autocmd/focus_spec.lua23
-rw-r--r--test/functional/autocmd/show_spec.lua5
-rw-r--r--test/functional/core/fileio_spec.lua87
-rw-r--r--test/functional/core/job_spec.lua22
-rw-r--r--test/functional/core/main_spec.lua20
-rw-r--r--test/functional/core/startup_spec.lua115
-rw-r--r--test/functional/editor/completion_spec.lua257
-rw-r--r--test/functional/editor/ctrl_c_spec.lua10
-rw-r--r--test/functional/editor/mark_spec.lua9
-rw-r--r--test/functional/editor/mode_insert_spec.lua15
-rw-r--r--test/functional/editor/tabpage_spec.lua10
-rw-r--r--test/functional/ex_cmds/append_spec.lua12
-rw-r--r--test/functional/ex_cmds/cmd_map_spec.lua217
-rw-r--r--test/functional/ex_cmds/debug_spec.lua31
-rw-r--r--test/functional/ex_cmds/drop_spec.lua23
-rw-r--r--test/functional/ex_cmds/map_spec.lua43
-rw-r--r--test/functional/ex_cmds/mksession_spec.lua4
-rw-r--r--test/functional/ex_cmds/quickfix_commands_spec.lua5
-rw-r--r--test/functional/ex_cmds/swapfile_preserve_recover_spec.lua50
-rw-r--r--test/functional/helpers.lua11
-rw-r--r--test/functional/legacy/063_match_and_matchadd_spec.lua8
-rw-r--r--test/functional/legacy/107_adjust_window_and_contents_spec.lua10
-rw-r--r--test/functional/legacy/arglist_spec.lua5
-rw-r--r--test/functional/legacy/breakindent_spec.lua10
-rw-r--r--test/functional/legacy/cmdline_spec.lua101
-rw-r--r--test/functional/legacy/conceal_spec.lua24
-rw-r--r--test/functional/legacy/cpoptions_spec.lua10
-rw-r--r--test/functional/legacy/debugger_spec.lua18
-rw-r--r--test/functional/legacy/digraph_spec.lua15
-rw-r--r--test/functional/legacy/display_spec.lua97
-rw-r--r--test/functional/legacy/edit_spec.lua30
-rw-r--r--test/functional/legacy/ex_mode_spec.lua8
-rw-r--r--test/functional/legacy/excmd_spec.lua114
-rw-r--r--test/functional/legacy/fold_spec.lua50
-rw-r--r--test/functional/legacy/global_spec.lua5
-rw-r--r--test/functional/legacy/highlight_spec.lua5
-rw-r--r--test/functional/legacy/listchars_spec.lua40
-rw-r--r--test/functional/legacy/listlbr_spec.lua32
-rw-r--r--test/functional/legacy/match_spec.lua17
-rw-r--r--test/functional/legacy/matchparen_spec.lua8
-rw-r--r--test/functional/legacy/messages_spec.lua115
-rw-r--r--test/functional/legacy/move_spec.lua12
-rw-r--r--test/functional/legacy/normal_spec.lua15
-rw-r--r--test/functional/legacy/options_spec.lua12
-rw-r--r--test/functional/legacy/prompt_buffer_spec.lua86
-rw-r--r--test/functional/legacy/put_spec.lua3
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua188
-rw-r--r--test/functional/legacy/search_spec.lua24
-rw-r--r--test/functional/legacy/search_stat_spec.lua68
-rw-r--r--test/functional/legacy/source_spec.lua5
-rw-r--r--test/functional/legacy/statusline_spec.lua21
-rw-r--r--test/functional/legacy/substitute_spec.lua5
-rw-r--r--test/functional/legacy/tabline_spec.lua16
-rw-r--r--test/functional/legacy/visual_spec.lua10
-rw-r--r--test/functional/legacy/window_cmd_spec.lua8
-rw-r--r--test/functional/lua/api_spec.lua4
-rw-r--r--test/functional/lua/commands_spec.lua9
-rw-r--r--test/functional/lua/ffi_spec.lua4
-rw-r--r--test/functional/lua/iter_spec.lua5
-rw-r--r--test/functional/lua/json_spec.lua4
-rw-r--r--test/functional/lua/loop_spec.lua18
-rw-r--r--test/functional/lua/luaeval_spec.lua4
-rw-r--r--test/functional/lua/overrides_spec.lua88
-rw-r--r--test/functional/lua/secure_spec.lua40
-rw-r--r--test/functional/lua/thread_spec.lua36
-rw-r--r--test/functional/lua/ui_event_spec.lua14
-rw-r--r--test/functional/lua/vim_spec.lua16
-rw-r--r--test/functional/options/chars_spec.lua41
-rw-r--r--test/functional/options/cursorbind_spec.lua25
-rw-r--r--test/functional/options/defaults_spec.lua3
-rw-r--r--test/functional/options/shortmess_spec.lua28
-rw-r--r--test/functional/plugin/lsp/semantic_tokens_spec.lua175
-rw-r--r--test/functional/plugin/man_spec.lua15
-rw-r--r--test/functional/provider/clipboard_spec.lua30
-rw-r--r--test/functional/terminal/altscreen_spec.lua16
-rw-r--r--test/functional/terminal/api_spec.lua23
-rw-r--r--test/functional/terminal/buffer_spec.lua141
-rw-r--r--test/functional/terminal/channel_spec.lua18
-rw-r--r--test/functional/terminal/cursor_spec.lua209
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua6
-rw-r--r--test/functional/terminal/helpers.lua27
-rw-r--r--test/functional/terminal/highlight_spec.lua36
-rw-r--r--test/functional/terminal/scrollback_spec.lua19
-rw-r--r--test/functional/terminal/tui_spec.lua690
-rw-r--r--test/functional/terminal/window_spec.lua54
-rw-r--r--test/functional/terminal/window_split_tab_spec.lua19
-rw-r--r--test/functional/treesitter/fold_spec.lua401
-rw-r--r--test/functional/treesitter/highlight_spec.lua117
-rw-r--r--test/functional/ui/bufhl_spec.lua255
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua298
-rw-r--r--test/functional/ui/cmdline_spec.lua408
-rw-r--r--test/functional/ui/cursor_spec.lua8
-rw-r--r--test/functional/ui/decorations_spec.lua477
-rw-r--r--test/functional/ui/diff_spec.lua437
-rw-r--r--test/functional/ui/embed_spec.lua68
-rw-r--r--test/functional/ui/float_spec.lua3588
-rw-r--r--test/functional/ui/fold_spec.lua1170
-rw-r--r--test/functional/ui/highlight_spec.lua507
-rw-r--r--test/functional/ui/hlstate_spec.lua78
-rw-r--r--test/functional/ui/inccommand_spec.lua951
-rw-r--r--test/functional/ui/inccommand_user_spec.lua100
-rw-r--r--test/functional/ui/input_spec.lua44
-rw-r--r--test/functional/ui/linematch_spec.lua88
-rw-r--r--test/functional/ui/messages_spec.lua561
-rw-r--r--test/functional/ui/mode_spec.lua69
-rw-r--r--test/functional/ui/mouse_spec.lua262
-rw-r--r--test/functional/ui/multibyte_spec.lua67
-rw-r--r--test/functional/ui/multigrid_spec.lua2411
-rw-r--r--test/functional/ui/options_spec.lua9
-rw-r--r--test/functional/ui/output_spec.lua22
-rw-r--r--test/functional/ui/popupmenu_spec.lua1498
-rw-r--r--test/functional/ui/quickfix_spec.lua4
-rw-r--r--test/functional/ui/screen.lua79
-rw-r--r--test/functional/ui/screen_basic_spec.lua410
-rw-r--r--test/functional/ui/searchhl_spec.lua173
-rw-r--r--test/functional/ui/sign_spec.lua313
-rw-r--r--test/functional/ui/spell_spec.lua99
-rw-r--r--test/functional/ui/statuscolumn_spec.lua31
-rw-r--r--test/functional/ui/statusline_spec.lua185
-rw-r--r--test/functional/ui/syntax_conceal_spec.lua464
-rw-r--r--test/functional/ui/tabline_spec.lua38
-rw-r--r--test/functional/ui/wildmode_spec.lua169
-rw-r--r--test/functional/ui/winbar_spec.lua228
-rw-r--r--test/functional/vimscript/api_functions_spec.lua5
-rw-r--r--test/functional/vimscript/execute_spec.lua35
-rw-r--r--test/functional/vimscript/input_spec.lua96
-rw-r--r--test/functional/vimscript/json_functions_spec.lua15
-rw-r--r--test/functional/vimscript/match_functions_spec.lua4
-rw-r--r--test/functional/vimscript/system_spec.lua104
-rw-r--r--test/functional/vimscript/timer_spec.lua15
-rw-r--r--test/helpers.lua19
-rw-r--r--test/old/testdir/runnvim.vim2
-rw-r--r--test/old/testdir/test_diffmode.vim50
-rw-r--r--test/old/testdir/test_listdict.vim19
-rw-r--r--test/old/testdir/test_options.vim6
-rw-r--r--test/unit/formatc.lua2
-rw-r--r--test/unit/helpers.lua9
-rw-r--r--test/unit/statusline_spec.lua2
280 files changed, 7013 insertions, 18080 deletions
diff --git a/.github/labeler.yml b/.github/labeler.yml
deleted file mode 100644
index 111fc5f373..0000000000
--- a/.github/labeler.yml
+++ /dev/null
@@ -1,66 +0,0 @@
-"lsp":
- - runtime/lua/vim/lsp.lua
- - runtime/lua/vim/lsp/*
-
-"tui":
- - src/nvim/tui/tui.*
-
-"treesitter":
- - src/nvim/lua/treesitter.*
- - runtime/lua/vim/treesitter.lua
- - runtime/lua/vim/treesitter/*
- - runtime/queries/**/*
-
-"diagnostic":
- - runtime/lua/vim/diagnostic.lua
-
-"dependencies":
- - cmake.deps/**/*
-
-"spell":
- - src/nvim/spell*
-
-"terminal":
- - src/nvim/terminal.*
-
-"column":
- - src/nvim/sign*
-
-"folds":
- - src/nvim/fold*
-
-"mouse":
- - src/nvim/mouse*
-
-"documentation":
- - all: ["runtime/doc/*"]
- - all: ["**/*.md"]
-
-"clipboard":
- - runtime/autoload/provider/clipboard.vim
-
-"diff":
- - src/nvim/diff.*
-
-"build":
- - CMakeLists.txt
- - "**/CMakeLists.txt"
- - "**/Makefile"
- - "**/*.cmake"
-
-"test":
- - all: ["test/**/*"]
-
-"ci":
- - .github/labeler.yml
- - .github/workflows/**/*
- - .builds/*
- - ci/**/*
-
-"filetype":
- - runtime/lua/vim/filetype.lua
- - runtime/lua/vim/filetype/detect.lua
-
-"platform:nix":
- - contrib/flake.lock
- - contrib/flake.nix
diff --git a/.github/scripts/labeler_configuration.yml b/.github/scripts/labeler_configuration.yml
new file mode 100644
index 0000000000..3db8444fde
--- /dev/null
+++ b/.github/scripts/labeler_configuration.yml
@@ -0,0 +1,71 @@
+lsp:
+ - changed-files:
+ - any-glob-to-any-file: [ runtime/lua/vim/lsp.lua, runtime/lua/vim/lsp/* ]
+
+tui:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/tui/tui.* ]
+
+treesitter:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/lua/treesitter.*, runtime/lua/vim/treesitter.lua, runtime/lua/vim/treesitter/*, runtime/queries/**/* ]
+
+diagnostic:
+ - changed-files:
+ - any-glob-to-any-file: [ runtime/lua/vim/diagnostic.lua ]
+
+dependencies:
+ - changed-files:
+ - any-glob-to-any-file: [ cmake.deps/**/* ]
+
+spell:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/spell* ]
+
+terminal:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/terminal.* ]
+
+column:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/sign* ]
+
+folds:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/fold* ]
+
+mouse:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/mouse* ]
+
+documentation:
+ - changed-files:
+ - any-glob-to-all-files: [ runtime/doc/*, "**/*.md" ]
+
+clipboard:
+ - changed-files:
+ - any-glob-to-any-file: [ runtime/autoload/provider/clipboard.vim ]
+
+diff:
+ - changed-files:
+ - any-glob-to-any-file: [ src/nvim/diff.* ]
+
+build:
+ - changed-files:
+ - any-glob-to-any-file: [ CMakeLists.txt, "**/CMakeLists.txt", "**/Makefile", "**/*.cmake" ]
+
+test:
+ - changed-files:
+ - any-glob-to-all-files: [test/**/*]
+
+ci:
+ - changed-files:
+ - any-glob-to-any-file: [ .github/actions/**, .github/workflows/**, .github/scripts/** ]
+
+filetype:
+ - changed-files:
+ - any-glob-to-any-file: [ runtime/lua/vim/filetype.lua, runtime/lua/vim/filetype/detect.lua ]
+
+platform:nix:
+ - changed-files:
+ - any-glob-to-any-file: [ contrib/flake.lock, contrib/flake.nix ]
diff --git a/.github/scripts/reviews.js b/.github/scripts/reviewers_add.js
index d28d91c2f6..d28d91c2f6 100644
--- a/.github/scripts/reviews.js
+++ b/.github/scripts/reviewers_add.js
diff --git a/.github/scripts/remove-reviewers.js b/.github/scripts/reviewers_remove.js
index 9e44e4ac86..9e44e4ac86 100644
--- a/.github/scripts/remove-reviewers.js
+++ b/.github/scripts/reviewers_remove.js
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
index 321cd02b0c..3ed5573262 100644
--- a/.github/workflows/backport.yml
+++ b/.github/workflows/backport.yml
@@ -1,4 +1,4 @@
-name: Backport
+name: backport
on:
pull_request_target:
types: [closed, labeled]
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 033dd5aef4..75c932b0a6 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -1,4 +1,4 @@
-name: "CodeQL"
+name: "codeql"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index 998678daf0..db0f878de4 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -1,4 +1,4 @@
-name: Coverity
+name: coverity
on:
schedule:
- cron: '10 0 * * *' # Run every day at 00:10
diff --git a/.github/workflows/api-docs.yml b/.github/workflows/docs.yml
index 181e3a1a41..c47df46b28 100644
--- a/.github/workflows/api-docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,5 +1,4 @@
-# Check if any PR needs to run the autogenerate script
-name: Autogenerate API docs and types
+name: docs
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
@@ -8,9 +7,8 @@ on:
- 'src/nvim/eval.lua'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
-
jobs:
- regen-api-docs-and-types:
+ docs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
permissions:
diff --git a/.github/workflows/issue-open-check.yml b/.github/workflows/labeler_issue.yml
index eac1c2ee4d..0da4c0f707 100644
--- a/.github/workflows/issue-open-check.yml
+++ b/.github/workflows/labeler_issue.yml
@@ -1,17 +1,14 @@
-name: Issue Open Check
-
+name: "labeler: issue"
on:
issues:
types: [opened]
-
jobs:
- issue-open-check:
+ labeler:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: check issue title
- id: check-issue
uses: actions/github-script@v7
with:
script: |
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler_pr.yml
index 52682d93dd..8fd93bfb6d 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler_pr.yml
@@ -1,20 +1,21 @@
-name: "Pull Request Labeler"
+name: "labeler: PR"
on:
pull_request_target:
types: [opened]
jobs:
- triage:
+ changed-files:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- - uses: actions/labeler@v4
+ - uses: actions/checkout@v4
+ - uses: actions/labeler@v5
with:
- sync-labels: ""
+ configuration-path: .github/scripts/labeler_configuration.yml
type-scope:
- needs: triage
+ needs: changed-files
runs-on: ubuntu-latest
permissions:
contents: write
@@ -33,7 +34,7 @@ jobs:
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
request-reviewer:
- needs: ["triage", "type-scope"]
+ needs: ["changed-files", "type-scope"]
permissions:
pull-requests: write
- uses: ./.github/workflows/add-reviewers.yml
+ uses: ./.github/workflows/reviewers_add.yml
diff --git a/.github/workflows/lintcommit.yml b/.github/workflows/lintcommit.yml
index f27b22f35f..3d140532cd 100644
--- a/.github/workflows/lintcommit.yml
+++ b/.github/workflows/lintcommit.yml
@@ -1,4 +1,4 @@
-name: "Commit Linter"
+name: "lintcommit"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
diff --git a/.github/workflows/news.yml b/.github/workflows/news.yml
index d4f8e5ad65..09337a0356 100644
--- a/.github/workflows/news.yml
+++ b/.github/workflows/news.yml
@@ -1,4 +1,4 @@
-name: "news.txt check"
+name: "news.txt"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e304196e99..feacb29533 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,4 +1,4 @@
-name: Release
+name: release
on:
schedule:
- cron: '5 5 * * *'
diff --git a/.github/workflows/add-reviewers.yml b/.github/workflows/reviewers_add.yml
index 22c68b6ef7..b116bca29b 100644
--- a/.github/workflows/add-reviewers.yml
+++ b/.github/workflows/reviewers_add.yml
@@ -1,4 +1,4 @@
-name: "Request reviews"
+name: "reviewers: add"
on:
pull_request_target:
types: [labeled, ready_for_review, reopened]
@@ -15,5 +15,5 @@ jobs:
uses: actions/github-script@v7
with:
script: |
- const script = require('./.github/scripts/reviews.js')
+ const script = require('./.github/scripts/reviewers_add.js')
await script({github, context})
diff --git a/.github/workflows/remove-reviewers.yml b/.github/workflows/reviewers_remove.yml
index 3fe7493b93..b10d8c3d23 100644
--- a/.github/workflows/remove-reviewers.yml
+++ b/.github/workflows/reviewers_remove.yml
@@ -1,4 +1,4 @@
-name: "Remove reviewers"
+name: "reviewers: remove"
on:
pull_request_target:
types: [converted_to_draft, closed]
@@ -13,5 +13,5 @@ jobs:
uses: actions/github-script@v7
with:
script: |
- const script = require('./.github/scripts/remove-reviewers.js')
+ const script = require('./.github/scripts/reviewers_remove.js')
await script({github, context})
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 82fc31e874..43fd76dd39 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -104,14 +104,14 @@ jobs:
{ runner: ubuntu-22.04, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
{ runner: ubuntu-22.04, cc: gcc },
{ runner: macos-12, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
- { runner: ubuntu-22.04, flavor: functionaltest-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
+ { runner: ubuntu-22.04, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
]
test: [unittest, functionaltest, oldtest]
exclude:
- test: unittest
build: { flavor: tsan }
- test: unittest
- build: { flavor: functionaltest-lua }
+ build: { flavor: puc-lua }
- test: oldtest
build: { flavor: tsan }
runs-on: ${{ matrix.build.runner }}
@@ -127,13 +127,6 @@ jobs:
- name: Create log dir
run: mkdir -p "$LOG_DIR"
- # FIXME(dundargoc): this workaround is needed for macos as the python3
- # provider tests suddenly started to become extremely flaky, and this
- # removes the flakiness for some reason.
- - uses: actions/setup-python@v4
- with:
- python-version: '3.11'
-
- if: ${{ matrix.test != 'unittest' }}
name: Set up interpreter packages
run: |
diff --git a/.github/workflows/vim-patches.yml b/.github/workflows/vim_patches.yml
index 711ddae815..711ddae815 100644
--- a/.github/workflows/vim-patches.yml
+++ b/.github/workflows/vim_patches.yml
diff --git a/MAINTAIN.md b/MAINTAIN.md
index 2fd43f3685..5e64b885d2 100644
--- a/MAINTAIN.md
+++ b/MAINTAIN.md
@@ -93,7 +93,7 @@ Example:
┆ ┆ ┆
┆ Soft ┆ Hard ┆
┆ Deprecation ┆ Deprecation ┆
- ┆ Period ┆ Preiod ┆
+ ┆ Period ┆ Period ┆
────────────────────────────────────────────────────────────
Version: 0.10 0.11 0.12
────────────────────────────────────────────────────────────
diff --git a/Makefile b/Makefile
index 9d9c0c7816..0a807e65da 100644
--- a/Makefile
+++ b/Makefile
@@ -142,16 +142,13 @@ iwyu: build/.ran-cmake
cmake --preset iwyu
cmake --build build > build/iwyu.log
iwyu-fix-includes --only_re="src/nvim" --ignore_re="(src/nvim/eval/encode.c|src/nvim/auto/|src/nvim/os/lang.c|src/nvim/map.c\
- |src/nvim/api/extmark.h\
|src/nvim/api/private/helpers.h\
|src/nvim/api/private/validate.h\
|src/nvim/assert_defs.h\
- |src/nvim/autocmd.h\
|src/nvim/buffer.h\
|src/nvim/buffer_defs.h\
|src/nvim/channel.h\
|src/nvim/charset.h\
- |src/nvim/decoration.h\
|src/nvim/drawline.h\
|src/nvim/eval.h\
|src/nvim/eval/encode.h\
@@ -169,7 +166,6 @@ iwyu: build/.ran-cmake
|src/nvim/event/stream.h\
|src/nvim/event/time.h\
|src/nvim/event/wstream.h\
- |src/nvim/extmark.h\
|src/nvim/garray.h\
|src/nvim/globals.h\
|src/nvim/grid.h\
@@ -188,7 +184,6 @@ iwyu: build/.ran-cmake
|src/nvim/os/pty_conpty_win.h\
|src/nvim/os/pty_process_unix.h\
|src/nvim/os/pty_process_win.h\
- |src/nvim/plines.h\
|src/nvim/tui/input.h\
|src/nvim/ui.h\
|src/nvim/viml/parser/expressions.h\
diff --git a/cmake.deps/deps.txt b/cmake.deps/deps.txt
index 75abe106ed..76d95e7fd1 100644
--- a/cmake.deps/deps.txt
+++ b/cmake.deps/deps.txt
@@ -4,8 +4,8 @@ LIBUV_SHA256 d50af7e6d72526db137e66fad812421c8a1cae09d146b0ec2bb9a22c5f23ba93
MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/c-6.0.0.tar.gz
MSGPACK_SHA256 af6f3cf25edb220aa2140b09bb5bdd73ddf00938194bd94ebe5c92090cccb466
-LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/43d0a19158ceabaa51b0462c1ebc97612b420a2e.tar.gz
-LUAJIT_SHA256 4fefa19bc5600928fb13c928bf5325eaa1c78f2c1738a8ac9552154ef178bb9a
+LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/ff204d0350575cf710f6f4af982db146cb454e1a.tar.gz
+LUAJIT_SHA256 3ec37f78ab3b1afd4c3af0fde743c332da3da32eadc8500489c1cc2e4f0ec7eb
LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz
LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
diff --git a/cmake/FindLibuv.cmake b/cmake/FindLibuv.cmake
index 19315388dd..1913d564f2 100644
--- a/cmake/FindLibuv.cmake
+++ b/cmake/FindLibuv.cmake
@@ -1,5 +1,5 @@
find_path2(LIBUV_INCLUDE_DIR uv.h)
-find_library2(LIBUV_LIBRARY NAMES uv_a uv)
+find_library2(LIBUV_LIBRARY NAMES uv_a uv libuv)
set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
@@ -41,10 +41,12 @@ endif()
if(WIN32)
# check_library_exists() does not work for Win32 API calls in X86 due to name
# mangling calling conventions
- list(APPEND LIBUV_LIBRARIES iphlpapi)
- list(APPEND LIBUV_LIBRARIES psapi)
- list(APPEND LIBUV_LIBRARIES userenv)
- list(APPEND LIBUV_LIBRARIES ws2_32)
+ list(APPEND LIBUV_LIBRARIES
+ iphlpapi
+ psapi
+ userenv
+ ws2_32
+ dbghelp)
endif()
find_package(Threads)
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index c6f6559e37..45d7a4244c 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1001,10 +1001,10 @@ TermResponse When Nvim receives an OSC or DCS response from
once = true,
callback = function(args)
local resp = args.data
- local r, g, b = resp:match("\x1b%]4;1;rgb:(%w+)/(%w+)/(%w+)")
+ local r, g, b = resp:match("\027%]4;1;rgb:(%w+)/(%w+)/(%w+)")
end,
})
- io.stdout:write("\x1b]4;1;?\x1b\\")
+ io.stdout:write("\027]4;1;?\027\\")
<
*TextChanged*
TextChanged After a change was made to the text in the
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 6ffb514487..4b0da06971 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -3873,8 +3873,7 @@ json_decode({expr}) *json_decode()*
Vim value. In the following cases it will output
|msgpack-special-dict|:
1. Dictionary contains duplicate key.
- 2. Dictionary contains empty key.
- 3. String contains NUL byte. Two special dictionaries: for
+ 2. String contains NUL byte. Two special dictionaries: for
dictionary and for string will be emitted in case string
with NUL byte was a dictionary key.
@@ -4954,7 +4953,6 @@ msgpackparse({data}) *msgpackparse()*
are binary strings).
2. String with NUL byte inside.
3. Duplicate key.
- 4. Empty key.
ext |List| with two values: first is a signed integer
representing extension type. Second is
|readfile()|-style list of strings.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index e1bb7c5fc7..fe796422c2 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -485,7 +485,7 @@ SHIFTING LINES LEFT OR RIGHT *shift-left-right*
lines to [indent] (default 0).
*:>*
-:[range]> [flags] Shift {count} [range] lines one 'shiftwidth' right.
+:[range]> [flags] Shift [range] lines one 'shiftwidth' right.
Repeat '>' for shifting multiple 'shiftwidth's.
See |ex-flags| for [flags].
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 8bed8a9ffc..57a4223c53 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -439,9 +439,8 @@ CTRL-T When 'incsearch' is set, entering a search pattern for "/" or
keyboard T is above G.
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
-a previous version <Esc> was used). In the pattern standard wildcards "*" and
-'?' are accepted when matching file names. "*" matches any string, '?'
-matches exactly one character.
+a previous version <Esc> was used). In the pattern standard |wildcards| are
+accepted when matching file names.
When repeating 'wildchar' or CTRL-N you cycle through the matches, eventually
ending up back to what was typed. If the first match is not what you wanted,
diff --git a/runtime/doc/editorconfig.txt b/runtime/doc/editorconfig.txt
index 7c6e8fb95f..a2281a7b7c 100644
--- a/runtime/doc/editorconfig.txt
+++ b/runtime/doc/editorconfig.txt
@@ -49,6 +49,8 @@ indent_size A number indicating the size of a single indent.
Alternatively, use the value "tab" to use the value of
the tab_width property. Sets the 'shiftwidth' and
'softtabstop' options.
+ If this value is not "tab" and the tab_width property
+ is not set, 'tabstop' is also set to this value.
*editorconfig_insert_final_newline*
insert_final_newline "true" or "false" to ensure the file always has a
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index a73932be00..a3ba098740 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4365,7 +4365,7 @@ have Vim execute random executables or may have forbidden to do so for
specific filetypes by setting the "<filetype>_exec" variable (|plugin_exec|).
It returns |TRUE| or |FALSE| to indicate whether the plugin should run the given
-exectuable. It takes the following arguments:
+executable. It takes the following arguments:
argument type ~
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index ed21dc1c37..115fc18cc5 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -530,8 +530,9 @@ FORTRAN *ft-fortran-plugin*
Options:
'expandtab' is switched on to avoid tabs as required by the Fortran
standards unless the user has set fortran_have_tabs in vimrc.
-'textwidth' is set to 72 for fixed source format as required by the
- Fortran standards and to 80 for free source format.
+'textwidth' is set to 80 for fixed source format whereas it is set to 132
+ for free source format. Setting the fortran_extended_line_length
+ variable increases the width to 132 for fixed source format.
'formatoptions' is set to break code and comment lines and to preserve long
lines. You can format comments with |gq|.
For further discussion of fortran_have_tabs and the method used for the
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 853facdaa0..1cd5c7b5f5 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -711,26 +711,25 @@ FORTRAN *ft-fortran-indent*
Block if, select case, where, and forall constructs are indented. So are
type, interface, associate, block, and enum constructs. The indenting of
subroutines, functions, modules, and program blocks is optional. Comments,
-labelled statements and continuation lines are indented if the Fortran is in
+labeled statements, and continuation lines are indented if the Fortran is in
free source form, whereas they are not indented if the Fortran is in fixed
source form because of the left margin requirements. Hence manual indent
-corrections will be necessary for labelled statements and continuation lines
+corrections will be necessary for labeled statements and continuation lines
when fixed source form is being used. For further discussion of the method
used for the detection of source format see |ft-fortran-syntax|.
Do loops ~
All do loops are left unindented by default. Do loops can be unstructured in
-Fortran with (possibly multiple) loops ending on a labelled executable
+Fortran with (possibly multiple) loops ending on a labeled executable
statement of almost arbitrary type. Correct indentation requires
-compiler-quality parsing. Old code with do loops ending on labelled statements
-of arbitrary type can be indented with elaborate programs such as Tidy
-(https://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
-also left unindented because continue statements are also used for purposes
-other than ending a do loop. Programs such as Tidy can convert structured
-do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
-be indented. If you use only structured loops of the do/enddo form, you should
-declare this by setting the fortran_do_enddo variable in your vimrc as
-follows >
+compiler-quality parsing. Old code with do loops ending on labeled statements
+of arbitrary type can be indented with elaborate programs such as Tidy.
+Structured do/continue loops are also left unindented because continue
+statements are used for purposes other than ending a do loop. Programs such
+as Tidy can convert structured do/continue loops to the do/enddo form. Do
+loops of the do/enddo variety can be indented. If you use only structured
+loops of the do/enddo form, you should declare this by setting the
+fortran_do_enddo variable in your vimrc as follows >
let fortran_do_enddo=1
@@ -744,15 +743,14 @@ to get do loops indented in .f90 files and left alone in Fortran files with
other extensions such as .for.
Program units ~
-The indenting of program units (subroutines, functions, modules, and program
-blocks) is enabled by default but can be suppressed if a lighter, screen-width
-preserving indent style is desired. To suppress the indenting of program
-units for all fortran files set the global fortran_indent_less variable in
-your vimrc as follows >
+Indenting of program units (subroutines, functions, modules, and program
+blocks) can be increased by setting the variable fortran_indent_more and can
+be decreased by setting the variable fortran_indent_less. These variables
+can be set for all fortran files in your vimrc as follows >
let fortran_indent_less=1
-A finer level of suppression can be achieved by setting the corresponding
+A finer level of control can be achieved by setting the corresponding
buffer-local variable as follows >
let b:fortran_indent_less=1
diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt
index c15b1b0495..e8757a1859 100644
--- a/runtime/doc/lua-guide.txt
+++ b/runtime/doc/lua-guide.txt
@@ -157,7 +157,7 @@ its functions if this succeeds and prints an error message otherwise:
end
<
In contrast to |:source|, |require()| not only searches through all `lua/` directories
-under |'runtimepath'|, it also cache the module on first use. Calling
+under |'runtimepath'|, it also caches the module on first use. Calling
`require()` a second time will therefore _not_ execute the script again and
instead return the cached file. To rerun the file, you need to remove it from
the cache manually first:
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index a35d70cae8..f7f722bc0e 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -3410,6 +3410,19 @@ Iter:fold({init}, {f}) *Iter:fold()*
Return: ~
any
+Iter:join({delim}) *Iter:join()*
+ Collect the iterator into a delimited string.
+
+ Each element in the iterator is joined into a string separated by {delim}.
+
+ Consumes the iterator.
+
+ Parameters: ~
+ • {delim} (string) Delimiter
+
+ Return: ~
+ (string)
+
Iter:last() *Iter:last()*
Drains the iterator and returns the last item.
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index e38707fa76..95d6b7a2f6 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -71,9 +71,6 @@ The following changes may require adaptations in user config or plugins.
now requires an explicit range argument to be passed. If injections are
required, provide an explicit range via `parser:parse({ start_row, end_row })`.
-• Float window support hide and show by setting `hide` on `nvim_open_win` and
- `nvim_win_set_config`.
-
• |vim.lsp.util.parse_snippet()| will now strictly follow the snippet grammar
defined by LSP, and hence previously parsed snippets might now be considered
invalid input.
@@ -98,6 +95,9 @@ The following changes may require adaptations in user config or plugins.
• Default color scheme has been updated to be "Neovim branded" and accessible.
Use `:colorscheme vim` to revert to the old legacy color scheme.
+• 'termguicolors' is enabled by default when Nvim is able to determine that
+ the host terminal emulator supports 24-bit color.
+
==============================================================================
BREAKING CHANGES IN HEAD *news-breaking-dev*
@@ -122,14 +122,14 @@ The following new APIs and features were added.
• |vim.iter()| provides a generic iterator interface for tables and Lua
iterators |for-in|.
-• Added |vim.ringbuf()| to create ring buffers.
+• |vim.ringbuf()| creates ring buffers.
-• Added |vim.keycode()| for translating keycodes in a string.
+• |vim.keycode()| translates keycodes in a string.
• |'smoothscroll'| option to scroll by screen line rather than by text line
when |'wrap'| is set.
-• Added inline virtual text support to |nvim_buf_set_extmark()|.
+• |nvim_buf_set_extmark()| supports inline virtual text.
• 'foldtext' now supports virtual text format. |fold-foldtext|
@@ -139,7 +139,10 @@ The following new APIs and features were added.
• |vim.system()| for running system commands.
-• Added |nvim_win_text_height()| to compute the number of screen lines occupied
+• |vim.lpeg| and |vim.re| expose the bundled Lpeg expression grammar parser
+ and its regex interface.
+
+• |nvim_win_text_height()| computes the number of screen lines occupied
by a range of text in a given window.
• |nvim_set_keymap()| and |nvim_del_keymap()| now support abbreviations.
@@ -161,7 +164,7 @@ The following new APIs and features were added.
https://microsoft.github.io/language-server-protocol/specification/#textDocument_inlayHint
• Implemented pull diagnostic textDocument/diagnostic: |vim.lsp.diagnostic.on_diagnostic()|
https://microsoft.github.io/language-server-protocol/specification/#textDocument_diagnostic
- • Added |vim.lsp.status()| to consume the last progress messages as a string.
+ • |vim.lsp.status()| consumes the last progress messages as a string.
• LSP client now always saves and restores named buffer marks when applying
text edits.
• LSP client now supports the `positionEncoding` server capability. If a server
@@ -172,25 +175,29 @@ The following new APIs and features were added.
indicator to see if a server supports a feature. Instead use
`client.supports_method(<method>)`. It considers both the dynamic
capabilities and static `server_capabilities`.
- • Added a new `anchor_bias` option to |lsp-handlers| to aid in positioning of
- floating windows.
+ • `anchor_bias` option to |lsp-handlers| aids in positioning of floating
+ windows.
+ • |vim.lsp.util.locations_to_items()| sets the `user_data` of each item to
+ the original LSP `Location` or `LocationLink`.
• Treesitter
• Bundled parsers and queries (highlight, folds) for Markdown, Python, and
Bash.
- • Added |vim.treesitter.query.omnifunc()| for treesitter query files (set by
+ • |vim.treesitter.query.omnifunc()| for treesitter query files (set by
default).
• |Query:iter_matches()| now has the ability to set the maximum start depth
for matches.
- • `@injection.language` now has smarter resolution and will now fallback to language aliases and/or attempt lower case variants of the text.
- language via aliases (e.g., filetype) registered via
- `vim.treesitter.language.register`.
- • The `#set!` directive now supports `injection.self` and `injection.parent` for injecting either the current node's language
- or the parent LanguageTree's language, respectively.
- • Added `vim.treesitter.query.edit()`, for live editing of treesitter
+ • `@injection.language` now has smarter resolution and will fall back to
+ language aliases (e.g., filetype or custom shorthands) registered via
+ |vim.treesitter.language.register()| and/or attempt lower case variants of
+ the text.
+ • The `#set!` directive now supports `injection.self` and `injection.parent`
+ for injecting either the current node's language or the parent
+ |LanguageTree|'s language, respectively.
+ • |vim.treesitter.query.edit()| allows live editing of treesitter
queries.
• Improved error messages for query parsing.
- • Added |vim.treesitter.foldtext()| to apply treesitter highlighting to
+ • |vim.treesitter.foldtext()| applies treesitter highlighting to
foldtext.
• |vim.ui.open()| opens URIs using the system default handler (macOS `open`,
@@ -209,28 +216,28 @@ The following new APIs and features were added.
• Functions that take a severity as an optional parameter (e.g.
|vim.diagnostic.get()|) now also accept a list of severities |vim.diagnostic.severity|
-• New RPC client type `msgpack-rpc` is added for `nvim_set_client_info` to
+• New RPC client type `msgpack-rpc` is added for |nvim_set_client_info()| to
support fully MessagePack-RPC compliant clients.
• Floating windows can now show footer with new `footer` and `footer_pos`
config fields. Uses |hl-FloatFooter| by default.
+• Floating windows can now be hidden by setting `hide` in |nvim_open_win()| or
+ |nvim_win_set_config()|.
+
• The |:terminal| command now accepts some |:command-modifiers| (specifically
|:horizontal| and those that affect splitting a window).
-• |vim.lsp.util.locations_to_items()| sets the `user_data` of each item to the
- original LSP `Location` or `LocationLink`.
-
• |$NVIM_APPNAME| can be set to a relative path instead of only a name.
-• Added |:fclose| command.
+• |:fclose| command.
-• Added |vim.snippet| for snippet expansion support.
+• |vim.snippet| handles expansion of snippets in LSP format.
• 'complete' option supports "f" flag for completing buffer names.
-• Added |vim.base64.encode()| and |vim.base64.decode()| for encoding and decoding
- strings using Base64 encoding.
+• |vim.base64.encode()| and |vim.base64.decode()| encode and decode strings
+ using Base64 encoding.
• The |TermResponse| autocommand event can be used with |v:termresponse| to
read escape sequence responses from the terminal.
@@ -242,8 +249,8 @@ The following new APIs and features were added.
• The 'termsync' option asks the terminal emulator to buffer screen updates
until the redraw cycle is complete. Requires support from the terminal.
-• Added |vim.text.hexencode()| and |vim.text.hexdecode()| to convert strings
- to and from byte representations.
+• |vim.text.hexencode()| and |vim.text.hexdecode()| convert strings to and
+ from byte representations.
==============================================================================
CHANGED FEATURES *news-changed*
@@ -256,7 +263,7 @@ The following changes to existing APIs or features add new behavior.
• |vim.region()| can use a string accepted by |getpos()| as position.
-• vim.diagnostic.config() now accepts a function for the virtual_text.prefix
+• |vim.diagnostic.config()| now accepts a function for the virtual_text.prefix
option, which allows for rendering e.g., diagnostic severities differently.
• Defaults:
@@ -277,7 +284,7 @@ The following changes to existing APIs or features add new behavior.
• |LspRequest| autocmd callbacks now contain additional information about the LSP
request status update that occurred.
-• `:source` without arguments treats a buffer with its 'filetype' set to "lua"
+• |:source| without arguments treats a buffer with its 'filetype' set to "lua"
as Lua code regardless of its extension.
• |:checkhealth| buffer now implements |folding|. The initial folding status is
@@ -287,6 +294,7 @@ The following changes to existing APIs or features add new behavior.
• |gx| now uses |vim.ui.open()| and not netrw. To customize, you can redefine
`vim.ui.open` or remap `gx`. To continue using netrw (deprecated): >vim
+
:call netrw#BrowseX(expand(exists("g:netrw_gx")? g:netrw_gx : '<cfile>'), netrw#CheckIfRemote())<CR>
• |vim.lsp.start()| now maps |K| to use |vim.lsp.buf.hover()| if the server
@@ -336,12 +344,12 @@ REMOVED FEATURES *news-removed*
The following deprecated functions or APIs were removed.
-• Vimball support is removed.
- - :Vimuntar command removed.
+• Vimball support
+ - :Vimuntar command
-• Support for legacy treesitter injection queries is removed.
+• Support for legacy treesitter injection queries
-• Removed 'shortmess' flags:
+• 'shortmess' flags:
- |shm-f|. Always uses "(3 of 5)", never "(file 3 of 5)"
- |shm-i|. Always use "[noeol]".
- |shm-x|. Always use "[dos]", "[unix]" and "[mac]"
@@ -379,7 +387,7 @@ release.
- |vim.lsp.util.parse_snippet()|
- |vim.lsp.util.text_document_completion_list_to_complete_items()|
-• `vim.loop` has been renamed to `vim.uv`.
+• `vim.loop` has been renamed to |vim.uv|.
• vim.treesitter.languagetree functions:
- |LanguageTree:for_each_child()| Use |LanguageTree:children()| (non-recursive) instead.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index f47093782c..355c8cc99a 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6495,6 +6495,10 @@ A jump table for the options with a short description can be found at |Q_op|.
attributes instead of "cterm" attributes. |guifg|
Requires an ISO-8613-3 compatible terminal.
+ Nvim will automatically attempt to determine if the host terminal
+ supports 24-bit color and will enable this option if it does
+ (unless explicitly disabled by the user).
+
*'termpastefilter'* *'tpf'*
'termpastefilter' 'tpf' string (default "BS,HT,ESC,DEL")
global
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index f976eb7464..572dc8a841 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -623,9 +623,9 @@ Short explanation of each option: *option-list*
'aleph' 'al' ASCII code of the letter Aleph (Hebrew)
'allowrevins' 'ari' allow CTRL-_ in Insert and Command-line mode
'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
-'autochdir' 'acd' change directory to the file in the current window
'arabic' 'arab' for Arabic as a default second language
'arabicshape' 'arshape' do shaping for Arabic characters
+'autochdir' 'acd' change directory to the file in the current window
'autoindent' 'ai' take indent for new line from previous line
'autoread' 'ar' autom. read file when changed outside of Vim
'autowrite' 'aw' automatically write file if changed
@@ -655,8 +655,8 @@ Short explanation of each option: *option-list*
'cindent' 'cin' do C program indenting
'cinkeys' 'cink' keys that trigger indent when 'cindent' is set
'cinoptions' 'cino' how to do indenting when 'cindent' is set
-'cinwords' 'cinw' words where 'si' and 'cin' add an indent
'cinscopedecls' 'cinsd' words that are recognized by 'cino-g'
+'cinwords' 'cinw' words where 'si' and 'cin' add an indent
'clipboard' 'cb' use the clipboard as the unnamed register
'cmdheight' 'ch' number of lines to use for the command-line
'cmdwinheight' 'cwh' height of the command-line window
@@ -738,10 +738,10 @@ Short explanation of each option: *option-list*
'helpheight' 'hh' minimum height of a new help window
'helplang' 'hlg' preferred help languages
'hidden' 'hid' don't unload buffer when it is |abandon|ed
-'hlsearch' 'hls' highlight matches with last search pattern
'history' 'hi' number of command-lines that are remembered
'hkmap' 'hk' Hebrew keyboard mapping
'hkmapp' 'hkp' phonetic Hebrew keyboard mapping
+'hlsearch' 'hls' highlight matches with last search pattern
'icon' let Vim set the text of the window icon
'iconstring' string to use for the Vim icon text
'ignorecase' 'ic' ignore case in search patterns
@@ -939,10 +939,10 @@ Short explanation of each option: *option-list*
'wildoptions' 'wop' specifies how command line completion is done
'winaltkeys' 'wak' when the windows system handles ALT keys
'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B
-'winheight' 'wh' minimum number of lines for the current window
-'winhighlight' 'winhl' window-local highlighting
'winfixheight' 'wfh' keep window height when opening/closing windows
'winfixwidth' 'wfw' keep window width when opening/closing windows
+'winheight' 'wh' minimum number of lines for the current window
+'winhighlight' 'winhl' window-local highlighting
'winminheight' 'wmh' minimum number of lines for any window
'winminwidth' 'wmw' minimal number of columns for any window
'winwidth' 'wiw' minimal number of columns for current window
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index e1053b54f1..1d02e49071 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1554,7 +1554,15 @@ FORTRAN *fortran.vim* *ft-fortran-syntax*
Default highlighting and dialect ~
Highlighting appropriate for Fortran 2008 is used by default. This choice
should be appropriate for most users most of the time because Fortran 2008 is
-almost a superset of previous versions (Fortran 2003, 95, 90, and 77).
+almost a superset of previous versions (Fortran 2003, 95, 90, and 77). A
+small number of features new to Fortran 2018 and Fortran 2023 are supported
+and the complete transition to Fortran 2023 will be completed in the future.
+A few legacy constructs deleted or declared obsolescent in recent Fortran
+standards are highlighted as todo items.
+
+The syntax script no longer supports Fortran dialects. The variable
+fortran_dialect is now silently ignored. Since computers are much faster now,
+the variable fortran_more_precise is no longer needed and is silently ignored.
Fortran source code form ~
Fortran code can be in either fixed or free source form. Note that the
@@ -1563,10 +1571,8 @@ syntax highlighting will not be correct if the form is incorrectly set.
When you create a new fortran file, the syntax script assumes fixed source
form. If you always use free source form, then >
:let fortran_free_source=1
-in your vimrc prior to the :syntax on command. If you always use fixed
-source form, then >
+If you always use fixed source form, then >
:let fortran_fixed_source=1
-in your vimrc prior to the :syntax on command.
If the form of the source code depends, in a non-standard way, upon the file
extension, then it is most convenient to set fortran_free_source in a ftplugin
@@ -1582,14 +1588,33 @@ neither of these variables have been set, the syntax script attempts to
determine which source form has been used by examining the file extension
using conventions common to the ifort, gfortran, Cray, NAG, and PathScale
compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for
-free-source). If none of this works, then the script examines the first five
-columns of the first 500 lines of your file. If no signs of free source form
-are detected, then the file is assumed to be in fixed source form. The
-algorithm should work in the vast majority of cases. In some cases, such as a
-file that begins with 500 or more full-line comments, the script may
-incorrectly decide that the fortran code is in fixed form. If that happens,
-just add a non-comment statement beginning anywhere in the first five columns
-of the first twenty-five lines, save (:w) and then reload (:e!) the file.
+free-source). No default is used for the .fpp and .ftn file extensions because
+different compilers treat them differently. If none of this works, then the
+script examines the first five columns of the first 500 lines of your file. If
+no signs of free source form are detected, then the file is assumed to be in
+fixed source form. The algorithm should work in the vast majority of cases.
+In some cases, such as a file that begins with 500 or more full-line comments,
+the script may incorrectly decide that the code is in fixed form. If that
+happens, just add a non-comment statement beginning anywhere in the first five
+columns of the first twenty-five lines, save (:w), and then reload (:e!) the
+file.
+
+Vendor extensions ~
+Fixed-form Fortran requires a maximum line length of 72 characters but the
+script allows a maximum line length of 80 characters as do all compilers
+created in the last three decades. An even longer line length of 132
+characters is allowed if you set the variable fortran_extended_line_length
+with a command such as >
+ :let fortran_extended_line_length=1
+
+If you want additional highlighting of the CUDA Fortran extensions, you should
+set the variable fortran_CUDA with a command such as >
+ :let fortran_CUDA=1
+
+To activate recognition of some common, non-standard, vendor-supplied
+intrinsics, you should set the variable fortran_vendor_intrinsics with a
+command such as >
+ :let fortran_vendor_intrinsics=1
Tabs in fortran files ~
Tabs are not recognized by the Fortran standards. Tabs are not a good idea in
@@ -1598,8 +1623,8 @@ Therefore, tabs are marked as errors. Nevertheless, some programmers like
using tabs. If your fortran files contain tabs, then you should set the
variable fortran_have_tabs in your vimrc with a command such as >
:let fortran_have_tabs=1
-placed prior to the :syntax on command. Unfortunately, the use of tabs will
-mean that the syntax file will not be able to detect incorrect margins.
+Unfortunately, the use of tabs will mean that the syntax file will not be able
+to detect incorrect margins.
Syntax folding of fortran files ~
If you wish to use foldmethod=syntax, then you must first set the variable
@@ -1611,8 +1636,8 @@ subprograms, block data subprograms, interface blocks, and modules. If you
also set the variable fortran_fold_conditionals with a command such as >
:let fortran_fold_conditionals=1
then fold regions will also be defined for do loops, if blocks, and select
-case constructs. If you also set the variable
-fortran_fold_multilinecomments with a command such as >
+case constructs. If you also set the variable fortran_fold_multilinecomments
+with a command such as >
:let fortran_fold_multilinecomments=1
then fold regions will also be defined for three or more consecutive comment
lines. Note that defining fold regions can be slow for large files.
@@ -1623,58 +1648,6 @@ you set foldmethod=syntax. Comments or blank lines placed between two program
units are not folded because they are seen as not belonging to any program
unit.
-More precise fortran syntax ~
-If you set the variable fortran_more_precise with a command such as >
- :let fortran_more_precise=1
-then the syntax coloring will be more precise but slower. In particular,
-statement labels used in do, goto and arithmetic if statements will be
-recognized, as will construct names at the end of a do, if, select or forall
-construct.
-
-Non-default fortran dialects ~
-The syntax script supports two Fortran dialects: f08 and F. You will probably
-find the default highlighting (f08) satisfactory. A few legacy constructs
-deleted or declared obsolescent in the 2008 standard are highlighted as todo
-items.
-
-If you use F, the advantage of setting the dialect appropriately is that
-other legacy features excluded from F will be highlighted as todo items and
-that free source form will be assumed.
-
-The dialect can be selected in various ways. If all your fortran files use
-the same dialect, set the global variable fortran_dialect in your vimrc prior
-to your syntax on statement. The case-sensitive, permissible values of
-fortran_dialect are "f08" or "F". Invalid values of fortran_dialect are
-ignored.
-
-If the dialect depends upon the file extension, then it is most convenient to
-set a buffer-local variable in a ftplugin file. For more information on
-ftplugin files, see |ftplugin|. For example, if all your fortran files with
-an .f90 extension are written in the F subset, your ftplugin file should
-contain the code >
- let s:extfname = expand("%:e")
- if s:extfname ==? "f90"
- let b:fortran_dialect="F"
- else
- unlet! b:fortran_dialect
- endif
-Note that this will work only if the "filetype plugin indent on" command
-precedes the "syntax on" command in your vimrc file.
-
-Finer control is necessary if the file extension does not uniquely identify
-the dialect. You can override the default dialect, on a file-by-file basis,
-by including a comment with the directive "fortran_dialect=xx" (where xx=F or
-f08) in one of the first three lines in your file. For example, your older .f
-files may be legacy code but your newer ones may be F codes, and you would
-identify the latter by including in the first three lines of those files a
-Fortran comment of the form >
- ! fortran_dialect=F
-
-For previous versions of the syntax, you may have set fortran_dialect to the
-now-obsolete values "f77", "f90", "f95", or "elf". Such settings will be
-silently handled as "f08". Users of "elf" may wish to experiment with "F"
-instead.
-
The syntax/fortran.vim script contains embedded comments that tell you how to
comment and/or uncomment some lines to (a) activate recognition of some
non-standard, vendor-supplied intrinsics and (b) to prevent features deleted
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index f6dfe3b14a..220505f573 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -75,6 +75,8 @@ Defaults *nvim-defaults*
- 'switchbuf' defaults to "uselast"
- 'tabpagemax' defaults to 50
- 'tags' defaults to "./tags;,tags"
+- 'termguicolors' is enabled by default if Nvim can detect support from the
+ host terminal
- 'ttimeoutlen' defaults to 50
- 'ttyfast' is always set
- 'undodir' defaults to ~/.local/state/nvim/undo// (|xdg|), auto-created
diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim
index 8f5b243b82..a057db9a4b 100644
--- a/runtime/ftplugin/fortran.vim
+++ b/runtime/ftplugin/fortran.vim
@@ -1,7 +1,8 @@
" Vim settings file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
-" Version: (v53) 2021 April 06 (updated 2022 May 22)
-" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
+" Version: (v54) 2023 December 5
+" Maintainers: Ajit J. Thakkar <ajit@unb.ca>; <https://ajit.ext.unb.ca/>
+" Joshua Hollett <j.hollett@uwinnipeg.ca>
" Usage: For instructions, do :help fortran-plugin from Vim
" Credits:
" Version 0.1 was created in September 2000 by Ajit Thakkar.
@@ -39,7 +40,7 @@ if !exists("b:fortran_fixed_source")
" Fixed-form file extension defaults
let b:fortran_fixed_source = 1
else
- " Modern fortran still allows both fixed and free source form
+ " Modern fortran compilers still allow both fixed and free source form
" Assume fixed source form unless signs of free source form
" are detected in the first five columns of the first s:lmax lines.
" Detection becomes more accurate and time-consuming if more lines
@@ -70,14 +71,14 @@ if (b:fortran_fixed_source == 1)
" but some vendor extensions allow longer lines
if exists("fortran_extended_line_length")
setlocal tw=132
- elseif exists("fortran_cardimage_line_length")
- setlocal tw=80
else
- setlocal tw=72
+ " The use of columns 73-80 for sequence numbers is obsolete
+ " so almost all compilers allow a textwidth of 80
+ setlocal tw=80
" If you need to add "&" on continued lines so that the code is
" compatible with both free and fixed format, then you should do so
- " in column 73 and uncomment the next line
- " setlocal tw=73
+ " in column 81 and uncomment the next line
+ " setlocal tw=81
endif
else
setlocal comments=:!
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
index 9623014818..7130658f59 100644
--- a/runtime/indent/fortran.vim
+++ b/runtime/indent/fortran.vim
@@ -1,7 +1,8 @@
" Vim indent file
-" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
-" Version: (v49) 2022 May 14
-" Maintainer: Ajit J. Thakkar <thakkar.ajit@gmail.com>; <http://www2.unb.ca/~ajit/>
+" Language: Fortran 2008 (and Fortran 2003, 95, 90, and 77)
+" Version: (v49) 2023 December 1
+" Maintainers: Ajit J. Thakkar <ajit@unb.ca>; <https://ajit.ext.unb.ca/>
+" Joshua Hollett <j.hollett@uwinnipeg.ca>
" Usage: For instructions, do :help fortran-indent from Vim
" Credits:
" Version 0.1 was created in September 2000 by Ajit Thakkar.
diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua
index c3bb36fc36..b73681be04 100644
--- a/runtime/lua/vim/_defaults.lua
+++ b/runtime/lua/vim/_defaults.lua
@@ -165,91 +165,92 @@ do
})
end
---- Guess value of 'background' based on terminal color.
----
---- We write Operating System Command (OSC) 11 to the terminal to request the
---- terminal's background color. We then wait for a response. If the response
---- matches `rgba:RRRR/GGGG/BBBB/AAAA` where R, G, B, and A are hex digits, then
---- compute the luminance[1] of the RGB color and classify it as light/dark
---- accordingly. Note that the color components may have anywhere from one to
---- four hex digits, and require scaling accordingly as values out of 4, 8, 12,
---- or 16 bits. Also note the A(lpha) component is optional, and is parsed but
---- ignored in the calculations.
----
---- [1] https://en.wikipedia.org/wiki/Luma_%28video%29
-do
- --- Parse a string of hex characters as a color.
- ---
- --- The string can contain 1 to 4 hex characters. The returned value is
- --- between 0.0 and 1.0 (inclusive) representing the intensity of the color.
- ---
- --- For instance, if only a single hex char "a" is used, then this function
- --- returns 0.625 (10 / 16), while a value of "aa" would return 0.664 (170 /
- --- 256).
- ---
- --- @param c string Color as a string of hex chars
- --- @return number? Intensity of the color
- local function parsecolor(c)
- if #c == 0 or #c > 4 then
- return nil
- end
-
- local val = tonumber(c, 16)
- if not val then
- return nil
- end
-
- local max = tonumber(string.rep('f', #c), 16)
- return val / max
+-- Only do the following when the TUI is attached
+local tty = nil
+for _, ui in ipairs(vim.api.nvim_list_uis()) do
+ if ui.chan == 1 and ui.stdout_tty then
+ tty = ui
+ break
end
+end
- --- Parse an OSC 11 response
- ---
- --- Either of the two formats below are accepted:
- ---
- --- OSC 11 ; rgb:<red>/<green>/<blue>
- ---
- --- or
- ---
- --- OSC 11 ; rgba:<red>/<green>/<blue>/<alpha>
+if tty then
+ --- Guess value of 'background' based on terminal color.
---
- --- where
+ --- We write Operating System Command (OSC) 11 to the terminal to request the
+ --- terminal's background color. We then wait for a response. If the response
+ --- matches `rgba:RRRR/GGGG/BBBB/AAAA` where R, G, B, and A are hex digits, then
+ --- compute the luminance[1] of the RGB color and classify it as light/dark
+ --- accordingly. Note that the color components may have anywhere from one to
+ --- four hex digits, and require scaling accordingly as values out of 4, 8, 12,
+ --- or 16 bits. Also note the A(lpha) component is optional, and is parsed but
+ --- ignored in the calculations.
---
- --- <red>, <green>, <blue>, <alpha> := h | hh | hhh | hhhh
- ---
- --- The alpha component is ignored, if present.
- ---
- --- @param resp string OSC 11 response
- --- @return string? Red component
- --- @return string? Green component
- --- @return string? Blue component
- local function parseosc11(resp)
- local r, g, b
- r, g, b = resp:match('^\027%]11;rgb:(%x+)/(%x+)/(%x+)$')
- if not r and not g and not b then
- local a
- r, g, b, a = resp:match('^\027%]11;rgba:(%x+)/(%x+)/(%x+)/(%x+)$')
- if not a or #a > 4 then
- return nil, nil, nil
+ --- [1] https://en.wikipedia.org/wiki/Luma_%28video%29
+ do
+ --- Parse a string of hex characters as a color.
+ ---
+ --- The string can contain 1 to 4 hex characters. The returned value is
+ --- between 0.0 and 1.0 (inclusive) representing the intensity of the color.
+ ---
+ --- For instance, if only a single hex char "a" is used, then this function
+ --- returns 0.625 (10 / 16), while a value of "aa" would return 0.664 (170 /
+ --- 256).
+ ---
+ --- @param c string Color as a string of hex chars
+ --- @return number? Intensity of the color
+ local function parsecolor(c)
+ if #c == 0 or #c > 4 then
+ return nil
end
- end
- if r and g and b and #r <= 4 and #g <= 4 and #b <= 4 then
- return r, g, b
+ local val = tonumber(c, 16)
+ if not val then
+ return nil
+ end
+
+ local max = tonumber(string.rep('f', #c), 16)
+ return val / max
end
- return nil, nil, nil
- end
+ --- Parse an OSC 11 response
+ ---
+ --- Either of the two formats below are accepted:
+ ---
+ --- OSC 11 ; rgb:<red>/<green>/<blue>
+ ---
+ --- or
+ ---
+ --- OSC 11 ; rgba:<red>/<green>/<blue>/<alpha>
+ ---
+ --- where
+ ---
+ --- <red>, <green>, <blue>, <alpha> := h | hh | hhh | hhhh
+ ---
+ --- The alpha component is ignored, if present.
+ ---
+ --- @param resp string OSC 11 response
+ --- @return string? Red component
+ --- @return string? Green component
+ --- @return string? Blue component
+ local function parseosc11(resp)
+ local r, g, b
+ r, g, b = resp:match('^\027%]11;rgb:(%x+)/(%x+)/(%x+)$')
+ if not r and not g and not b then
+ local a
+ r, g, b, a = resp:match('^\027%]11;rgba:(%x+)/(%x+)/(%x+)/(%x+)$')
+ if not a or #a > 4 then
+ return nil, nil, nil
+ end
+ end
+
+ if r and g and b and #r <= 4 and #g <= 4 and #b <= 4 then
+ return r, g, b
+ end
- local tty = false
- for _, ui in ipairs(vim.api.nvim_list_uis()) do
- if ui.chan == 1 and ui.stdout_tty then
- tty = true
- break
+ return nil, nil, nil
end
- end
- if tty then
local timer = assert(vim.uv.new_timer())
---@param bg string New value of the 'background' option
@@ -300,7 +301,7 @@ do
io.stdout:write('\027]11;?\007')
timer:start(1000, 0, function()
- -- No response received. Delete the autocommand
+ -- Delete the autocommand if no response was received
vim.schedule(function()
-- Suppress error if autocommand has already been deleted
pcall(vim.api.nvim_del_autocmd, id)
@@ -311,4 +312,108 @@ do
end
end)
end
+
+ --- If the TUI (term_has_truecolor) was able to determine that the host
+ --- terminal supports truecolor, enable 'termguicolors'. Otherwise, query the
+ --- terminal (using both XTGETTCAP and SGR + DECRQSS). If the terminal's
+ --- response indicates that it does support truecolor enable 'termguicolors',
+ --- but only if the user has not already disabled it.
+ do
+ if tty.rgb then
+ -- The TUI was able to determine truecolor support
+ vim.o.termguicolors = true
+ else
+ --- Enable 'termguicolors', but only if it was not already set by the user.
+ local function settgc()
+ if not vim.api.nvim_get_option_info2('termguicolors', {}).was_set then
+ vim.o.termguicolors = true
+ end
+ end
+
+ local caps = {} ---@type table<string, boolean>
+ require('vim.termcap').query({ 'Tc', 'RGB', 'setrgbf', 'setrgbb' }, function(cap, found)
+ if not found then
+ return
+ end
+
+ caps[cap] = true
+ if caps.Tc or caps.RGB or (caps.setrgbf and caps.setrgbb) then
+ settgc()
+ end
+ end)
+
+ local timer = assert(vim.uv.new_timer())
+
+ -- Arbitrary colors to set in the SGR sequence
+ local r = 1
+ local g = 2
+ local b = 3
+
+ local id = vim.api.nvim_create_autocmd('TermResponse', {
+ nested = true,
+ callback = function(args)
+ local resp = args.data ---@type string
+ local decrqss = resp:match('^\027P1%$r([%d;:]+)m$')
+
+ if decrqss then
+ -- The DECRQSS SGR response first contains attributes separated by
+ -- semicolons, followed by the SGR itself with parameters separated
+ -- by colons. Some terminals include "0" in the attribute list
+ -- unconditionally; others do not. Our SGR sequence did not set any
+ -- attributes, so there should be no attributes in the list.
+ local attrs = vim.split(decrqss, ';')
+ if #attrs ~= 1 and (#attrs ~= 2 or attrs[1] ~= '0') then
+ return true
+ end
+
+ -- The returned SGR sequence should begin with 48:2
+ local sgr = attrs[#attrs]:match('^48:2:([%d:]+)$')
+ if not sgr then
+ return true
+ end
+
+ -- The remaining elements of the SGR sequence should be the 3 colors
+ -- we set. Some terminals also include an additional parameter
+ -- (which can even be empty!), so handle those cases as well
+ local params = vim.split(sgr, ':')
+ if #params ~= 3 and (#params ~= 4 or (params[1] ~= '' and params[1] ~= '1')) then
+ return true
+ end
+
+ if
+ tonumber(params[#params - 2]) == r
+ and tonumber(params[#params - 1]) == g
+ and tonumber(params[#params]) == b
+ then
+ settgc()
+ end
+
+ return true
+ end
+ end,
+ })
+
+ -- Write SGR followed by DECRQSS. This sets the background color then
+ -- immediately asks the terminal what the background color is. If the
+ -- terminal responds to the DECRQSS with the same SGR sequence that we
+ -- sent then the terminal supports truecolor.
+ local decrqss = '\027P$qm\027\\'
+ if os.getenv('TMUX') then
+ decrqss = string.format('\027Ptmux;%s\027\\', decrqss:gsub('\027', '\027\027'))
+ end
+ io.stdout:write(string.format('\027[48;2;%d;%d;%dm%s', r, g, b, decrqss))
+
+ timer:start(1000, 0, function()
+ -- Delete the autocommand if no response was received
+ vim.schedule(function()
+ -- Suppress error if autocommand has already been deleted
+ pcall(vim.api.nvim_del_autocmd, id)
+ end)
+
+ if not timer:is_closing() then
+ timer:close()
+ end
+ end)
+ end
+ end
end
diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index e3b99f6b3d..bb9ed722e2 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -20,6 +20,7 @@ vim.lsp = require('vim.lsp')
vim.re = require('vim.re')
vim.secure = require('vim.secure')
vim.snippet = require('vim.snippet')
+vim.text = require('vim.text')
vim.treesitter = require('vim.treesitter')
vim.ui = require('vim.ui')
vim.version = require('vim.version')
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
index d2bdab4d28..5e65ca6b1b 100644
--- a/runtime/lua/vim/_meta/options.lua
+++ b/runtime/lua/vim/_meta/options.lua
@@ -6941,6 +6941,10 @@ vim.go.tbidi = vim.go.termbidi
--- attributes instead of "cterm" attributes. `guifg`
--- Requires an ISO-8613-3 compatible terminal.
---
+--- Nvim will automatically attempt to determine if the host terminal
+--- supports 24-bit color and will enable this option if it does
+--- (unless explicitly disabled by the user).
+---
--- @type boolean
vim.o.termguicolors = false
vim.o.tgc = vim.o.termguicolors
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index 05e5b2b871..7234b813b6 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -4678,8 +4678,7 @@ function vim.fn.join(list, sep) end
--- Vim value. In the following cases it will output
--- |msgpack-special-dict|:
--- 1. Dictionary contains duplicate key.
---- 2. Dictionary contains empty key.
---- 3. String contains NUL byte. Two special dictionaries: for
+--- 2. String contains NUL byte. Two special dictionaries: for
--- dictionary and for string will be emitted in case string
--- with NUL byte was a dictionary key.
---
@@ -5922,7 +5921,6 @@ function vim.fn.msgpackdump(list, type) end
--- are binary strings).
--- 2. String with NUL byte inside.
--- 3. Duplicate key.
---- 4. Empty key.
--- ext |List| with two values: first is a signed integer
--- representing extension type. Second is
--- |readfile()|-style list of strings.
diff --git a/runtime/lua/vim/iter.lua b/runtime/lua/vim/iter.lua
index 874bdfb437..e9c2b66bf2 100644
--- a/runtime/lua/vim/iter.lua
+++ b/runtime/lua/vim/iter.lua
@@ -356,6 +356,18 @@ function ListIter.totable(self)
return self._table
end
+--- Collect the iterator into a delimited string.
+---
+--- Each element in the iterator is joined into a string separated by {delim}.
+---
+--- Consumes the iterator.
+---
+--- @param delim string Delimiter
+--- @return string
+function Iter.join(self, delim)
+ return table.concat(self:totable(), delim)
+end
+
--- Folds ("reduces") an iterator into a single value.
---
--- Examples:
diff --git a/runtime/lua/vim/lsp/_meta/protocol.lua b/runtime/lua/vim/lsp/_meta/protocol.lua
index 72b0f00f65..979dad84fd 100644
--- a/runtime/lua/vim/lsp/_meta/protocol.lua
+++ b/runtime/lua/vim/lsp/_meta/protocol.lua
@@ -1,7 +1,7 @@
--[[
This file is autogenerated from scripts/gen_lsp.lua
Regenerate:
-nvim -l scripts/gen_lsp.lua gen --version 3.18 --runtime/lua/vim/lsp/_meta/protocol.lua
+nvim -l scripts/gen_lsp.lua gen --version 3.18 --out runtime/lua/vim/lsp/_meta/protocol.lua
--]]
---@meta
diff --git a/runtime/lua/vim/snippet.lua b/runtime/lua/vim/snippet.lua
index 32a8ea0b0d..ac25fb6a2d 100644
--- a/runtime/lua/vim/snippet.lua
+++ b/runtime/lua/vim/snippet.lua
@@ -42,9 +42,7 @@ local function resolve_variable(var, default)
elseif var == 'TM_FILENAME' then
return expand_or_default('%:t')
elseif var == 'TM_FILENAME_BASE' then
- -- Not using '%:t:r' since we want to remove all extensions.
- local filename_base = expand_or_default('%:t'):gsub('%.[^%.]*$', '')
- return filename_base
+ return expand_or_default('%:t:r')
elseif var == 'TM_DIRECTORY' then
return expand_or_default('%:p:h:t')
elseif var == 'TM_FILEPATH' then
diff --git a/runtime/lua/vim/termcap.lua b/runtime/lua/vim/termcap.lua
index 862cc52149..b88d9ac9ba 100644
--- a/runtime/lua/vim/termcap.lua
+++ b/runtime/lua/vim/termcap.lua
@@ -12,7 +12,10 @@ local M = {}
--- emulator supports the XTGETTCAP sequence.
---
--- @param caps string|table A terminal capability or list of capabilities to query
---- @param cb function(cap:string, seq:string) Function to call when a response is received
+--- @param cb function(cap:string, found:bool, seq:string?) Callback function which is called for
+--- each capability in {caps}. {found} is set to true if the capability was found or false
+--- otherwise. {seq} is the control sequence for the capability if found, or nil for
+--- boolean capabilities.
function M.query(caps, cb)
vim.validate({
caps = { caps, { 'string', 'table' } },
@@ -23,21 +26,33 @@ function M.query(caps, cb)
caps = { caps }
end
- local count = #caps
+ local pending = {} ---@type table<string, boolean>
+ for _, v in ipairs(caps) do
+ pending[v] = true
+ end
+
+ local timer = assert(vim.uv.new_timer())
- vim.api.nvim_create_autocmd('TermResponse', {
+ local id = vim.api.nvim_create_autocmd('TermResponse', {
callback = function(args)
local resp = args.data ---@type string
- local k, v = resp:match('^\027P1%+r(%x+)=(%x+)$')
- if k and v then
+ local k, rest = resp:match('^\027P1%+r(%x+)(.*)$')
+ if k and rest then
local cap = vim.text.hexdecode(k)
- local seq =
- vim.text.hexdecode(v):gsub('\\E', '\027'):gsub('%%p%d', ''):gsub('\\(%d+)', string.char)
+ local seq ---@type string?
+ if rest:match('^=%x+$') then
+ seq = vim.text
+ .hexdecode(rest:sub(2))
+ :gsub('\\E', '\027')
+ :gsub('%%p%d', '')
+ :gsub('\\(%d+)', string.char)
+ end
+
+ cb(cap, true, seq)
- cb(cap, seq)
+ pending[cap] = nil
- count = count - 1
- if count == 0 then
+ if next(pending) == nil then
return true
end
end
@@ -57,6 +72,23 @@ function M.query(caps, cb)
end
io.stdout:write(query)
+
+ timer:start(1000, 0, function()
+ -- Delete the autocommand if no response was received
+ vim.schedule(function()
+ -- Suppress error if autocommand has already been deleted
+ pcall(vim.api.nvim_del_autocmd, id)
+
+ -- Call the callback for all capabilities that were not found
+ for k in pairs(pending) do
+ cb(k, false, nil)
+ end
+ end)
+
+ if not timer:is_closing() then
+ timer:close()
+ end
+ end)
end
return M
diff --git a/runtime/lua/vim/treesitter/_fold.lua b/runtime/lua/vim/treesitter/_fold.lua
index 5c1cc06908..735627d29f 100644
--- a/runtime/lua/vim/treesitter/_fold.lua
+++ b/runtime/lua/vim/treesitter/_fold.lua
@@ -5,35 +5,20 @@ local Range = require('vim.treesitter._range')
local api = vim.api
---@class TS.FoldInfo
----@field levels table<integer,string>
----@field levels0 table<integer,integer>
----@field private start_counts table<integer,integer>
----@field private stop_counts table<integer,integer>
+---@field levels string[] the foldexpr result for each line
+---@field levels0 integer[] the raw fold levels
+---@field edits? {[1]: integer, [2]: integer} line range edited since the last invocation of the callback scheduled in on_bytes. 0-indexed, end-exclusive.
local FoldInfo = {}
FoldInfo.__index = FoldInfo
---@private
function FoldInfo.new()
return setmetatable({
- start_counts = {},
- stop_counts = {},
levels0 = {},
levels = {},
}, FoldInfo)
end
----@package
----@param srow integer
----@param erow integer
-function FoldInfo:invalidate_range(srow, erow)
- for i = srow, erow do
- self.start_counts[i + 1] = nil
- self.stop_counts[i + 1] = nil
- self.levels0[i + 1] = nil
- self.levels[i + 1] = nil
- end
-end
-
--- Efficiently remove items from middle of a list a list.
---
--- Calling table.remove() in a loop will re-index the tail of the table on
@@ -55,12 +40,10 @@ end
---@package
---@param srow integer
----@param erow integer
+---@param erow integer 0-indexed, exclusive
function FoldInfo:remove_range(srow, erow)
list_remove(self.levels, srow + 1, erow)
list_remove(self.levels0, srow + 1, erow)
- list_remove(self.start_counts, srow + 1, erow)
- list_remove(self.stop_counts, srow + 1, erow)
end
--- Efficiently insert items into the middle of a list.
@@ -91,46 +74,37 @@ end
---@package
---@param srow integer
----@param erow integer
+---@param erow integer 0-indexed, exclusive
function FoldInfo:add_range(srow, erow)
- list_insert(self.levels, srow + 1, erow, '-1')
+ list_insert(self.levels, srow + 1, erow, '=')
list_insert(self.levels0, srow + 1, erow, -1)
- list_insert(self.start_counts, srow + 1, erow, nil)
- list_insert(self.stop_counts, srow + 1, erow, nil)
end
---@package
----@param lnum integer
-function FoldInfo:add_start(lnum)
- self.start_counts[lnum] = (self.start_counts[lnum] or 0) + 1
-end
-
----@package
----@param lnum integer
-function FoldInfo:add_stop(lnum)
- self.stop_counts[lnum] = (self.stop_counts[lnum] or 0) + 1
-end
-
----@package
----@param lnum integer
----@return integer
-function FoldInfo:get_start(lnum)
- return self.start_counts[lnum] or 0
+---@param srow integer
+---@param erow_old integer
+---@param erow_new integer 0-indexed, exclusive
+function FoldInfo:edit_range(srow, erow_old, erow_new)
+ if self.edits then
+ self.edits[1] = math.min(srow, self.edits[1])
+ if erow_old <= self.edits[2] then
+ self.edits[2] = self.edits[2] + (erow_new - erow_old)
+ end
+ self.edits[2] = math.max(self.edits[2], erow_new)
+ else
+ self.edits = { srow, erow_new }
+ end
end
---@package
----@param lnum integer
----@return integer
-function FoldInfo:get_stop(lnum)
- return self.stop_counts[lnum] or 0
-end
-
-local function trim_level(level)
- local max_fold_level = vim.wo.foldnestmax
- if level > max_fold_level then
- return max_fold_level
+---@return integer? srow
+---@return integer? erow 0-indexed, exclusive
+function FoldInfo:flush_edit()
+ if self.edits then
+ local srow, erow = self.edits[1], self.edits[2]
+ self.edits = nil
+ return srow, erow
end
- return level
end
--- If a parser doesn't have any ranges explicitly set, treesitter will
@@ -140,10 +114,10 @@ end
--- TODO(lewis6991): Handle this generally
---
--- @param bufnr integer
---- @param erow integer?
+--- @param erow integer? 0-indexed, exclusive
--- @return integer
local function normalise_erow(bufnr, erow)
- local max_erow = api.nvim_buf_line_count(bufnr) - 1
+ local max_erow = api.nvim_buf_line_count(bufnr)
return math.min(erow or max_erow, max_erow)
end
@@ -152,31 +126,30 @@ end
---@param bufnr integer
---@param info TS.FoldInfo
---@param srow integer?
----@param erow integer?
+---@param erow integer? 0-indexed, exclusive
---@param parse_injections? boolean
local function get_folds_levels(bufnr, info, srow, erow, parse_injections)
srow = srow or 0
erow = normalise_erow(bufnr, erow)
- info:invalidate_range(srow, erow)
-
- local prev_start = -1
- local prev_stop = -1
-
local parser = ts.get_parser(bufnr)
parser:parse(parse_injections and { srow, erow } or nil)
+ local enter_counts = {} ---@type table<integer, integer>
+ local leave_counts = {} ---@type table<integer, integer>
+ local prev_start = -1
+ local prev_stop = -1
+
parser:for_each_tree(function(tree, ltree)
local query = ts.query.get(ltree:lang(), 'folds')
if not query then
return
end
- -- erow in query is end-exclusive
- local q_erow = erow and erow + 1 or -1
-
- for id, node, metadata in query:iter_captures(tree:root(), bufnr, srow, q_erow) do
+ -- Collect folds starting from srow - 1, because we should first subtract the folds that end at
+ -- srow - 1 from the level of srow - 1 to get accurate level of srow.
+ for id, node, metadata in query:iter_captures(tree:root(), bufnr, math.max(srow - 1, 0), erow) do
if query.captures[id] == 'fold' then
local range = ts.get_range(node, bufnr, metadata[id])
local start, _, stop, stop_col = Range.unpack4(range)
@@ -193,8 +166,8 @@ local function get_folds_levels(bufnr, info, srow, erow, parse_injections)
if
fold_length > vim.wo.foldminlines and not (start == prev_start and stop == prev_stop)
then
- info:add_start(start + 1)
- info:add_stop(stop + 1)
+ enter_counts[start + 1] = (enter_counts[start + 1] or 0) + 1
+ leave_counts[stop + 1] = (leave_counts[stop + 1] or 0) + 1
prev_start = start
prev_stop = stop
end
@@ -202,16 +175,15 @@ local function get_folds_levels(bufnr, info, srow, erow, parse_injections)
end
end)
- local current_level = info.levels0[srow] or 0
+ local nestmax = vim.wo.foldnestmax
+ local level0_prev = info.levels0[srow] or 0
+ local leave_prev = leave_counts[srow] or 0
-- We now have the list of fold opening and closing, fill the gaps and mark where fold start
- for lnum = srow + 1, erow + 1 do
- local last_trimmed_level = trim_level(current_level)
- current_level = current_level + info:get_start(lnum)
- info.levels0[lnum] = current_level
-
- local trimmed_level = trim_level(current_level)
- current_level = current_level - info:get_stop(lnum)
+ for lnum = srow + 1, erow do
+ local enter_line = enter_counts[lnum] or 0
+ local leave_line = leave_counts[lnum] or 0
+ local level0 = level0_prev - leave_prev + enter_line
-- Determine if it's the start/end of a fold
-- NB: vim's fold-expr interface does not have a mechanism to indicate that
@@ -219,14 +191,36 @@ local function get_folds_levels(bufnr, info, srow, erow, parse_injections)
-- ( \n ( \n )) \n (( \n ) \n )
-- versus
-- ( \n ( \n ) \n ( \n ) \n )
- -- If it did have such a mechanism, (trimmed_level - last_trimmed_level)
+ -- Both are represented by ['>1', '>2', '2', '>2', '2', '1'], and
+ -- vim interprets as the second case.
+ -- If it did have such a mechanism, (clamped - clamped_prev)
-- would be the correct number of starts to pass on.
+ local adjusted = level0 ---@type integer
local prefix = ''
- if trimmed_level - last_trimmed_level > 0 then
+ if enter_line > 0 then
prefix = '>'
+ if leave_line > 0 then
+ -- If this line ends a fold f1 and starts a fold f2, then move f1's end to the previous line
+ -- so that f2 gets the correct level on this line. This may reduce the size of f1 below
+ -- foldminlines, but we don't handle it for simplicity.
+ adjusted = level0 - leave_line
+ leave_line = 0
+ end
+ end
+
+ -- Clamp at foldnestmax.
+ local clamped = adjusted
+ if adjusted > nestmax then
+ prefix = ''
+ clamped = nestmax
end
- info.levels[lnum] = prefix .. tostring(trimmed_level)
+ -- Record the "real" level, so that it can be used as "base" of later get_folds_levels().
+ info.levels0[lnum] = adjusted
+ info.levels[lnum] = prefix .. tostring(clamped)
+
+ leave_prev = leave_line
+ level0_prev = adjusted
end
end
@@ -296,8 +290,12 @@ end
local function on_changedtree(bufnr, foldinfo, tree_changes)
schedule_if_loaded(bufnr, function()
for _, change in ipairs(tree_changes) do
- local srow, _, erow = Range.unpack4(change)
- get_folds_levels(bufnr, foldinfo, srow, erow)
+ local srow, _, erow, ecol = Range.unpack4(change)
+ if ecol > 0 then
+ erow = erow + 1
+ end
+ -- Start from `srow - foldminlines`, because this edit may have shrunken the fold below limit.
+ get_folds_levels(bufnr, foldinfo, math.max(srow - vim.wo.foldminlines, 0), erow)
end
if #tree_changes > 0 then
foldupdate(bufnr)
@@ -309,19 +307,46 @@ end
---@param foldinfo TS.FoldInfo
---@param start_row integer
---@param old_row integer
+---@param old_col integer
---@param new_row integer
-local function on_bytes(bufnr, foldinfo, start_row, old_row, new_row)
- local end_row_old = start_row + old_row
- local end_row_new = start_row + new_row
+---@param new_col integer
+local function on_bytes(bufnr, foldinfo, start_row, start_col, old_row, old_col, new_row, new_col)
+ -- extend the end to fully include the range
+ local end_row_old = start_row + old_row + 1
+ local end_row_new = start_row + new_row + 1
if new_row ~= old_row then
+ -- foldexpr can be evaluated before the scheduled callback is invoked. So it may observe the
+ -- outdated levels, which may spuriously open the folds that didn't change. So we should shift
+ -- folds as accurately as possible. For this to be perfectly accurate, we should track the
+ -- actual TSNodes that account for each fold, and compare the node's range with the edited
+ -- range. But for simplicity, we just check whether the start row is completely removed (e.g.,
+ -- `dd`) or shifted (e.g., `o`).
if new_row < old_row then
- foldinfo:remove_range(end_row_new, end_row_old)
+ if start_col == 0 and new_row == 0 and new_col == 0 then
+ foldinfo:remove_range(start_row, start_row + (end_row_old - end_row_new))
+ else
+ foldinfo:remove_range(end_row_new, end_row_old)
+ end
else
- foldinfo:add_range(start_row, end_row_new)
+ if start_col == 0 and old_row == 0 and old_col == 0 then
+ foldinfo:add_range(start_row, start_row + (end_row_new - end_row_old))
+ else
+ foldinfo:add_range(end_row_old, end_row_new)
+ end
end
+ foldinfo:edit_range(start_row, end_row_old, end_row_new)
+
+ -- This callback must not use on_bytes arguments, because they can be outdated when the callback
+ -- is invoked. For example, `J` with non-zero count triggers multiple on_bytes before executing
+ -- the scheduled callback. So we should collect the edits.
schedule_if_loaded(bufnr, function()
- get_folds_levels(bufnr, foldinfo, start_row, end_row_new)
+ local srow, erow = foldinfo:flush_edit()
+ if not srow then
+ return
+ end
+ -- Start from `srow - foldminlines`, because this edit may have shrunken the fold below limit.
+ get_folds_levels(bufnr, foldinfo, math.max(srow - vim.wo.foldminlines, 0), erow)
foldupdate(bufnr)
end)
end
@@ -348,8 +373,8 @@ function M.foldexpr(lnum)
on_changedtree(bufnr, foldinfos[bufnr], tree_changes)
end,
- on_bytes = function(_, _, start_row, _, _, old_row, _, _, new_row, _, _)
- on_bytes(bufnr, foldinfos[bufnr], start_row, old_row, new_row)
+ on_bytes = function(_, _, start_row, start_col, _, old_row, old_col, _, new_row, new_col, _)
+ on_bytes(bufnr, foldinfos[bufnr], start_row, start_col, old_row, old_col, new_row, new_col)
end,
on_detach = function()
@@ -361,6 +386,18 @@ function M.foldexpr(lnum)
return foldinfos[bufnr].levels[lnum] or '0'
end
+api.nvim_create_autocmd('OptionSet', {
+ pattern = { 'foldminlines', 'foldnestmax' },
+ desc = 'Refresh treesitter folds',
+ callback = function()
+ for _, bufnr in ipairs(vim.tbl_keys(foldinfos)) do
+ foldinfos[bufnr] = FoldInfo.new()
+ get_folds_levels(bufnr, foldinfos[bufnr])
+ foldupdate(bufnr)
+ end
+ end,
+})
+
---@package
---@return { [1]: string, [2]: string[] }[]|string
function M.foldtext()
diff --git a/runtime/plugin/osc52.lua b/runtime/plugin/osc52.lua
index 374b70066f..7a90518966 100644
--- a/runtime/plugin/osc52.lua
+++ b/runtime/plugin/osc52.lua
@@ -6,7 +6,11 @@ if not tty or vim.g.clipboard ~= nil or vim.o.clipboard ~= '' or not os.getenv('
return
end
-require('vim.termcap').query('Ms', function(cap, seq)
+require('vim.termcap').query('Ms', function(cap, found, seq)
+ if not found then
+ return
+ end
+
assert(cap == 'Ms')
-- Check 'clipboard' and g:clipboard again to avoid a race condition
@@ -16,7 +20,7 @@ require('vim.termcap').query('Ms', function(cap, seq)
-- If the terminal reports a sequence other than OSC 52 for the Ms capability
-- then ignore it. We only support OSC 52 (for now)
- if not seq:match('^\027%]52') then
+ if not seq or not seq:match('^\027%]52') then
return
end
diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim
index 5437580a0a..8daf90a33c 100644
--- a/runtime/syntax/cpp.vim
+++ b/runtime/syntax/cpp.vim
@@ -2,7 +2,7 @@
" Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
-" Last Change: 2021 Aug 23
+" Last Change: 2023 Dec 08
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -15,6 +15,7 @@ let b:filetype_in_cpp_family = 1
" Read the C syntax to start with
runtime! syntax/c.vim
unlet b:current_syntax
+unlet b:filetype_in_cpp_family
" C++ extensions
syn keyword cppStatement new delete this friend using
diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim
index fc6c82b480..971a2b633d 100644
--- a/runtime/syntax/fortran.vim
+++ b/runtime/syntax/fortran.vim
@@ -1,7 +1,8 @@
" Vim syntax file
-" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
-" Version: (v105) 2023 August 14
-" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
+" Language: Fortran 2008 (and Fortran 2003, 95, 90, and 77)
+" Version: (v106) 2023 December 4
+" Maintainers: Ajit J. Thakkar <ajit@unb.ca>; <https://ajit.ext.unb.ca/>
+" Joshua Hollett <j.hollett@uwinnipeg.ca>
" Usage: For instructions, do :help fortran-syntax from Vim
" Credits:
" Version 0.1 for Fortran 95 was created in April 2000 by Ajit Thakkar from an
@@ -11,7 +12,8 @@
" Walter Dieudonne, Alexander Wagner, Roman Bertle, Charles Rendleman,
" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann,
" Stefano Zaghi, Vishnu V. Krishnan, Judicael Grasset, Takuma Yoshida,
-" Eisuke Kawashima, Andre Chalella, Fritz Reese, and Karl D. Hammond.
+" Eisuke Kawashima, Andre Chalella, Fritz Reese, Karl D. Hammond,
+" and Michele Esposito Marzino.
if exists("b:current_syntax")
finish
@@ -20,34 +22,9 @@ endif
let s:cpo_save = &cpo
set cpo&vim
-" Choose fortran_dialect using the priority:
-" source file directive > buffer-local value > global value > file extension
-" first try using directive in first three lines of file
-let b:fortran_retype = getline(1)." ".getline(2)." ".getline(3)
-if b:fortran_retype =~? '\<fortran_dialect\s*=\s*F\>'
- let b:fortran_dialect = "F"
-elseif b:fortran_retype =~? '\<fortran_dialect\s*=\s*f08\>'
- let b:fortran_dialect = "f08"
-elseif !exists("b:fortran_dialect")
- if exists("g:fortran_dialect") && g:fortran_dialect =~# '\<F\|f08\>'
- " try global variable
- let b:fortran_dialect = g:fortran_dialect
- else " nothing found, so use default
- let b:fortran_dialect = "f08"
- endif
-endif
-unlet! b:fortran_retype
-" make sure buffer-local value is not invalid
-if b:fortran_dialect !~# '\<F\|f08\>'
- let b:fortran_dialect = "f08"
-endif
-
" Choose between fixed and free source form if this hasn't been done yet
if !exists("b:fortran_fixed_source")
- if b:fortran_dialect == "F"
- " F requires free source form
- let b:fortran_fixed_source = 0
- elseif exists("fortran_free_source")
+ if exists("fortran_free_source")
" User guarantees free source form for all fortran files
let b:fortran_fixed_source = 0
elseif exists("fortran_fixed_source")
@@ -60,7 +37,7 @@ if !exists("b:fortran_fixed_source")
" Fixed-form file extension defaults
let b:fortran_fixed_source = 1
else
- " Modern fortran still allows both free and fixed source form.
+ " Modern fortran compilers still allow both free and fixed source form.
" Assume fixed source form unless signs of free source form
" are detected in the first five columns of the first s:lmax lines.
" Detection becomes more accurate and time-consuming if more lines
@@ -91,32 +68,29 @@ if b:fortran_fixed_source == 1
else
syn match fortranConstructName "^\s*\zs\a\w*\ze\s*:"
endif
-if exists("fortran_more_precise")
- syn match fortranConstructName "\(\<end\s*do\s\+\)\@11<=\a\w*"
- syn match fortranConstructName "\(\<end\s*if\s\+\)\@11<=\a\w*"
- syn match fortranConstructName "\(\<end\s*select\s\+\)\@15<=\a\w*"
- syn match fortranConstructName "\(\<\%(exit\|cycle\)\s\+\)\@11<=\a\w*"
-endif
+syn match fortranConstructName "\(\<end\s*do\s\+\)\@11<=\a\w*"
+syn match fortranConstructName "\(\<end\s*if\s\+\)\@11<=\a\w*"
+syn match fortranConstructName "\(\<end\s*select\s\+\)\@15<=\a\w*"
+syn match fortranConstructName "\(\<\%(exit\|cycle\)\s\+\)\@11<=\a\w*"
+
+syn match fortranUserUnit "\(\(end\s*\)\?\(subroutine\|function\|module\|program\|submodule\|block\)\s\+\)\@12<=\a\w\+"
-syn match fortranUnitHeader "\<end\>"
syn match fortranType "\<character\((\s*kind\s*=\w\+)\)\?\>"
syn match fortranType "\<complex\((\s*kind\s*=\w\+)\)\?\>"
syn keyword fortranType intrinsic
-syn match fortranType "\<implicit\>\s\+\(none\)\?"
+syn match fortranType "\<implicit\>\s\+\(none\(\s\+\<external\|type\>\)\?\)\?"
syn keyword fortranStructure dimension
syn keyword fortranStorageClass parameter save
-syn match fortranUnitHeader "\<subroutine\>"
-syn keyword fortranCall call
-syn match fortranUnitHeader "\<function\>"
-syn match fortranUnitHeader "\<program\>"
-syn match fortranUnitHeader "\<block\>"
-syn keyword fortranKeyword return stop
+syn match fortranCall "call\s\+\a\w*"
+syn match fortranUnitHeader "\(end\s*\)\?\(subroutine\|function\|module\|program\|submodule\|block\)"
+syn keyword fortranKeyword return
+syn match fortranKeyword "\(error\s\+\)\=stop"
syn keyword fortranConditional else then
syn match fortranConditional "\<if\>"
-syn match fortranConditionalOb "\<if\s*(.*)\s*\d\+\s*,\s*\d\+\s*,\s*\d\+\s*$"
+syn match fortranConditionalDel "\<if\s*(.*)\s*\d\+\s*,\s*\d\+\s*,\s*\d\+\s*$"
syn match fortranRepeat "\<do\>"
-syn keyword fortranTodo contained todo fixme
+syn keyword fortranTodo contained bug note debug todo fixme
"Catch errors caused by too many right parentheses
syn region fortranParen transparent start="(" end=")" contains=ALLBUT,fortranParenError,@fortranCommentGroup,cIncluded,@spell
@@ -141,8 +115,6 @@ endif
syn match fortranIO '\%(\((\|,\|, *&\n\)\s*\)\@<=\(access\|blank\|direct\|exist\|file\|fmt\|form\|formatted\|iostat\|name\|named\|nextrec\|number\|opened\|rec\|recl\|sequential\|status\|unformatted\|unit\)\ze\s*='
-syn keyword fortranIntrinsicR alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl
-
" Intrinsics provided by some vendors
syn keyword fortranExtraIntrinsic algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh
@@ -150,6 +122,11 @@ syn keyword fortranIntrinsic abs acos aimag aint anint asin atan atan2 char cmpl
syn match fortranIntrinsic "\<len\s*[(,]"me=s+3
syn match fortranIntrinsic "\<real\s*("me=s+4
syn match fortranIntrinsic "\<logical\s*("me=s+7
+" F2018 and F2023
+syn keyword fortranIntrinsic out_of_range reduce random_init lcobound ucobound this_image coshape selected_logical_kind
+syn keyword fortranIntrinsic ieee_max ieee_max_mag ieee_min ieee_min_mag split tokenize
+syn keyword fortranIntrinsic acosd asind atand atan2d cosd sind tand acospi asinpi atanpi atan2pi cospi sinpi tanpi
+
syn match fortranType "\<type\>\(\s\+is\>\)\?"
syn match fortranType "^\s*\(type\s\+\(is\)\? \)\?\s*\(real\|integer\|logical\|complex\|character\)\>"
syn match fortranType "^\s*\(implicit \)\?\s*\(real\|integer\|logical\|complex\|character\)\>"
@@ -188,32 +165,28 @@ syn match fortranLabelNumber display "^ \d\{1,3}\s"ms=s+2,me=e-1
syn match fortranLabelNumber display "^ \d\d\=\s"ms=s+3,me=e-1
syn match fortranLabelNumber display "^ \d\s"ms=s+4,me=e-1
-if exists("fortran_more_precise")
- " Numbers as targets
- syn match fortranTarget display "\(\<if\s*(.\+)\s*\)\@<=\(\d\+\s*,\s*\)\{2}\d\+\>"
- syn match fortranTarget display "\(\<do\s\+\)\@11<=\d\+\>"
- syn match fortranTarget display "\(\<go\s*to\s*(\=\)\@11<=\(\d\+\s*,\s*\)*\d\+\>"
-endif
+" Numbers as targets
+syn match fortranTarget display "\(\<if\s*(.\+)\s*\)\@<=\(\d\+\s*,\s*\)\{2}\d\+\>"
+syn match fortranTarget display "\(\<do\s\+\)\@11<=\d\+\>"
+syn match fortranTarget display "\(\<go\s*to\s*(\=\)\@11<=\(\d\+\s*,\s*\)*\d\+\>"
syn keyword fortranTypeR external
syn keyword fortranIOR format
-syn match fortranKeywordR "\<continue\>"
+syn match fortranKeyword "\<continue\>"
syn match fortranKeyword "^\s*\d\+\s\+continue\>"
syn match fortranKeyword "\<go\s*to\>"
syn match fortranKeywordDel "\<go\s*to\ze\s\+.*,\s*(.*$"
syn match fortranKeywordOb "\<go\s*to\ze\s*(\d\+.*$"
-syn region fortranStringR start=+'+ end=+'+ contains=fortranContinueMark,fortranLeftMargin,fortranSerialNumber
-syn keyword fortranIntrinsicR dim lge lgt lle llt mod
+syn region fortranString start=+'+ end=+'+ contains=fortranContinueMark,fortranLeftMargin,fortranSerialNumber
syn keyword fortranKeywordDel assign pause
syn keyword fortranStructure private public intent optional
syn keyword fortranStructure pointer target allocatable
syn keyword fortranStorageClass in out
+syn match fortranStorageClass "\<in\s*out\>"
syn match fortranStorageClass "\<kind\s*="me=s+4
syn match fortranStorageClass "\<len\s*="me=s+3
-syn match fortranUnitHeader "\<module\>"
-syn match fortranUnitHeader "\<submodule\>"
syn keyword fortranUnitHeader use only contains
syn keyword fortranUnitHeader result operator assignment
syn match fortranUnitHeader "\<interface\>"
@@ -223,7 +196,7 @@ syn match fortranConditional "\<case\s\+default\>"
syn keyword fortranConditional where elsewhere
syn match fortranOperator "\(\(>\|<\)=\=\|==\|/=\|=\)"
-syn match fortranOperator "=>"
+syn match fortranOperator "\(%\|?\|=>\)"
syn region fortranString start=+"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber
syn keyword fortranIO pad position action delim readwrite
@@ -233,25 +206,18 @@ syn match fortranIntrinsic '\<\(adjustl\|adjustr\|all\|allocated\|any\|associate
syn match fortranIntrinsic "\<not\>\(\s*\.\)\@!"me=s+3
syn match fortranIntrinsic "\<kind\>\s*[(,]"me=s+4
-syn match fortranUnitHeader "\<end\s*function"
syn match fortranUnitHeader "\<end\s*interface"
-syn match fortranUnitHeader "\<end\s*module"
-syn match fortranUnitHeader "\<end\s*submodule"
-syn match fortranUnitHeader "\<end\s*program"
-syn match fortranUnitHeader "\<end\s*subroutine"
-syn match fortranUnitHeader "\<end\s*block"
syn match fortranRepeat "\<end\s*do"
syn match fortranConditional "\<end\s*where"
syn match fortranConditional "\<select\s*case"
syn match fortranConditional "\<end\s*select"
syn match fortranType "\<end\s*type"
-syn match fortranType "\<in\s*out"
-syn keyword fortranType procedure
-syn match fortranType "\<module\ze\s\+procedure\>"
+syn match fortranType "\(end\s\+\)\?\(\<module\s\+\)\?procedure\>"
syn keyword fortranIOR namelist
syn keyword fortranConditionalR while
-syn keyword fortranIntrinsicR achar iachar transfer
+syn keyword fortranIntrinsicR achar iachar transfer dble dprod dim lge lgt lle llt mod
+syn keyword fortranIntrinsicOb alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl
syn keyword fortranInclude include
syn keyword fortranStorageClassR sequence
@@ -263,63 +229,62 @@ syn match fortranConditional "\<else\s*if"
syn keyword fortranUnitHeaderOb entry
syn match fortranTypeR display "double\s\+precision"
syn match fortranTypeR display "double\s\+complex"
-syn match fortranUnitHeaderR display "block\s\+data"
-syn keyword fortranStorageClassR common equivalence data
-syn keyword fortranIntrinsicR dble dprod
+syn match fortranUnitHeaderOb display "block\s\+data"
+syn match fortranStorageClass "^\s*data\>\(\s\+\a\w*\s*/\)\@="
+syn match fortranStorageClassOb "^\s*common\>\(\s*/\)\@="
+syn keyword fortranStorageClassOb equivalence
syn match fortranOperatorR "\.\s*[gl][et]\s*\."
syn match fortranOperatorR "\.\s*\(eq\|ne\)\s*\."
-syn keyword fortranRepeat forall
-syn match fortranRepeat "\<end\s*forall"
-syn keyword fortranIntrinsic null cpu_time
+syn keyword fortranRepeatOb forall
+syn match fortranRepeatOb "\<end\s*forall"
+syn keyword fortranIntrinsic null cpu_time
syn match fortranType "\<elemental\>"
syn match fortranType "\<pure\>"
syn match fortranType "\<impure\>"
syn match fortranType "\<recursive\>"
-if exists("fortran_more_precise")
- syn match fortranConstructName "\(\<end\s*forall\s\+\)\@15<=\a\w*\>"
-endif
-
-if b:fortran_dialect == "f08"
- " F2003
- syn keyword fortranIntrinsic command_argument_count get_command get_command_argument get_environment_variable is_iostat_end is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of
- " ISO_C_binding
- syn keyword fortranConstant c_null_char c_alert c_backspace c_form_feed c_new_line c_carriage_return c_horizontal_tab c_vertical_tab
- syn keyword fortranConstant c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr
- syn keyword fortranIntrinsic iso_c_binding c_loc c_funloc c_associated c_f_pointer c_f_procpointer
- syn keyword fortranType c_ptr c_funptr
- " ISO_Fortran_env
- syn keyword fortranConstant iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit
- " IEEE_arithmetic
- syn keyword fortranIntrinsic ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode
-
- syn keyword fortranReadWrite flush wait
- syn keyword fortranIO decimal round iomsg
- syn keyword fortranType asynchronous nopass non_overridable pass protected volatile extends import
- syn keyword fortranType non_intrinsic value bind deferred generic final enumerator
- syn match fortranType "\<abstract\>"
- syn match fortranType "\<class\>"
- syn match fortranType "\<associate\>"
- syn match fortranType "\<end\s*associate"
- syn match fortranType "\<enum\s*,\s*bind\s*(\s*c\s*)"
- syn match fortranType "\<end\s*enum"
- syn match fortranConditional "\<select\s*type"
- syn match fortranConditional "\<class\s*is\>"
- syn match fortranConditional "\<class\s*default\>"
- syn match fortranUnitHeader "\<abstract\s*interface\>"
- syn match fortranOperator "\([\|]\)"
-
- " F2008
- syn keyword fortranIntrinsic acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2
- syn keyword fortranIntrinsic atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits
- syn keyword fortranIntrinsic bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image
- syn keyword fortranIO newunit
- syn keyword fortranType contiguous
- syn keyword fortranRepeat concurrent
+syn match fortranConstructNameOb "\(\<end\s*forall\s\+\)\@15<=\a\w*\>"
+
+" F2003
+syn keyword fortranIntrinsic command_argument_count get_command get_command_argument get_environment_variable is_iostat_end is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of
+" ISO_C_binding
+syn keyword fortranConstant c_null_char c_alert c_backspace c_form_feed c_new_line c_carriage_return c_horizontal_tab c_vertical_tab
+syn keyword fortranConstant c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr
+syn keyword fortranIntrinsic iso_c_binding c_loc c_funloc c_associated c_f_pointer c_f_procpointer
+syn keyword fortranType c_ptr c_funptr
+" ISO_Fortran_env
+syn keyword fortranConstant iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit
+" IEEE_arithmetic
+syn keyword fortranIntrinsic ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode
+
+syn keyword fortranReadWrite flush wait
+syn keyword fortranIO decimal round iomsg
+syn keyword fortranType asynchronous nopass non_overridable pass protected volatile extends import
+syn keyword fortranType non_intrinsic value bind deferred generic final enumerator
+syn match fortranType "\<abstract\>"
+syn match fortranType "\<class\>"
+syn match fortranType "\<associate\>"
+syn match fortranType "\<end\s*associate"
+syn match fortranType "\<enum\s*,\s*bind\s*(\s*c\s*)"
+syn match fortranType "\<end\s*enum"
+syn match fortranConditional "\<select\s*type"
+syn match fortranConditional "\<class\s*is\>"
+syn match fortranConditional "\<class\s*default\>"
+syn match fortranUnitHeader "\<abstract\s*interface\>"
+syn match fortranOperator "\([\|]\)"
+
+" F2008
+syn keyword fortranIntrinsic acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2
+syn keyword fortranIntrinsic atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits
+syn keyword fortranIntrinsic bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image
+syn keyword fortranIO newunit
+syn keyword fortranType contiguous
+syn keyword fortranRepeat concurrent
" CUDA fortran
+if exists("fortran_CUDA")
syn match fortranTypeCUDA "\<attributes\>"
- syn keyword fortranTypeCUDA host global device value
+ syn keyword fortranTypeCUDA host global device
syn keyword fortranTypeCUDA shared constant pinned texture
syn keyword fortranTypeCUDA dim1 dim2 dim3 dim4
syn keyword fortranTypeCUDA cudadeviceprop cuda_count_kind cuda_stream_kind
@@ -349,10 +314,10 @@ if b:fortran_dialect == "f08"
syn keyword fortranIntrinsicCUDA cudaHostAlloc cudaHostGetDevicePointer cudaHostGetFlags cudaHostRegister cudaHostUnregister cudaMalloc cudaMallocArray cudaMallocHost cudaMallocPitch cudaMalloc3D cudaMalloc3DArray
syn keyword fortranIntrinsicCUDA cudaMemcpy cudaMemcpyArraytoArray cudaMemcpyAsync cudaMemcpyFromArray cudaMemcpyFromSymbol cudaMemcpyFromSymbolAsync cudaMemcpyPeer cudaMemcpyPeerAsync cudaMemcpyToArray cudaMemcpyToSymbol cudaMemcpyToSymbolAsync cudaMemcpy2D cudaMemcpy2DArrayToArray cudaMemcpy2DAsync cudaMemcpy2DFromArray cudaMemcpy2DToArray cudaMemcpy3D cudaMemcpy3DAsync
syn keyword fortranIntrinsicCUDA cudaMemGetInfo cudaMemset cudaMemset2D cudaMemset3D cudaDeviceCanAccessPeer cudaDeviceDisablePeerAccess cudaDeviceEnablePeerAccess cudaPointerGetAttributes cudaDriverGetVersion cudaRuntimeGetVersion
-
- syn region none matchgroup=fortranType start="<<<" end=">>>" contains=ALLBUT,none
endif
+syn region none matchgroup=fortranType start="<<<" end=">>>" contains=ALLBUT,none
+
syn cluster fortranCommentGroup contains=fortranTodo
if (b:fortran_fixed_source == 1)
@@ -391,7 +356,7 @@ syn match cIncluded contained "<[^>]*>"
syn match cInclude "^\s*#\s*include\>\s*["<]" contains=cIncluded
"Synchronising limits assume that comment and continuation lines are not mixed
-if exists("fortran_fold") || exists("fortran_more_precise")
+if exists("fortran_fold")
syn sync fromstart
elseif (b:fortran_fixed_source == 0)
syn sync linecont "&" minlines=30
@@ -447,79 +412,71 @@ if exists("fortran_fold")
endif
" Define the default highlighting.
-" The default highlighting differs for each dialect.
" Transparent groups:
" fortranParen, fortranLeftMargin
" fortranProgram, fortranModule, fortranSubroutine, fortranFunction,
" fortranBlockData
" fortran77Loop, fortran90Loop, fortranIfBlock, fortranCase
" fortranMultiCommentLines
-hi def link fortranKeyword Keyword
+hi def link fortranKeyword Keyword
hi def link fortranConstructName Identifier
-hi def link fortranConditional Conditional
-hi def link fortranRepeat Repeat
-hi def link fortranTodo Todo
-hi def link fortranContinueMark Special
-hi def link fortranString String
-hi def link fortranNumber Number
-hi def link fortranBinary Number
-hi def link fortranOctal Number
-hi def link fortranHex Number
-hi def link fortranOperator Operator
-hi def link fortranBoolean Boolean
-hi def link fortranLabelError Error
-hi def link fortranObsolete Todo
-hi def link fortranType Type
-hi def link fortranStructure Type
-hi def link fortranStorageClass StorageClass
-hi def link fortranCall Function
-hi def link fortranUnitHeader fortranPreCondit
-hi def link fortranReadWrite Keyword
-hi def link fortranIO Keyword
-hi def link fortranIntrinsic Function
-hi def link fortranConstant Constant
-
-" To stop deleted & obsolescent features being highlighted as Todo items,
-" comment out the next 5 lines and uncomment the 5 lines after that
-hi def link fortranUnitHeaderOb fortranObsolete
-hi def link fortranKeywordOb fortranObsolete
-hi def link fortranConditionalOb fortranObsolete
-hi def link fortranTypeOb fortranObsolete
-hi def link fortranKeywordDel fortranObsolete
-"hi def link fortranUnitHeaderOb fortranUnitHeader
-"hi def link fortranKeywordOb fortranKeyword
-"hi def link fortranConditionalOb fortranConditional
-"hi def link fortranTypeOb fortranType
-"hi def link fortranKeywordDel fortranKeyword
-
-if b:fortran_dialect == "F"
- hi! def link fortranIntrinsicR fortranObsolete
- hi! def link fortranUnitHeaderR fortranObsolete
- hi! def link fortranTypeR fortranObsolete
- hi! def link fortranStorageClassR fortranObsolete
- hi! def link fortranOperatorR fortranObsolete
- hi! def link fortranInclude fortranObsolete
- hi! def link fortranLabelNumber fortranObsolete
- hi! def link fortranTarget fortranObsolete
- hi! def link fortranFloatIll fortranObsolete
- hi! def link fortranIOR fortranObsolete
- hi! def link fortranKeywordR fortranObsolete
- hi! def link fortranStringR fortranObsolete
- hi! def link fortranConditionalR fortranObsolete
+hi def link fortranConditional Conditional
+hi def link fortranRepeat Repeat
+hi def link fortranTodo Todo
+hi def link fortranContinueMark Special
+hi def link fortranString String
+hi def link fortranNumber Number
+hi def link fortranBinary Number
+hi def link fortranOctal Number
+hi def link fortranHex Number
+hi def link fortranOperator Operator
+hi def link fortranBoolean Boolean
+hi def link fortranLabelError Error
+hi def link fortranObsolete Todo
+hi def link fortranType Type
+hi def link fortranStructure Type
+
+hi def link fortranStorageClass StorageClass
+hi def link fortranIntrinsic Function
+hi def link fortranCall Function
+hi def link fortranUserUnit Function
+hi def link fortranUnitHeader fortranPreCondit
+hi def link fortranReadWrite Keyword
+hi def link fortranIO Keyword
+hi def link fortranConstant Constant
+
+hi def link fortranInclude Include
+hi def link fortranLabelNumber Special
+hi def link fortranTarget Special
+hi def link fortranFloatIll fortranFloat
+
+" Redundant features which may one day become obsolescent
+hi def link fortranIntrinsicR fortranIntrinsic
+hi def link fortranTypeR fortranType
+hi def link fortranStorageClassR fortranStorageClass
+hi def link fortranOperatorR fortranOperator
+hi def link fortranIOR fortranIO
+hi def link fortranConditionalR fortranConditional
+
+" features deleted or declared obsolescent in Fortran 2023
+if (b:fortran_fixed_source == 1)
+ hi def link fortranUnitHeaderOb fortranUnitHeader
+ hi def link fortranKeywordOb fortranKeyword
+ hi def link fortranKeywordDel fortranKeyword
+ hi def link fortranConditionalDel fortranConditional
+ hi def link fortranTypeOb fortranType
+ hi def link fortranStorageClassOb fortranStorageClass
+ hi def link fortranRepeatOb fortranRepeat
+ hi def link fortranIntrinsicOb fortranIntrinsic
else
- hi! def link fortranIntrinsicR fortranIntrinsic
- hi! def link fortranUnitHeaderR fortranPreCondit
- hi! def link fortranTypeR fortranType
- hi! def link fortranStorageClassR fortranStorageClass
- hi! def link fortranOperatorR fortranOperator
- hi! def link fortranInclude Include
- hi! def link fortranLabelNumber Special
- hi! def link fortranTarget Special
- hi! def link fortranFloatIll fortranFloat
- hi! def link fortranIOR fortranIO
- hi! def link fortranKeywordR fortranKeyword
- hi! def link fortranStringR fortranString
- hi! def link fortranConditionalR fortranConditional
+ hi def link fortranUnitHeaderOb fortranObsolete
+ hi def link fortranKeywordOb fortranObsolete
+ hi def link fortranKeywordDel fortranObsolete
+ hi def link fortranConditionalDel fortranObsolete
+ hi def link fortranTypeOb fortranObsolete
+ hi def link fortranStorageClassOb fortranObsolete
+ hi def link fortranRepeatOb fortranObsolete
+ hi def link fortranIntrinsicOb fortranObsolete
endif
hi def link fortranFormatSpec Identifier
diff --git a/runtime/syntax/squirrel.vim b/runtime/syntax/squirrel.vim
index 81d59cc986..85bdd87d9e 100644
--- a/runtime/syntax/squirrel.vim
+++ b/runtime/syntax/squirrel.vim
@@ -2,7 +2,7 @@
" Language: squirrel
" Current Maintainer: Matt Dunford (zenmatic@gmail.com)
" URL: https://github.com/zenmatic/vim-syntax-squirrel
-" Last Change: 2021 Nov 28
+" Last Change: 2023 Dec 08
" http://squirrel-lang.org/
@@ -17,6 +17,7 @@ let b:filetype_in_cpp_family = 1
" Read the C syntax to start with
runtime! syntax/c.vim
unlet b:current_syntax
+unlet b:filetype_in_cpp_family
" squirrel extensions
syn keyword squirrelStatement delete this in yield resume base clone
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index fcd50bccd2..b7ecd917ed 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -200,7 +200,7 @@ syn keyword vimAugroupKey contained aug[roup]
" Operators: {{{2
" =========
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment,vimVar
-syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile
+syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup
diff --git a/scripts/gen_lsp.lua b/scripts/gen_lsp.lua
index 6ff8dcb3f4..9fbcc1c15e 100644
--- a/scripts/gen_lsp.lua
+++ b/scripts/gen_lsp.lua
@@ -1,11 +1,15 @@
---[[
-Generates lua-ls annotations for lsp
+-- Generates lua-ls annotations for lsp.
+
+local USAGE = [[
+Generates lua-ls annotations for lsp.
+
USAGE:
-nvim -l scripts/gen_lsp.lua gen # this will overwrite runtime/lua/vim/lsp/_meta/protocol.lua
-nvim -l scripts/gen_lsp.lua gen --version 3.18 --build/new_lsp_types.lua
+nvim -l scripts/gen_lsp.lua gen # by default, this will overwrite runtime/lua/vim/lsp/_meta/protocol.lua
nvim -l scripts/gen_lsp.lua gen --version 3.18 --out runtime/lua/vim/lsp/_meta/protocol.lua
nvim -l scripts/gen_lsp.lua gen --version 3.18 --methods
---]]
+]]
+
+local DEFAULT_LSP_VERSION = '3.18'
local M = {}
@@ -14,15 +18,18 @@ local function tofile(fname, text)
if not f then
error(('failed to write: %s'):format(f))
else
+ print(('Written to: %s'):format(fname))
f:write(text)
f:close()
end
end
+---@param opt gen_lsp._opt
local function read_json(opt)
local uri = 'https://raw.githubusercontent.com/microsoft/language-server-protocol/gh-pages/_specifications/lsp/'
.. opt.version
.. '/metaModel/metaModel.json'
+ print('Reading ' .. uri)
local res = vim.system({ 'curl', '--no-progress-meter', uri, '-o', '-' }):wait()
if res.code ~= 0 or (res.stdout or ''):len() < 999 then
@@ -99,19 +106,30 @@ return protocol
vim.cmd.write()
end
+---@class gen_lsp._opt
+---@field output_file string
+---@field version string
+---@field methods boolean
+
+---@param opt gen_lsp._opt
function M.gen(opt)
- local protocol = read_json(opt)
+ local protocol = read_json(opt) --- @type table
if opt.methods then
gen_methods(protocol)
end
local output = {
- '--[[',
+ '--' .. '[[',
'This file is autogenerated from scripts/gen_lsp.lua',
'Regenerate:',
- [=[nvim -l scripts/gen_lsp.lua gen --version 3.18 --runtime/lua/vim/lsp/_meta/protocol.lua]=],
- '--]]',
+ ([=[nvim -l scripts/gen_lsp.lua gen --version %s --out runtime/lua/vim/lsp/_meta/protocol.lua]=]):format(
+ DEFAULT_LSP_VERSION
+ ),
+ '--' .. ']]',
+ '',
+ '---@meta',
+ "error('Cannot require a meta file')",
'',
'---@alias lsp.null nil',
'---@alias uinteger integer',
@@ -265,26 +283,39 @@ end
local opt = {
output_file = 'runtime/lua/vim/lsp/_meta/protocol.lua',
- version = nil,
- methods = nil,
+ version = DEFAULT_LSP_VERSION,
+ methods = false,
}
-for i = 1, #_G.arg do
+local command = nil
+local i = 1
+while i <= #_G.arg do
if _G.arg[i] == '--out' then
- opt.output_file = _G.arg[i + 1]
+ opt.output_file = assert(_G.arg[i + 1], '--out <outfile> needed')
+ i = i + 1
elseif _G.arg[i] == '--version' then
- opt.version = _G.arg[i + 1]
+ opt.version = assert(_G.arg[i + 1], '--version <version> needed')
+ i = i + 1
elseif _G.arg[i] == '--methods' then
opt.methods = true
- elseif vim.startswith(_G.arg[i], '--') then
- opt.output_file = _G.arg[i]:sub(3)
+ elseif vim.startswith(_G.arg[i], '-') then
+ error('Unrecognized args: ' .. _G.arg[i])
+ else
+ if command then
+ error('More than one command was given: ' .. _G.arg[i])
+ else
+ command = _G.arg[i]
+ end
end
+ i = i + 1
end
-for _, a in ipairs(arg) do
- if M[a] then
- M[a](opt)
- end
+if not command then
+ print(USAGE)
+elseif M[command] then
+ M[command](opt) -- see M.gen()
+else
+ error('Unknown command: ' .. command)
end
return M
diff --git a/src/clint.py b/src/clint.py
index 596e2d8a26..ed5aaf43d2 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -900,16 +900,13 @@ def CheckIncludes(filename, lines, error):
# These should be synced with the ignored headers in the `iwyu` target in
# the Makefile.
check_includes_ignore = [
- "src/nvim/api/extmark.h",
"src/nvim/api/private/helpers.h",
"src/nvim/api/private/validate.h",
"src/nvim/assert_defs.h",
- "src/nvim/autocmd.h",
"src/nvim/buffer.h",
"src/nvim/buffer_defs.h",
"src/nvim/channel.h",
"src/nvim/charset.h",
- "src/nvim/decoration.h",
"src/nvim/drawline.h",
"src/nvim/eval.h",
"src/nvim/eval/encode.h",
@@ -927,7 +924,6 @@ def CheckIncludes(filename, lines, error):
"src/nvim/event/stream.h",
"src/nvim/event/time.h",
"src/nvim/event/wstream.h",
- "src/nvim/extmark.h",
"src/nvim/garray.h",
"src/nvim/globals.h",
"src/nvim/grid.h",
@@ -946,7 +942,6 @@ def CheckIncludes(filename, lines, error):
"src/nvim/os/pty_conpty_win.h",
"src/nvim/os/pty_process_unix.h",
"src/nvim/os/pty_process_win.h",
- "src/nvim/plines.h",
"src/nvim/tui/input.h",
"src/nvim/ui.h",
"src/nvim/viml/parser/expressions.h",
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 0cdce539eb..2ccb8071c6 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -11,17 +11,9 @@ set_target_properties(nvim
#-------------------------------------------------------------------------------
add_library(libuv INTERFACE)
-find_package(libuv CONFIG QUIET)
-if(TARGET libuv::uv_a)
- target_link_libraries(libuv INTERFACE libuv::uv_a)
- mark_as_advanced(libuv_DIR)
-else()
- # Fall back to find module for libuv versions older than v1.45.0 which don't
- # provide a config file
- find_package(Libuv 1.28.0 REQUIRED MODULE)
- target_include_directories(libuv SYSTEM BEFORE INTERFACE ${LIBUV_INCLUDE_DIR})
- target_link_libraries(libuv INTERFACE ${LIBUV_LIBRARIES})
-endif()
+find_package(Libuv 1.28.0 REQUIRED)
+target_include_directories(libuv SYSTEM BEFORE INTERFACE ${LIBUV_INCLUDE_DIR})
+target_link_libraries(libuv INTERFACE ${LIBUV_LIBRARIES})
add_library(nlua0 MODULE)
if(WIN32)
@@ -332,6 +324,7 @@ set(GENERATED_KEYSETS_DEFS ${GENERATED_DIR}/keysets_defs.generated.h)
set(GENERATED_EVENTS_ENUM ${GENERATED_INCLUDES_DIR}/auevents_enum.generated.h)
set(GENERATED_EVENTS_NAMES_MAP ${GENERATED_DIR}/auevents_name_map.generated.h)
set(GENERATED_OPTIONS ${GENERATED_DIR}/options.generated.h)
+set(GENERATED_OPTIONS_ENUM ${GENERATED_DIR}/options_enum.generated.h)
set(EX_CMDS_GENERATOR ${GENERATOR_DIR}/gen_ex_cmds.lua)
set(FUNCS_GENERATOR ${GENERATOR_DIR}/gen_eval.lua)
set(EVENTS_GENERATOR ${GENERATOR_DIR}/gen_events.lua)
@@ -676,8 +669,8 @@ add_custom_command(OUTPUT ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP}
DEPENDS ${LUA_GEN_DEPS} ${EVENTS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/auevents.lua
)
-add_custom_command(OUTPUT ${GENERATED_OPTIONS}
- COMMAND ${LUA_GEN} ${OPTIONS_GENERATOR} ${GENERATED_OPTIONS}
+add_custom_command(OUTPUT ${GENERATED_OPTIONS} ${GENERATED_OPTIONS_ENUM}
+ COMMAND ${LUA_GEN} ${OPTIONS_GENERATOR} ${GENERATED_OPTIONS} ${GENERATED_OPTIONS_ENUM}
DEPENDS ${LUA_GEN_DEPS} ${OPTIONS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/options.lua
)
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index e0dd265167..99d261e73d 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -12,6 +12,7 @@
#include "nvim/api/buffer.h"
#include "nvim/api/keysets_defs.h"
#include "nvim/api/private/defs.h"
+#include "nvim/api/private/dispatch.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/private/validate.h"
#include "nvim/ascii_defs.h"
diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c
index d6a76617a7..371361c5a1 100644
--- a/src/nvim/api/deprecated.c
+++ b/src/nvim/api/deprecated.c
@@ -643,7 +643,7 @@ static Object get_option_from(void *from, OptReqScope req_scope, String name, Er
return (Object)OBJECT_INIT;
});
- OptVal value = get_option_value_strict(name.data, req_scope, from, err);
+ OptVal value = get_option_value_strict(findoption(name.data), req_scope, from, err);
if (ERROR_SET(err)) {
return (Object)OBJECT_INIT;
}
@@ -669,8 +669,8 @@ static void set_option_to(uint64_t channel_id, void *to, OptReqScope req_scope,
return;
});
- int flags = get_option_attrs(name.data);
- VALIDATE_S(flags != 0, "option name", name.data, {
+ OptIndex opt_idx = findoption(name.data);
+ VALIDATE_S(opt_idx != kOptInvalid, "option name", name.data, {
return;
});
@@ -685,13 +685,14 @@ static void set_option_to(uint64_t channel_id, void *to, OptReqScope req_scope,
return;
});
+ int attrs = get_option_attrs(opt_idx);
// For global-win-local options -> setlocal
// For win-local options -> setglobal and setlocal (opt_flags == 0)
- const int opt_flags = (req_scope == kOptReqWin && !(flags & SOPT_GLOBAL))
+ const int opt_flags = (req_scope == kOptReqWin && !(attrs & SOPT_GLOBAL))
? 0
: (req_scope == kOptReqGlobal) ? OPT_GLOBAL : OPT_LOCAL;
WITH_SCRIPT_CONTEXT(channel_id, {
- set_option_value_for(name.data, optval, opt_flags, req_scope, to, err);
+ set_option_value_for(name.data, opt_idx, optval, opt_flags, req_scope, to, err);
});
}
diff --git a/src/nvim/api/keysets_defs.h b/src/nvim/api/keysets_defs.h
index 5aae88f7b3..d1cbe43de0 100644
--- a/src/nvim/api/keysets_defs.h
+++ b/src/nvim/api/keysets_defs.h
@@ -3,6 +3,10 @@
#include "nvim/api/private/defs.h"
typedef struct {
+ OptionalKeys is_set__empty_;
+} Dict(empty);
+
+typedef struct {
OptionalKeys is_set__context_;
Array types;
} Dict(context);
@@ -338,10 +342,6 @@ typedef struct {
} Dict(buf_delete);
typedef struct {
- OptionalKeys is_set__empty_;
-} Dict(empty);
-
-typedef struct {
OptionalKeys is_set__open_term_;
LuaRef on_input;
} Dict(open_term);
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c
index 9cf91bad42..54a2fbf385 100644
--- a/src/nvim/api/options.c
+++ b/src/nvim/api/options.c
@@ -23,9 +23,9 @@
# include "api/options.c.generated.h"
#endif
-static int validate_option_value_args(Dict(option) *opts, char *name, int *scope,
- OptReqScope *req_scope, void **from, char **filetype,
- Error *err)
+static int validate_option_value_args(Dict(option) *opts, char *name, OptIndex *opt_idxp,
+ int *scope, OptReqScope *req_scope, void **from,
+ char **filetype, Error *err)
{
#define HAS_KEY_X(d, v) HAS_KEY(d, option, v)
if (HAS_KEY_X(opts, scope)) {
@@ -79,7 +79,8 @@ static int validate_option_value_args(Dict(option) *opts, char *name, int *scope
return FAIL;
});
- int flags = get_option_attrs(name);
+ *opt_idxp = findoption(name);
+ int flags = get_option_attrs(*opt_idxp);
if (flags == 0) {
// hidden or unknown option
api_set_error(err, kErrorTypeValidation, "Unknown option '%s'", name);
@@ -119,10 +120,10 @@ static buf_T *do_ft_buf(char *filetype, aco_save_T *aco, Error *err)
aucmd_prepbuf(aco, ftbuf);
TRY_WRAP(err, {
- set_option_value("bufhidden", STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL);
- set_option_value("buftype", STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL);
- set_option_value("swapfile", BOOLEAN_OPTVAL(false), OPT_LOCAL);
- set_option_value("modeline", BOOLEAN_OPTVAL(false), OPT_LOCAL); // 'nomodeline'
+ set_option_value(kOptBufhidden, STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL);
+ set_option_value(kOptBuftype, STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL);
+ set_option_value(kOptSwapfile, BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value(kOptModeline, BOOLEAN_OPTVAL(false), OPT_LOCAL); // 'nomodeline'
ftbuf->b_p_ft = xstrdup(filetype);
do_filetype_autocmd(ftbuf, false);
@@ -152,23 +153,22 @@ static buf_T *do_ft_buf(char *filetype, aco_save_T *aco, Error *err)
Object nvim_get_option_value(String name, Dict(option) *opts, Error *err)
FUNC_API_SINCE(9)
{
- Object rv = OBJECT_INIT;
- OptVal value = NIL_OPTVAL;
-
+ OptIndex opt_idx = 0;
int scope = 0;
OptReqScope req_scope = kOptReqGlobal;
void *from = NULL;
char *filetype = NULL;
- if (!validate_option_value_args(opts, name.data, &scope, &req_scope, &from, &filetype, err)) {
- goto err;
+ if (!validate_option_value_args(opts, name.data, &opt_idx, &scope, &req_scope, &from, &filetype,
+ err)) {
+ return (Object)OBJECT_INIT;
}
aco_save_T aco;
buf_T *ftbuf = do_ft_buf(filetype, &aco, err);
if (ERROR_SET(err)) {
- goto err;
+ return (Object)OBJECT_INIT;
}
if (ftbuf != NULL) {
@@ -176,8 +176,8 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err)
from = ftbuf;
}
- bool hidden;
- value = get_option_value_for(name.data, NULL, scope, &hidden, req_scope, from, err);
+ OptVal value = get_option_value_for(opt_idx, scope, req_scope, from, err);
+ bool hidden = is_option_hidden(opt_idx);
if (ftbuf != NULL) {
// restore curwin/curbuf and a few other things
@@ -198,7 +198,7 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err)
return optval_as_object(value);
err:
optval_free(value);
- return rv;
+ return (Object)OBJECT_INIT;
}
/// Sets the value of an option. The behavior of this function matches that of
@@ -219,10 +219,11 @@ void nvim_set_option_value(uint64_t channel_id, String name, Object value, Dict(
Error *err)
FUNC_API_SINCE(9)
{
+ OptIndex opt_idx = 0;
int scope = 0;
OptReqScope req_scope = kOptReqGlobal;
void *to = NULL;
- if (!validate_option_value_args(opts, name.data, &scope, &req_scope, &to, NULL, err)) {
+ if (!validate_option_value_args(opts, name.data, &opt_idx, &scope, &req_scope, &to, NULL, err)) {
return;
}
@@ -233,7 +234,7 @@ void nvim_set_option_value(uint64_t channel_id, String name, Object value, Dict(
//
// Then force scope to local since we don't want to change the global option
if (req_scope == kOptReqWin && scope == 0) {
- int flags = get_option_attrs(name.data);
+ int flags = get_option_attrs(opt_idx);
if (flags & SOPT_GLOBAL) {
scope = OPT_LOCAL;
}
@@ -251,7 +252,7 @@ void nvim_set_option_value(uint64_t channel_id, String name, Object value, Dict(
});
WITH_SCRIPT_CONTEXT(channel_id, {
- set_option_value_for(name.data, optval, scope, req_scope, to, err);
+ set_option_value_for(name.data, opt_idx, optval, scope, req_scope, to, err);
});
}
@@ -305,10 +306,12 @@ Dictionary nvim_get_all_options_info(Error *err)
Dictionary nvim_get_option_info2(String name, Dict(option) *opts, Error *err)
FUNC_API_SINCE(11)
{
+ OptIndex opt_idx = 0;
int scope = 0;
OptReqScope req_scope = kOptReqGlobal;
void *from = NULL;
- if (!validate_option_value_args(opts, name.data, &scope, &req_scope, &from, NULL, err)) {
+ if (!validate_option_value_args(opts, name.data, &opt_idx, &scope, &req_scope, &from, NULL,
+ err)) {
return (Dictionary)ARRAY_DICT_INIT;
}
@@ -384,25 +387,19 @@ static void restore_option_context(void *const ctx, OptReqScope req_scope)
/// Get attributes for an option.
///
-/// @param name Option name.
+/// @param opt_idx Option index in options[] table.
///
/// @return Option attributes.
/// 0 for hidden or unknown option.
/// See SOPT_* in option_defs.h for other flags.
-int get_option_attrs(char *name)
+int get_option_attrs(OptIndex opt_idx)
{
- int opt_idx = findoption(name);
-
- if (opt_idx < 0) {
+ if (opt_idx == kOptInvalid) {
return 0;
}
vimoption_T *opt = get_option(opt_idx);
- if (is_tty_option(opt->fullname)) {
- return SOPT_STRING | SOPT_GLOBAL;
- }
-
// Hidden option
if (opt->var == NULL) {
return 0;
@@ -410,14 +407,6 @@ int get_option_attrs(char *name)
int attrs = 0;
- if (opt->flags & P_BOOL) {
- attrs |= SOPT_BOOL;
- } else if (opt->flags & P_NUM) {
- attrs |= SOPT_NUM;
- } else if (opt->flags & P_STRING) {
- attrs |= SOPT_STRING;
- }
-
if (opt->indir == PV_NONE || (opt->indir & PV_BOTH)) {
attrs |= SOPT_GLOBAL;
}
@@ -432,15 +421,13 @@ int get_option_attrs(char *name)
/// Check if option has a value in the requested scope.
///
-/// @param name Option name.
+/// @param opt_idx Option index in options[] table.
/// @param req_scope Requested option scope. See OptReqScope in option.h.
///
/// @return true if option has a value in the requested scope, false otherwise.
-static bool option_has_scope(char *name, OptReqScope req_scope)
+static bool option_has_scope(OptIndex opt_idx, OptReqScope req_scope)
{
- int opt_idx = findoption(name);
-
- if (opt_idx < 0) {
+ if (opt_idx == kOptInvalid) {
return false;
}
@@ -468,7 +455,7 @@ static bool option_has_scope(char *name, OptReqScope req_scope)
/// Get the option value in the requested scope.
///
-/// @param name Option name.
+/// @param opt_idx Option index in options[] table.
/// @param req_scope Requested option scope. See OptReqScope in option.h.
/// @param[in] from Pointer to buffer or window for local option value.
/// @param[out] err Error message, if any.
@@ -476,21 +463,12 @@ static bool option_has_scope(char *name, OptReqScope req_scope)
/// @return Option value in the requested scope. Returns a Nil option value if option is not found,
/// hidden or if it isn't present in the requested scope. (i.e. has no global, window-local or
/// buffer-local value depending on opt_scope).
-OptVal get_option_value_strict(char *name, OptReqScope req_scope, void *from, Error *err)
+OptVal get_option_value_strict(OptIndex opt_idx, OptReqScope req_scope, void *from, Error *err)
{
- OptVal retv = NIL_OPTVAL;
-
- if (!option_has_scope(name, req_scope)) {
- return retv;
- }
- if (get_tty_option(name, &retv.data.string.data)) {
- retv.type = kOptValTypeString;
- return retv;
+ if (opt_idx == kOptInvalid || !option_has_scope(opt_idx, req_scope)) {
+ return NIL_OPTVAL;
}
- int opt_idx = findoption(name);
- assert(opt_idx != 0); // option_has_scope() already verifies if option name is valid.
-
vimoption_T *opt = get_option(opt_idx);
switchwin_T switchwin;
aco_save_T aco;
@@ -498,11 +476,11 @@ OptVal get_option_value_strict(char *name, OptReqScope req_scope, void *from, Er
: (req_scope == kOptReqBuf ? (void *)&aco : NULL);
bool switched = switch_option_context(ctx, req_scope, from, err);
if (ERROR_SET(err)) {
- return retv;
+ return NIL_OPTVAL;
}
char *varp = get_varp_scope(opt, req_scope == kOptReqGlobal ? OPT_GLOBAL : OPT_LOCAL);
- retv = optval_from_varp(opt_idx, varp);
+ OptVal retv = optval_from_varp(opt_idx, varp);
if (switched) {
restore_option_context(ctx, req_scope);
@@ -513,7 +491,7 @@ OptVal get_option_value_strict(char *name, OptReqScope req_scope, void *from, Er
/// Get option value for buffer / window.
///
-/// @param[in] name Option name.
+/// @param opt_idx Option index in options[] table.
/// @param[out] flagsp Set to the option flags (P_xxxx) (if not NULL).
/// @param[in] scope Option scope (can be OPT_LOCAL, OPT_GLOBAL or a combination).
/// @param[out] hidden Whether option is hidden.
@@ -522,8 +500,8 @@ OptVal get_option_value_strict(char *name, OptReqScope req_scope, void *from, Er
/// @param[out] err Error message, if any.
///
/// @return Option value. Must be freed by caller.
-OptVal get_option_value_for(const char *const name, uint32_t *flagsp, int scope, bool *hidden,
- const OptReqScope req_scope, void *const from, Error *err)
+OptVal get_option_value_for(OptIndex opt_idx, int scope, const OptReqScope req_scope,
+ void *const from, Error *err)
{
switchwin_T switchwin;
aco_save_T aco;
@@ -535,7 +513,7 @@ OptVal get_option_value_for(const char *const name, uint32_t *flagsp, int scope,
return NIL_OPTVAL;
}
- OptVal retv = get_option_value(name, flagsp, scope, hidden);
+ OptVal retv = get_option_value(opt_idx, scope);
if (switched) {
restore_option_context(ctx, req_scope);
@@ -546,14 +524,16 @@ OptVal get_option_value_for(const char *const name, uint32_t *flagsp, int scope,
/// Set option value for buffer / window.
///
-/// @param[in] name Option name.
+/// @param name Option name.
+/// @param opt_idx Option index in options[] table.
/// @param[in] value Option value.
/// @param[in] opt_flags Flags: OPT_LOCAL, OPT_GLOBAL, or 0 (both).
/// @param req_scope Requested option scope. See OptReqScope in option.h.
/// @param[in] from Target buffer/window.
/// @param[out] err Error message, if any.
-void set_option_value_for(const char *const name, OptVal value, const int opt_flags,
+void set_option_value_for(const char *name, OptIndex opt_idx, OptVal value, const int opt_flags,
const OptReqScope req_scope, void *const from, Error *err)
+ FUNC_ATTR_NONNULL_ARG(1)
{
switchwin_T switchwin;
aco_save_T aco;
@@ -565,7 +545,7 @@ void set_option_value_for(const char *const name, OptVal value, const int opt_fl
return;
}
- const char *const errmsg = set_option_value(name, value, opt_flags);
+ const char *const errmsg = set_option_value_handle_tty(name, opt_idx, value, opt_flags);
if (errmsg) {
api_set_error(err, kErrorTypeException, "%s", errmsg);
}
diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c
index ef57bde32d..e7b8934c97 100644
--- a/src/nvim/api/private/converter.c
+++ b/src/nvim/api/private/converter.c
@@ -258,9 +258,7 @@ Object vim_to_object(typval_T *obj)
/// @param tv Conversion result is placed here. On failure member v_type is
/// set to VAR_UNKNOWN (no allocation was made for this variable).
/// @param err Error object.
-///
-/// @returns true if conversion is successful, otherwise false.
-bool object_to_vim(Object obj, typval_T *tv, Error *err)
+void object_to_vim(Object obj, typval_T *tv, Error *err)
{
tv->v_type = VAR_UNKNOWN;
tv->v_lock = VAR_UNLOCKED;
@@ -307,12 +305,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
for (uint32_t i = 0; i < obj.data.array.size; i++) {
Object item = obj.data.array.items[i];
typval_T li_tv;
-
- if (!object_to_vim(item, &li_tv, err)) {
- tv_list_free(list);
- return false;
- }
-
+ object_to_vim(item, &li_tv, err);
tv_list_append_owned_tv(list, li_tv);
}
tv_list_ref(list);
@@ -328,24 +321,8 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
for (uint32_t i = 0; i < obj.data.dictionary.size; i++) {
KeyValuePair item = obj.data.dictionary.items[i];
String key = item.key;
-
- if (key.size == 0) {
- api_set_error(err, kErrorTypeValidation,
- "Empty dictionary keys aren't allowed");
- // cleanup
- tv_dict_free(dict);
- return false;
- }
-
dictitem_T *const di = tv_dict_item_alloc(key.data);
-
- if (!object_to_vim(item.value, &di->di_tv, err)) {
- // cleanup
- tv_dict_item_free(di);
- tv_dict_free(dict);
- return false;
- }
-
+ object_to_vim(item.value, &di->di_tv, err);
tv_dict_add(dict, di);
}
dict->dv_refcount++;
@@ -362,6 +339,4 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
break;
}
}
-
- return true;
}
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index b23684aee9..2772fa8b59 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -253,9 +253,7 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, bool retva
typval_T tv;
// Convert the object to a vimscript type in the temporary variable
- if (!object_to_vim(value, &tv, err)) {
- return rv;
- }
+ object_to_vim(value, &tv, err);
typval_T oldtv = TV_INITIAL_VALUE;
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 0842469c59..a52d7493e3 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -948,8 +948,8 @@ Buffer nvim_create_buf(Boolean listed, Boolean scratch, Error *err)
buf_copy_options(buf, BCO_ENTER | BCO_NOHELP);
if (scratch) {
- set_string_option_direct_in_buf(buf, "bufhidden", -1, "hide", OPT_LOCAL, 0);
- set_string_option_direct_in_buf(buf, "buftype", -1, "nofile", OPT_LOCAL, 0);
+ set_string_option_direct_in_buf(buf, kOptBufhidden, "hide", OPT_LOCAL, 0);
+ set_string_option_direct_in_buf(buf, kOptBuftype, "nofile", OPT_LOCAL, 0);
assert(buf->b_ml.ml_mfp->mf_fd < 0); // ml_open() should not have opened swapfile already
buf->b_p_swf = false;
buf->b_p_ml = false;
@@ -2189,7 +2189,6 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
int cul_id = 0;
int num_id = 0;
linenr_T lnum = statuscol_lnum;
- wp->w_scwidth = win_signcol_count(wp);
decor_redraw_signs(wp, wp->w_buffer, lnum - 1, sattrs, &line_id, &cul_id, &num_id);
statuscol.sattrs = sattrs;
@@ -2240,7 +2239,7 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
buf,
sizeof(buf),
str.data,
- NULL,
+ -1,
0,
fillchar,
maxwidth,
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c
index 25a34f769c..3bca988030 100644
--- a/src/nvim/api/vimscript.c
+++ b/src/nvim/api/vimscript.c
@@ -207,9 +207,7 @@ static Object _call_function(String fn, Array args, dict_T *self, Error *err)
typval_T vim_args[MAX_FUNC_ARGS + 1];
size_t i = 0; // also used for freeing the variables
for (; i < args.size; i++) {
- if (!object_to_vim(args.items[i], &vim_args[i], err)) {
- goto free_vim_args;
- }
+ object_to_vim(args.items[i], &vim_args[i], err);
}
// Initialize `force_abort` and `suppress_errthrow` at the top level.
@@ -243,7 +241,6 @@ static Object _call_function(String fn, Array args, dict_T *self, Error *err)
tv_clear(&rettv);
recursive--;
-free_vim_args:
while (i > 0) {
tv_clear(&vim_args[--i]);
}
@@ -297,9 +294,7 @@ Object nvim_call_dict_function(Object dict, String fn, Array args, Error *err)
mustfree = true;
break;
case kObjectTypeDictionary:
- if (!object_to_vim(dict, &rettv, err)) {
- goto end;
- }
+ object_to_vim(dict, &rettv, err);
break;
default:
api_set_error(err, kErrorTypeValidation,
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 46a08c5706..72b0852d8d 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -704,7 +704,7 @@ char *au_event_disable(char *what)
} else {
STRCAT(new_ei, what);
}
- set_string_option_direct("ei", -1, new_ei, OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptEventignore, new_ei, OPT_FREE, SID_NONE);
xfree(new_ei);
return save_ei;
}
@@ -712,7 +712,7 @@ char *au_event_disable(char *what)
void au_event_restore(char *old_ei)
{
if (old_ei != NULL) {
- set_string_option_direct("ei", -1, old_ei, OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptEventignore, old_ei, OPT_FREE, SID_NONE);
xfree(old_ei);
}
}
diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h
index 8ff4d75ddf..ea8f32feb2 100644
--- a/src/nvim/autocmd.h
+++ b/src/nvim/autocmd.h
@@ -1,9 +1,10 @@
#pragma once
#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
+#include <stddef.h> // IWYU pragma: keep
+#include <stdint.h> // IWYU pragma: keep
+#include "klib/kvec.h"
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/autocmd_defs.h" // IWYU pragma: export
#include "nvim/buffer_defs.h"
@@ -12,7 +13,6 @@
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/pos_defs.h"
-#include "nvim/types_defs.h"
// Set by the apply_autocmds_group function if the given event is equal to
// EVENT_FILETYPE. Used by the readfile function in order to determine if
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 8a594dea92..0392ff6ebd 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -750,6 +750,8 @@ void buf_clear(void)
{
linenr_T line_count = curbuf->b_ml.ml_line_count;
extmark_free_all(curbuf); // delete any extmarks
+ map_destroy(int, curbuf->b_signcols.invalid);
+ *curbuf->b_signcols.invalid = (Map(int, SignRange)) MAP_INIT;
while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) {
ml_delete(1, false);
}
@@ -920,6 +922,8 @@ static void free_buffer_stuff(buf_T *buf, int free_flags)
}
uc_clear(&buf->b_ucmds); // clear local user commands
extmark_free_all(buf); // delete any extmarks
+ map_destroy(int, buf->b_signcols.invalid);
+ *buf->b_signcols.invalid = (Map(int, SignRange)) MAP_INIT;
map_clear_mode(buf, MAP_ALL_MODES, true, false); // clear local mappings
map_clear_mode(buf, MAP_ALL_MODES, true, true); // clear local abbrevs
XFREE_CLEAR(buf->b_start_fenc);
@@ -1844,7 +1848,6 @@ buf_T *buflist_new(char *ffname_arg, char *sfname_arg, linenr_T lnum, int flags)
buf = xcalloc(1, sizeof(buf_T));
// init b: variables
buf->b_vars = tv_dict_alloc();
- buf->b_signcols.sentinel = 0;
init_var_dict(buf->b_vars, &buf->b_bufvar, VAR_SCOPE);
buf_init_changedtick(buf);
}
@@ -3278,7 +3281,7 @@ void maketitle(void)
if (*p_titlestring != NUL) {
if (stl_syntax & STL_IN_TITLE) {
build_stl_str_hl(curwin, buf, sizeof(buf), p_titlestring,
- "titlestring", 0, 0, maxlen, NULL, NULL, NULL);
+ kOptTitlestring, 0, 0, maxlen, NULL, NULL, NULL);
title_str = buf;
} else {
title_str = p_titlestring;
@@ -3383,7 +3386,7 @@ void maketitle(void)
if (*p_iconstring != NUL) {
if (stl_syntax & STL_IN_ICON) {
build_stl_str_hl(curwin, icon_str, sizeof(buf), p_iconstring,
- "iconstring", 0, 0, 0, NULL, NULL, NULL);
+ kOptIconstring, 0, 0, 0, NULL, NULL, NULL);
} else {
icon_str = p_iconstring;
}
@@ -4026,67 +4029,6 @@ char *buf_spname(buf_T *buf)
return NULL;
}
-/// Invalidate the signcolumn if needed after deleting a sign ranging from line1 to line2.
-void buf_signcols_del_check(buf_T *buf, linenr_T line1, linenr_T line2)
-{
- linenr_T sent = buf->b_signcols.sentinel;
- if (sent >= line1 && sent <= line2) {
- // When removed sign overlaps the sentinel line, entire buffer needs to be checked.
- buf->b_signcols.sentinel = buf->b_signcols.size = 0;
- }
-}
-
-/// Invalidate the signcolumn if needed after adding a sign ranging from line1 to line2.
-void buf_signcols_add_check(buf_T *buf, linenr_T line1, linenr_T line2)
-{
- if (!buf->b_signcols.sentinel) {
- return;
- }
-
- linenr_T sent = buf->b_signcols.sentinel;
- if (sent >= line1 && sent <= line2) {
- // If added sign overlaps sentinel line, increment without invalidating.
- if (buf->b_signcols.size == buf->b_signcols.max) {
- buf->b_signcols.max++;
- }
- buf->b_signcols.size++;
- return;
- }
-
- if (line1 < buf->b_signcols.invalid_top) {
- buf->b_signcols.invalid_top = line1;
- }
- if (line2 > buf->b_signcols.invalid_bot) {
- buf->b_signcols.invalid_bot = line2;
- }
-}
-
-int buf_signcols(buf_T *buf, int max)
-{
- if (!buf->b_signs_with_text) {
- buf->b_signcols.size = 0;
- } else if (max <= 1 && buf->b_signs_with_text >= (size_t)max) {
- buf->b_signcols.size = max;
- } else {
- linenr_T sent = buf->b_signcols.sentinel;
- if (!sent || max > buf->b_signcols.max) {
- // Recheck if the window scoped maximum 'signcolumn' is greater than the
- // previous maximum or if there is no sentinel line yet.
- buf->b_signcols.invalid_top = sent ? sent : 1;
- buf->b_signcols.invalid_bot = sent ? sent : buf->b_ml.ml_line_count;
- }
-
- if (buf->b_signcols.invalid_bot) {
- decor_validate_signcols(buf, max);
- }
- }
-
- buf->b_signcols.max = max;
- buf->b_signcols.invalid_top = MAXLNUM;
- buf->b_signcols.invalid_bot = 0;
- return buf->b_signcols.size;
-}
-
/// Get "buf->b_fname", use "[No Name]" if it is NULL.
char *buf_get_fname(const buf_T *buf)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
@@ -4205,9 +4147,9 @@ int buf_open_scratch(handle_T bufnr, char *bufname)
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, false, curbuf);
(void)setfname(curbuf, bufname, NULL, true);
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, false, curbuf);
- set_option_value_give_err("bh", STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL);
- set_option_value_give_err("bt", STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL);
- set_option_value_give_err("swf", BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value_give_err(kOptBufhidden, STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL);
+ set_option_value_give_err(kOptBuftype, STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL);
+ set_option_value_give_err(kOptSwapfile, BOOLEAN_OPTVAL(false), OPT_LOCAL);
RESET_BINDING(curwin);
return OK;
}
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index b26d42385b..beb3ec95b8 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -26,7 +26,7 @@ typedef struct {
#include "nvim/map_defs.h"
#include "nvim/mapping_defs.h"
#include "nvim/mark_defs.h"
-#include "nvim/marktree.h"
+#include "nvim/marktree_defs.h"
#include "nvim/option_vars.h"
#include "nvim/pos_defs.h"
#include "nvim/statusline_defs.h"
@@ -703,11 +703,10 @@ struct file_buffer {
// may use a different synblock_T.
struct {
- int size; // last calculated number of sign columns
- int max; // maximum value size is valid for.
- linenr_T sentinel; // a line number which is holding up the signcolumn
- linenr_T invalid_top; // first invalid line number that needs to be checked
- linenr_T invalid_bot; // last invalid line number that needs to be checked
+ int max; // maximum number of signs on a single line
+ int max_count; // number of lines with max number of signs
+ bool resized; // whether max changed at start of redraw
+ Map(int, SignRange) invalid[1]; // map of invalid ranges to be checked
} b_signcols;
Terminal *terminal; // Terminal instance associated with the buffer
diff --git a/src/nvim/channel.c b/src/nvim/channel.c
index 767c8d29b8..ca8cbed8f9 100644
--- a/src/nvim/channel.c
+++ b/src/nvim/channel.c
@@ -233,7 +233,7 @@ void channel_create_event(Channel *chan, const char *ext_source)
typval_T tv = TV_INITIAL_VALUE;
// TODO(bfredl): do the conversion in one step. Also would be nice
// to pretty print top level dict in defined order
- (void)object_to_vim(DICTIONARY_OBJ(info), &tv, NULL);
+ object_to_vim(DICTIONARY_OBJ(info), &tv, NULL);
assert(tv.v_type == VAR_DICT);
char *str = encode_tv2json(&tv, NULL);
ILOG("new channel %" PRIu64 " (%s) : %s", chan->id, source, str);
@@ -865,7 +865,7 @@ static void set_info_event(void **argv)
dict_T *dict = get_v_event(&save_v_event);
Dictionary info = channel_info(chan->id);
typval_T retval;
- (void)object_to_vim(DICTIONARY_OBJ(info), &retval, NULL);
+ object_to_vim(DICTIONARY_OBJ(info), &retval, NULL);
assert(retval.v_type == VAR_DICT);
tv_dict_add_dict(dict, S_LEN("info"), retval.vval.v_dict);
tv_dict_set_keys_readonly(dict);
diff --git a/src/nvim/context.c b/src/nvim/context.c
index 5f47cfc225..dfb214d065 100644
--- a/src/nvim/context.c
+++ b/src/nvim/context.c
@@ -138,8 +138,8 @@ bool ctx_restore(Context *ctx, const int flags)
free_ctx = true;
}
- OptVal op_shada = get_option_value("shada", NULL, OPT_GLOBAL, NULL);
- set_option_value("shada", STATIC_CSTR_AS_OPTVAL("!,'100,%"), OPT_GLOBAL);
+ OptVal op_shada = get_option_value(kOptShada, OPT_GLOBAL);
+ set_option_value(kOptShada, STATIC_CSTR_AS_OPTVAL("!,'100,%"), OPT_GLOBAL);
if (flags & kCtxRegs) {
ctx_restore_regs(ctx);
@@ -165,7 +165,7 @@ bool ctx_restore(Context *ctx, const int flags)
ctx_free(ctx);
}
- set_option_value("shada", op_shada, OPT_GLOBAL);
+ set_option_value(kOptShada, op_shada, OPT_GLOBAL);
optval_free(op_shada);
return true;
@@ -326,9 +326,7 @@ static inline msgpack_sbuffer array_to_sbuf(Array array, Error *err)
msgpack_sbuffer_init(&sbuf);
typval_T list_tv;
- if (!object_to_vim(ARRAY_OBJ(array), &list_tv, err)) {
- return sbuf;
- }
+ object_to_vim(ARRAY_OBJ(array), &list_tv, err);
assert(list_tv.v_type == VAR_LIST);
if (!encode_vim_list_to_buf(list_tv.vval.v_list, &sbuf.size, &sbuf.data)) {
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c
index 11204a1b31..74056b7c26 100644
--- a/src/nvim/decoration.c
+++ b/src/nvim/decoration.c
@@ -14,6 +14,7 @@
#include "nvim/grid.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
+#include "nvim/marktree.h"
#include "nvim/memory.h"
#include "nvim/move.h"
#include "nvim/option_vars.h"
@@ -202,21 +203,21 @@ void buf_put_decor_virt(buf_T *buf, DecorVirtText *vt)
}
static int sign_add_id = 0;
-void buf_put_decor_sh(buf_T *buf, DecorSignHighlight *sh, int row, int row2)
+void buf_put_decor_sh(buf_T *buf, DecorSignHighlight *sh, int row1, int row2)
{
if (sh->flags & kSHIsSign) {
sh->sign_add_id = sign_add_id++;
buf->b_signs++;
if (sh->text.ptr) {
buf->b_signs_with_text++;
- buf_signcols_add_check(buf, row + 1, row2 + 1);
+ buf_signcols_invalidate_range(buf, row1, row2, 1);
}
}
}
-void buf_decor_remove(buf_T *buf, int row, int row2, DecorInline decor, bool free)
+void buf_decor_remove(buf_T *buf, int row1, int row2, DecorInline decor, bool free)
{
- decor_redraw(buf, row, row2, decor);
+ decor_redraw(buf, row1, row2, decor);
if (decor.ext) {
DecorVirtText *vt = decor.data.ext.vt;
while (vt) {
@@ -226,7 +227,7 @@ void buf_decor_remove(buf_T *buf, int row, int row2, DecorInline decor, bool fre
uint32_t idx = decor.data.ext.sh_idx;
while (idx != DECOR_ID_INVALID) {
DecorSignHighlight *sh = &kv_A(decor_items, idx);
- buf_remove_decor_sh(buf, row, row2, sh);
+ buf_remove_decor_sh(buf, row1, row2, sh);
idx = sh->next;
}
if (free) {
@@ -248,7 +249,7 @@ void buf_remove_decor_virt(buf_T *buf, DecorVirtText *vt)
}
}
-void buf_remove_decor_sh(buf_T *buf, int row, int row2, DecorSignHighlight *sh)
+void buf_remove_decor_sh(buf_T *buf, int row1, int row2, DecorSignHighlight *sh)
{
if (sh->flags & kSHIsSign) {
assert(buf->b_signs > 0);
@@ -256,8 +257,8 @@ void buf_remove_decor_sh(buf_T *buf, int row, int row2, DecorSignHighlight *sh)
if (sh->text.ptr) {
assert(buf->b_signs_with_text > 0);
buf->b_signs_with_text--;
- if (row2 >= row) {
- buf_signcols_del_check(buf, row + 1, row2 + 1);
+ if (row2 >= row1) {
+ buf_signcols_invalidate_range(buf, row1, row2, -1);
}
}
}
@@ -718,7 +719,7 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[],
int *cul_id, int *num_id)
{
MarkTreeIter itr[1];
- if (!buf->b_signs || !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) {
+ if (!marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) {
return;
}
@@ -791,50 +792,129 @@ DecorSignHighlight *decor_find_sign(DecorInline decor)
}
}
-// Increase the signcolumn size and update the sentinel line if necessary for
-// the invalidated range.
-void decor_validate_signcols(buf_T *buf, int max)
+static void buf_signcols_validate_row(buf_T *buf, int count, int add)
{
- int signcols = 0; // highest value of count
- int currow = buf->b_signcols.invalid_top - 1;
- // TODO(bfredl): only need to use marktree_itr_get_overlap once.
- // then we can process both start and end events and update state for each row
- for (; currow < buf->b_signcols.invalid_bot; currow++) {
- MarkTreeIter itr[1];
- if (!marktree_itr_get_overlap(buf->b_marktree, currow, 0, itr)) {
- continue;
- }
+ // If "count" is greater than current max, set it and reset "max_count".
+ if (count > buf->b_signcols.max) {
+ buf->b_signcols.max = count;
+ buf->b_signcols.max_count = 0;
+ buf->b_signcols.resized = true;
+ }
+ // If row has or had "max" signs, adjust "max_count" with sign of "add".
+ if (count == buf->b_signcols.max - (add < 0 ? -add : 0)) {
+ buf->b_signcols.max_count += (add > 0) - (add < 0);
+ }
+}
- int count = 0;
- MTPair pair;
- while (marktree_itr_step_overlap(buf->b_marktree, itr, &pair)) {
- if (!mt_invalid(pair.start) && (pair.start.flags & MT_FLAG_DECOR_SIGNTEXT)) {
- count++;
- }
- }
+/// Validate a range by counting the number of overlapping signs and adjusting
+/// "b_signcols" accordingly.
+static void buf_signcols_validate_range(buf_T *buf, int row1, int row2, int add)
+{
+ if (-add == buf->b_signcols.max) {
+ buf->b_signcols.max_count -= (row2 + 1 - row1);
+ return; // max signs were removed from the range, no need to count.
+ }
- while (itr->x) {
- MTKey mark = marktree_itr_current(itr);
- if (mark.pos.row != currow) {
- break;
- }
- if (!mt_invalid(mark) && !mt_end(mark) && (mark.flags & MT_FLAG_DECOR_SIGNTEXT)) {
- count++;
- }
- marktree_itr_next(buf->b_marktree, itr);
+ int currow = row1;
+ MTPair pair = { 0 };
+ MarkTreeIter itr[1];
+
+ // Allocate an array of integers holding the overlapping signs in the range.
+ assert(row2 >= row1);
+ int *overlap = xcalloc(sizeof(int), (size_t)(row2 + 1 - row1));
+
+ // First find the number of overlapping signs at "row1".
+ (void)marktree_itr_get_overlap(buf->b_marktree, currow, 0, itr);
+ while (marktree_itr_step_overlap(buf->b_marktree, itr, &pair)) {
+ if (!mt_invalid(pair.start) && pair.start.flags & MT_FLAG_DECOR_SIGNTEXT) {
+ overlap[0]++;
}
+ }
- if (count > signcols) {
- if (count >= buf->b_signcols.size) {
- buf->b_signcols.size = count;
- buf->b_signcols.sentinel = currow + 1;
- }
- if (count >= max) {
- return;
+ // Continue traversing the marktree until beyond "row2".
+ while (itr->x) {
+ MTKey mark = marktree_itr_current(itr);
+ if (mark.pos.row > row2) {
+ break;
+ }
+ // Finish the count at the previous row.
+ if (mark.pos.row != currow) {
+ buf_signcols_validate_row(buf, overlap[currow - row1], add);
+ currow = mark.pos.row;
+ }
+ // Increment overlap array for the start and range of a paired sign mark.
+ if (!mt_invalid(mark) && !mt_end(mark) && (mark.flags & MT_FLAG_DECOR_SIGNTEXT)) {
+ MTPos end = marktree_get_altpos(buf->b_marktree, mark, NULL);
+ for (int i = currow; i <= MIN(row2, end.row < 0 ? currow : end.row); i++) {
+ overlap[i - row1]++;
}
- signcols = count;
}
+
+ marktree_itr_next(buf->b_marktree, itr);
+ }
+ buf_signcols_validate_row(buf, overlap[currow - row1], add);
+ xfree(overlap);
+}
+
+int buf_signcols_validate(win_T *wp, buf_T *buf, bool stc_check)
+{
+ if (!map_size(buf->b_signcols.invalid)) {
+ return buf->b_signcols.max;
+ }
+
+ int start;
+ SignRange range;
+ map_foreach(buf->b_signcols.invalid, start, range, {
+ // Leave rest of the ranges invalid if max is already at configured
+ // maximum or resize is detected for a 'statuscolumn' rebuild.
+ if ((stc_check && buf->b_signcols.resized)
+ || (!stc_check && range.add > 0 && buf->b_signcols.max >= wp->w_maxscwidth)) {
+ return wp->w_maxscwidth;
+ }
+ buf_signcols_validate_range(buf, start, range.end, range.add);
+ });
+
+ // Check if we need to scan the entire buffer.
+ if (buf->b_signcols.max_count == 0) {
+ buf->b_signcols.max = 0;
+ buf->b_signcols.resized = true;
+ buf_signcols_validate_range(buf, 0, buf->b_ml.ml_line_count, 1);
+ }
+
+ map_clear(int, buf->b_signcols.invalid);
+ return buf->b_signcols.max;
+}
+
+static void buf_signcols_invalidate_range(buf_T *buf, int row1, int row2, int add)
+{
+ if (!buf->b_signs_with_text) {
+ buf->b_signcols.max = buf->b_signcols.max_count = 0;
+ buf->b_signcols.resized = true;
+ map_clear(int, buf->b_signcols.invalid);
+ return;
}
+
+ // Remove an invalid range if sum of added/removed signs is now 0.
+ SignRange *srp = map_ref(int, SignRange)(buf->b_signcols.invalid, row1, NULL);
+ if (srp && srp->end == row2 && srp->add + add == 0) {
+ map_del(int, SignRange)(buf->b_signcols.invalid, row1, NULL);
+ return;
+ }
+
+ // Merge with overlapping invalid range.
+ int start;
+ SignRange range;
+ map_foreach(buf->b_signcols.invalid, start, range, {
+ if (row1 <= range.end && start <= row2) {
+ row1 = MIN(row1, start);
+ row2 = MAX(row2, range.end);
+ break;
+ }
+ });
+
+ srp = map_put_ref(int, SignRange)(buf->b_signcols.invalid, row1, NULL, NULL);
+ srp->end = row2;
+ srp->add += add;
}
void decor_redraw_end(DecorState *state)
diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h
index e5bac169dc..92e0cbc76b 100644
--- a/src/nvim/decoration.h
+++ b/src/nvim/decoration.h
@@ -8,7 +8,7 @@
#include "nvim/buffer_defs.h"
#include "nvim/decoration_defs.h" // IWYU pragma: export
#include "nvim/macros_defs.h"
-#include "nvim/marktree.h"
+#include "nvim/marktree_defs.h"
#include "nvim/pos_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h"
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 6578a1121c..483182dc25 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1389,7 +1389,7 @@ static void set_diff_option(win_T *wp, bool value)
curwin = wp;
curbuf = curwin->w_buffer;
curbuf->b_ro_locked++;
- set_option_value_give_err("diff", BOOLEAN_OPTVAL(value), OPT_LOCAL);
+ set_option_value_give_err(kOptDiff, BOOLEAN_OPTVAL(value), OPT_LOCAL);
curbuf->b_ro_locked--;
curwin = old_curwin;
curbuf = curwin->w_buffer;
@@ -1430,7 +1430,7 @@ void diff_win_options(win_T *wp, int addbuf)
}
wp->w_p_fdm_save = xstrdup(wp->w_p_fdm);
}
- set_string_option_direct_in_win(wp, "fdm", -1, "diff", OPT_LOCAL | OPT_FREE, 0);
+ set_string_option_direct_in_win(wp, kOptFoldmethod, "diff", OPT_LOCAL | OPT_FREE, 0);
if (!wp->w_p_diff) {
wp->w_p_fen_save = wp->w_p_fen;
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index e0887ed1d0..77bd05eb55 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -704,8 +704,8 @@ static void handle_breakindent(win_T *wp, winlinevars_T *wlv)
if (wlv->draw_state == WL_BRI - 1 && wlv->n_extra == 0) {
wlv->draw_state = WL_BRI;
// if wlv->need_showbreak is set, breakindent also applies
- if (wp->w_p_bri && (wlv->row != wlv->startrow || wlv->need_showbreak)
- && wlv->filler_lines == 0) {
+ if (wp->w_p_bri && (wlv->row > wlv->startrow + wlv->filler_lines
+ || wlv->need_showbreak)) {
wlv->char_attr = 0;
if (wlv->diff_hlf != (hlf_T)0) {
wlv->char_attr = win_hl_attr(wp, (int)wlv->diff_hlf);
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index 85f62db774..314764d117 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -603,15 +603,6 @@ int update_screen(void)
buf->b_mod_tick_decor = display_tick;
}
}
-
- // Reset 'statuscolumn' if there is no dedicated signcolumn but it is invalid.
- if (*wp->w_p_stc != NUL && wp->w_minscwidth <= SCL_NO
- && (wp->w_buffer->b_signcols.invalid_bot || !wp->w_buffer->b_signcols.sentinel)) {
- wp->w_nrwidth_line_count = 0;
- wp->w_valid &= ~VALID_WCOL;
- wp->w_redr_type = UPD_NOT_VALID;
- wp->w_buffer->b_signcols.invalid_bot = 0;
- }
}
// Go from top to bottom through the windows, redrawing the ones that need it.
@@ -658,10 +649,11 @@ int update_screen(void)
win_check_ns_hl(NULL);
- // Reset b_mod_set flags. Going through all windows is probably faster
- // than going through all buffers (there could be many buffers).
+ // Reset b_mod_set and b_signcols.resized flags. Going through all windows is
+ // probably faster than going through all buffers (there could be many buffers).
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
wp->w_buffer->b_mod_set = false;
+ wp->w_buffer->b_signcols.resized = false;
}
updating_screen = 0;
@@ -1200,17 +1192,31 @@ void comp_col(void)
set_vim_var_nr(VV_ECHOSPACE, sc_col - 1);
}
-static void redraw_win_signcol(win_T *wp)
+/// Redraw entire window "wp" if configured 'signcolumn' width changes.
+static bool win_redraw_signcols(win_T *wp)
{
- // If we can compute a change in the automatic sizing of the sign column
- // under 'signcolumn=auto:X' and signs currently placed in the buffer, better
- // figuring it out here so we can redraw the entire screen for it.
- int scwidth = wp->w_scwidth;
- wp->w_scwidth = win_signcol_count(wp);
- if (wp->w_scwidth != scwidth) {
- changed_line_abv_curs_win(wp);
- redraw_later(wp, UPD_NOT_VALID);
+ int width;
+ bool rebuild_stc = false;
+ buf_T *buf = wp->w_buffer;
+
+ if (wp->w_minscwidth <= SCL_NO) {
+ if (*wp->w_p_stc) {
+ buf_signcols_validate(wp, buf, true);
+ if (buf->b_signcols.resized) {
+ rebuild_stc = true;
+ wp->w_nrwidth_line_count = 0;
+ }
+ }
+ width = 0;
+ } else if (wp->w_maxscwidth <= 1 && buf->b_signs_with_text >= (size_t)wp->w_maxscwidth) {
+ width = wp->w_maxscwidth;
+ } else {
+ width = buf_signcols_validate(wp, buf, false);
}
+
+ int scwidth = wp->w_scwidth;
+ wp->w_scwidth = MAX(wp->w_minscwidth, width);
+ return (wp->w_scwidth != scwidth || rebuild_stc);
}
/// Check if horizontal separator of window "wp" at specified window corner is connected to the
@@ -1490,7 +1496,11 @@ static void win_update(win_T *wp, DecorProviders *providers)
DecorProviders line_providers;
decor_providers_invoke_win(wp, providers, &line_providers);
- redraw_win_signcol(wp);
+ if (win_redraw_signcols(wp)) {
+ wp->w_lines_valid = 0;
+ wp->w_redr_type = UPD_NOT_VALID;
+ changed_line_abv_curs_win(wp);
+ }
init_search_hl(wp, &screen_search_hl);
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index ae34f5715f..1fdaa95076 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -681,7 +681,7 @@ int eval_charconvert(const char *const enc_from, const char *const enc_to,
set_vim_var_string(VV_CC_TO, enc_to, -1);
set_vim_var_string(VV_FNAME_IN, fname_from, -1);
set_vim_var_string(VV_FNAME_OUT, fname_to, -1);
- sctx_T *ctx = get_option_sctx("charconvert");
+ sctx_T *ctx = get_option_sctx(kOptCharconvert);
if (ctx != NULL) {
current_sctx = *ctx;
}
@@ -710,7 +710,7 @@ void eval_diff(const char *const origfile, const char *const newfile, const char
set_vim_var_string(VV_FNAME_NEW, newfile, -1);
set_vim_var_string(VV_FNAME_OUT, outfile, -1);
- sctx_T *ctx = get_option_sctx("diffexpr");
+ sctx_T *ctx = get_option_sctx(kOptDiffexpr);
if (ctx != NULL) {
current_sctx = *ctx;
}
@@ -732,7 +732,7 @@ void eval_patch(const char *const origfile, const char *const difffile, const ch
set_vim_var_string(VV_FNAME_DIFF, difffile, -1);
set_vim_var_string(VV_FNAME_OUT, outfile, -1);
- sctx_T *ctx = get_option_sctx("patchexpr");
+ sctx_T *ctx = get_option_sctx(kOptPatchexpr);
if (ctx != NULL) {
current_sctx = *ctx;
}
@@ -1134,7 +1134,7 @@ list_T *eval_spell_expr(char *badword, char *expr)
if (p_verbose == 0) {
emsg_off++;
}
- sctx_T *ctx = get_option_sctx("spellsuggest");
+ sctx_T *ctx = get_option_sctx(kOptSpellsuggest);
if (ctx != NULL) {
current_sctx = *ctx;
}
@@ -1278,7 +1278,7 @@ void *call_func_retlist(const char *func, int argc, typval_T *argv)
int eval_foldexpr(win_T *wp, int *cp)
{
const sctx_T saved_sctx = current_sctx;
- const bool use_sandbox = was_set_insecurely(wp, "foldexpr", OPT_LOCAL);
+ const bool use_sandbox = was_set_insecurely(wp, kOptFoldexpr, OPT_LOCAL);
char *arg = wp->w_p_fde;
current_sctx = wp->w_p_script_ctx[WV_FDE].script_ctx;
@@ -1326,7 +1326,7 @@ int eval_foldexpr(win_T *wp, int *cp)
/// Evaluate 'foldtext', returning an Array or a String (NULL_STRING on failure).
Object eval_foldtext(win_T *wp)
{
- const bool use_sandbox = was_set_insecurely(wp, "foldtext", OPT_LOCAL);
+ const bool use_sandbox = was_set_insecurely(wp, kOptFoldtext, OPT_LOCAL);
char *arg = wp->w_p_fdt;
funccal_entry_T funccal_entry;
@@ -3735,7 +3735,11 @@ static int eval_index_inner(typval_T *rettv, bool is_range, typval_T *var1, typv
dictitem_T *const item = tv_dict_find(rettv->vval.v_dict, key, keylen);
if (item == NULL && verbose) {
- semsg(_(e_dictkey), key);
+ if (keylen > 0) {
+ semsg(_(e_dictkey_len), keylen, key);
+ } else {
+ semsg(_(e_dictkey), key);
+ }
}
if (item == NULL || tv_is_luafunc(&item->di_tv)) {
return FAIL;
@@ -3780,37 +3784,32 @@ int eval_option(const char **const arg, typval_T *const rettv, const bool evalua
}
int ret = OK;
- bool hidden;
char c = *option_end;
*option_end = NUL;
- OptVal value = get_option_value(*arg, NULL, scope, &hidden);
- if (rettv != NULL) {
- switch (value.type) {
- case kOptValTypeNil:
+ bool is_tty_opt = is_tty_option(*arg);
+ OptIndex opt_idx = is_tty_opt ? kOptInvalid : findoption(*arg);
+
+ if (opt_idx == kOptInvalid && !is_tty_opt) {
+ // Only give error if result is going to be used.
+ if (rettv != NULL) {
semsg(_("E113: Unknown option: %s"), *arg);
- ret = FAIL;
- break;
- case kOptValTypeBoolean:
- rettv->v_type = VAR_NUMBER;
- rettv->vval.v_number = value.data.boolean;
- break;
- case kOptValTypeNumber:
- rettv->v_type = VAR_NUMBER;
- rettv->vval.v_number = value.data.number;
- break;
- case kOptValTypeString:
- rettv->v_type = VAR_STRING;
- rettv->vval.v_string = value.data.string.data;
- break;
}
- } else {
- // Value isn't being used, free it.
- optval_free(value);
- if (value.type == kOptValTypeNil || (working && hidden)) {
- ret = FAIL;
+ ret = FAIL;
+ } else if (rettv != NULL) {
+ OptVal value = is_tty_opt ? get_tty_option(*arg) : get_option_value(opt_idx, scope);
+ assert(value.type != kOptValTypeNil);
+
+ *rettv = optval_as_tv(value);
+
+ // Convert boolean option value to number for backwards compatibility.
+ if (rettv->v_type == VAR_BOOL) {
+ rettv->v_type = VAR_NUMBER;
+ rettv->vval.v_number = rettv->vval.v_bool == kBoolVarTrue ? 1 : 0;
}
+ } else if (working && !is_tty_opt && is_option_hidden(opt_idx)) {
+ ret = FAIL;
}
*option_end = c; // put back for error messages
@@ -4711,7 +4710,7 @@ bool set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
/// @param ht_stack Used to add hashtabs to be marked. Can be NULL.
///
/// @returns true if setting references failed somehow.
-bool set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack)
+bool set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack)
FUNC_ATTR_WARN_UNUSED_RESULT
{
bool abort = false;
@@ -4788,7 +4787,7 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack
// Didn't see this list yet.
ll->lv_copyID = copyID;
if (list_stack == NULL) {
- abort = set_ref_in_list(ll, copyID, ht_stack);
+ abort = set_ref_in_list_items(ll, copyID, ht_stack);
} else {
list_stack_T *const newitem = xmalloc(sizeof(list_stack_T));
newitem->list = ll;
@@ -5030,7 +5029,7 @@ size_t string2float(const char *const text, float_T *const ret_value)
return 3;
}
if (STRNICMP(text, "-inf", 3) == 0) {
- *ret_value = (float_T) - INFINITY;
+ *ret_value = (float_T)(-INFINITY);
return 4;
}
if (STRNICMP(text, "nan", 3) == 0) {
@@ -8716,7 +8715,7 @@ char *do_string_sub(char *str, char *pat, char *sub, typval_T *expr, const char
// If it's still empty it was changed and restored, need to restore in
// the complicated way.
if (*p_cpo == NUL) {
- set_option_value_give_err("cpo", CSTR_AS_OPTVAL(save_cpo), 0);
+ set_option_value_give_err(kOptCpoptions, CSTR_AS_OPTVAL(save_cpo), 0);
}
free_string_option(save_cpo);
}
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index 59423808be..51cf7bb0ea 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -5735,8 +5735,7 @@ M.funcs = {
Vim value. In the following cases it will output
|msgpack-special-dict|:
1. Dictionary contains duplicate key.
- 2. Dictionary contains empty key.
- 3. String contains NUL byte. Two special dictionaries: for
+ 2. String contains NUL byte. Two special dictionaries: for
dictionary and for string will be emitted in case string
with NUL byte was a dictionary key.
@@ -7155,7 +7154,6 @@ M.funcs = {
are binary strings).
2. String with NUL byte inside.
3. Duplicate key.
- 4. Empty key.
ext |List| with two values: first is a signed integer
representing extension type. Second is
|readfile()|-style list of strings.
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c
index a6407693d7..64b65b42a5 100644
--- a/src/nvim/eval/decode.c
+++ b/src/nvim/eval/decode.c
@@ -141,9 +141,7 @@ static inline int json_decoder_pop(ValuesStackItem obj, ValuesStack *const stack
ValuesStackItem key = kv_pop(*stack);
if (last_container.special_val == NULL) {
// These cases should have already been handled.
- assert(!(key.is_special_string
- || key.val.vval.v_string == NULL
- || *key.val.vval.v_string == NUL));
+ assert(!(key.is_special_string || key.val.vval.v_string == NULL));
dictitem_T *const obj_di = tv_dict_item_alloc(key.val.vval.v_string);
tv_clear(&key.val);
if (tv_dict_add(last_container.container.vval.v_dict, obj_di)
@@ -170,11 +168,10 @@ static inline int json_decoder_pop(ValuesStackItem obj, ValuesStack *const stack
tv_clear(&obj.val);
return FAIL;
}
- // Handle empty key and key represented as special dictionary
+ // Handle special dictionaries
if (last_container.special_val == NULL
&& (obj.is_special_string
|| obj.val.vval.v_string == NULL
- || *obj.val.vval.v_string == NUL
|| tv_dict_find(last_container.container.vval.v_dict, obj.val.vval.v_string, -1))) {
tv_clear(&obj.val);
@@ -404,13 +401,6 @@ static inline int parse_json_string(const char *const buf, const size_t buf_len,
semsg(_("E474: Expected string end: %.*s"), (int)buf_len, buf);
goto parse_json_string_fail;
}
- if (len == 0) {
- POP(((typval_T) {
- .v_type = VAR_STRING,
- .vval = { .v_string = NULL },
- }), false);
- goto parse_json_string_ret;
- }
char *str = xmalloc(len + 1);
int fst_in_pair = 0;
char *str_end = str;
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 0054c47678..c35e0b2ada 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -355,10 +355,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
goto end;
}
- if (!object_to_vim(result, rettv, &err)) {
- assert(ERROR_SET(&err));
- semsg(_("Error converting the call result: %s"), err.msg);
- }
+ object_to_vim(result, rettv, &err);
end:
api_free_array(args);
@@ -428,7 +425,7 @@ static void f_and(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
static void f_api_info(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
Dictionary metadata = api_metadata();
- (void)object_to_vim(DICTIONARY_OBJ(metadata), rettv, NULL);
+ object_to_vim(DICTIONARY_OBJ(metadata), rettv, NULL);
}
/// "atan2()" function
@@ -1023,7 +1020,7 @@ static void f_ctxget(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
Dictionary ctx_dict = ctx_to_dict(ctx);
Error err = ERROR_INIT;
- (void)object_to_vim(DICTIONARY_OBJ(ctx_dict), rettv, &err);
+ object_to_vim(DICTIONARY_OBJ(ctx_dict), rettv, &err);
api_free_dictionary(ctx_dict);
api_clear_error(&err);
}
@@ -2174,7 +2171,7 @@ static void f_float2nr(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
return;
}
- if (f <= (float_T) - VARNUMBER_MAX + DBL_EPSILON) {
+ if (f <= (float_T)(-VARNUMBER_MAX) + DBL_EPSILON) {
rettv->vval.v_number = -VARNUMBER_MAX;
} else if (f >= (float_T)VARNUMBER_MAX - DBL_EPSILON) {
rettv->vval.v_number = VARNUMBER_MAX;
@@ -3898,13 +3895,16 @@ static void f_jobresize(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
rettv->vval.v_number = 1;
}
-static const char *ignored_env_vars[] = {
+static const char *pty_ignored_env_vars[] = {
#ifndef MSWIN
"COLUMNS",
"LINES",
"TERMCAP",
"COLORFGBG",
+ "COLORTERM",
#endif
+ "VIM",
+ "VIMRUNTIME",
NULL
};
@@ -3943,9 +3943,9 @@ static dict_T *create_environment(const dictitem_T *job_env, const bool clear_en
// child process. We're removing them here so the user can still decide
// they want to explicitly set them.
for (size_t i = 0;
- i < ARRAY_SIZE(ignored_env_vars) && ignored_env_vars[i];
+ i < ARRAY_SIZE(pty_ignored_env_vars) && pty_ignored_env_vars[i];
i++) {
- dictitem_T *dv = tv_dict_find(env, ignored_env_vars[i], -1);
+ dictitem_T *dv = tv_dict_find(env, pty_ignored_env_vars[i], -1);
if (dv) {
tv_dict_item_remove(env, dv);
}
@@ -3953,10 +3953,6 @@ static dict_T *create_environment(const dictitem_T *job_env, const bool clear_en
#ifndef MSWIN
// Set COLORTERM to "truecolor" if termguicolors is set
if (p_tgc) {
- dictitem_T *dv = tv_dict_find(env, S_LEN("COLORTERM"));
- if (dv) {
- tv_dict_item_remove(env, dv);
- }
tv_dict_add_str(env, S_LEN("COLORTERM"), "truecolor");
}
#endif
@@ -6754,10 +6750,7 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
goto end;
}
- if (!object_to_vim(result, rettv, &err)) {
- assert(ERROR_SET(&err));
- semsg(_("Error converting the call result: %s"), err.msg);
- }
+ object_to_vim(result, rettv, &err);
end:
arena_mem_free(res_mem);
@@ -7246,7 +7239,7 @@ int do_searchpair(const char *spat, const char *mpat, const char *epat, int dir,
// If it's still empty it was changed and restored, need to restore in
// the complicated way.
if (*p_cpo == NUL) {
- set_option_value_give_err("cpo", CSTR_AS_OPTVAL(save_cpo), 0);
+ set_option_value_give_err(kOptCpoptions, CSTR_AS_OPTVAL(save_cpo), 0);
}
free_string_option(save_cpo);
}
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index e0bf30b158..ebc84922cb 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -3818,7 +3818,7 @@ bool set_ref_in_previous_funccal(int copyID)
fc->fc_copyID = copyID + 1;
if (set_ref_in_ht(&fc->fc_l_vars.dv_hashtab, copyID + 1, NULL)
|| set_ref_in_ht(&fc->fc_l_avars.dv_hashtab, copyID + 1, NULL)
- || set_ref_in_list(&fc->fc_l_varlist, copyID + 1, NULL)) {
+ || set_ref_in_list_items(&fc->fc_l_varlist, copyID + 1, NULL)) {
return true;
}
}
@@ -3831,7 +3831,7 @@ static bool set_ref_in_funccal(funccall_T *fc, int copyID)
fc->fc_copyID = copyID;
if (set_ref_in_ht(&fc->fc_l_vars.dv_hashtab, copyID, NULL)
|| set_ref_in_ht(&fc->fc_l_avars.dv_hashtab, copyID, NULL)
- || set_ref_in_list(&fc->fc_l_varlist, copyID, NULL)
+ || set_ref_in_list_items(&fc->fc_l_varlist, copyID, NULL)
|| set_ref_in_func(NULL, fc->fc_func, copyID)) {
return true;
}
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c
index 670ee39f4b..73c8ae1191 100644
--- a/src/nvim/eval/vars.c
+++ b/src/nvim/eval/vars.c
@@ -773,11 +773,14 @@ static char *ex_let_option(char *arg, typval_T *const tv, const bool is_const,
const char c1 = *p;
*p = NUL;
- uint32_t opt_p_flags;
- bool hidden;
- OptVal curval = get_option_value(arg, &opt_p_flags, scope, &hidden);
+ bool is_tty_opt = is_tty_option(arg);
+ OptIndex opt_idx = is_tty_opt ? kOptInvalid : findoption(arg);
+ uint32_t opt_p_flags = get_option_flags(opt_idx);
+ bool hidden = is_option_hidden(opt_idx);
+ OptVal curval = is_tty_opt ? get_tty_option(arg) : get_option_value(opt_idx, scope);
OptVal newval = NIL_OPTVAL;
- if (curval.type == kOptValTypeNil && arg[0] != 't' && arg[1] != '_') {
+
+ if (curval.type == kOptValTypeNil) {
semsg(_(e_unknown_option2), arg);
goto theend;
}
@@ -831,7 +834,7 @@ static char *ex_let_option(char *arg, typval_T *const tv, const bool is_const,
}
}
- const char *err = set_option_value(arg, newval, scope);
+ const char *err = set_option_value_handle_tty(arg, opt_idx, newval, scope);
arg_end = p;
if (err != NULL) {
emsg(_(err));
@@ -1937,20 +1940,23 @@ typval_T optval_as_tv(OptVal value)
/// Set option "varname" to the value of "varp" for the current buffer/window.
static void set_option_from_tv(const char *varname, typval_T *varp)
{
- int opt_idx = findoption(varname);
- if (opt_idx < 0) {
+ OptIndex opt_idx = findoption(varname);
+ if (opt_idx == kOptInvalid) {
semsg(_(e_unknown_option2), varname);
return;
}
- uint32_t opt_p_flags = get_option(opt_idx)->flags;
bool error = false;
+ uint32_t opt_p_flags = get_option_flags(opt_idx);
OptVal value = tv_to_optval(varp, varname, opt_p_flags, &error);
if (!error) {
- set_option_value_give_err(varname, value, OPT_LOCAL);
- }
+ const char *errmsg = set_option_value_handle_tty(varname, opt_idx, value, OPT_LOCAL);
+ if (errmsg) {
+ emsg(errmsg);
+ }
+ }
optval_free(value);
}
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 0711d82fe5..786612070e 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4265,7 +4265,7 @@ skip:
// Show 'inccommand' preview if there are matched lines.
if (cmdpreview_ns > 0 && !aborting()) {
if (got_quit || profile_passed_limit(timeout)) { // Too slow, disable.
- set_string_option_direct("icm", -1, "", OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptInccommand, "", OPT_FREE, SID_NONE);
} else if (*p_icm != NUL && pat != NULL) {
if (pre_hl_id == 0) {
pre_hl_id = syn_check_group(S_LEN("Substitute"));
@@ -4544,8 +4544,8 @@ bool prepare_tagpreview(bool undo_sync)
curwin->w_p_wfh = true;
RESET_BINDING(curwin); // don't take over 'scrollbind' and 'cursorbind'
curwin->w_p_diff = false; // no 'diff'
- set_string_option_direct("fdc", -1, // no 'foldcolumn'
- "0", OPT_FREE, SID_NONE);
+
+ set_string_option_direct(kOptFoldcolumn, "0", OPT_FREE, SID_NONE); // no 'foldcolumn'
return true;
}
@@ -4564,7 +4564,7 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
buf_T *cmdpreview_buf = NULL;
// disable file info message
- set_string_option_direct("shm", -1, "F", OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptShortmess, "F", OPT_FREE, SID_NONE);
// Update the topline to ensure that main window is on the correct line
update_topline(curwin);
@@ -4580,7 +4580,6 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
}
// Width of the "| lnum|..." column which displays the line numbers.
- linenr_T highest_num_line = 0;
int col_width = 0;
// Use preview window only when inccommand=split and range is not just the current line
bool preview = (*p_icm == 's') && (eap->line1 != old_cusr.lnum || eap->line2 != old_cusr.lnum);
@@ -4590,8 +4589,11 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
assert(cmdpreview_buf != NULL);
if (lines.subresults.size > 0) {
- highest_num_line = kv_last(lines.subresults).end.lnum;
- col_width = (int)log10(highest_num_line) + 1 + 3;
+ SubResult last_match = kv_last(lines.subresults);
+ // `last_match.end.lnum` may be 0 when using 'n' flag.
+ linenr_T highest_lnum = MAX(last_match.start.lnum, last_match.end.lnum);
+ assert(highest_lnum > 0);
+ col_width = (int)log10(highest_lnum) + 1 + 3;
}
}
@@ -4663,7 +4665,7 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
xfree(str);
- set_string_option_direct("shm", -1, save_shm_p, OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptShortmess, save_shm_p, OPT_FREE, SID_NONE);
xfree(save_shm_p);
return preview ? 2 : 1;
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 90b816bb6f..ff80ee9e54 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -2653,7 +2653,7 @@ static void apply_cmdmod(cmdmod_T *cmod)
// Set 'eventignore' to "all".
// First save the existing option value for restoring it later.
cmod->cmod_save_ei = xstrdup(p_ei);
- set_string_option_direct("ei", -1, "all", OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptEventignore, "all", OPT_FREE, SID_NONE);
}
}
@@ -2673,7 +2673,7 @@ void undo_cmdmod(cmdmod_T *cmod)
if (cmod->cmod_save_ei != NULL) {
// Restore 'eventignore' to the value before ":noautocmd".
- set_string_option_direct("ei", -1, cmod->cmod_save_ei, OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptEventignore, cmod->cmod_save_ei, OPT_FREE, SID_NONE);
free_string_option(cmod->cmod_save_ei);
cmod->cmod_save_ei = NULL;
}
@@ -7306,7 +7306,7 @@ static void ex_setfiletype(exarg_T *eap)
arg += 9;
}
- set_option_value_give_err("filetype", CSTR_AS_OPTVAL(arg), OPT_LOCAL);
+ set_option_value_give_err(kOptFiletype, CSTR_AS_OPTVAL(arg), OPT_LOCAL);
if (arg != eap->arg) {
did_filetype = false;
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index f31f8fec55..afaf0a6e2b 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -152,6 +152,8 @@ typedef struct cmdpreview_buf_info {
buf_T *buf;
OptInt save_b_p_ul;
int save_b_changed;
+ pos_T save_b_op_start;
+ pos_T save_b_op_end;
varnumber_T save_changedtick;
CpUndoInfo undo_info;
} CpBufInfo;
@@ -903,7 +905,7 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear
need_wait_return = false;
}
- set_string_option_direct("icm", -1, s->save_p_icm, OPT_FREE, SID_NONE);
+ set_string_option_direct(kOptInccommand, s->save_p_icm, OPT_FREE, SID_NONE);
State = s->save_State;
if (cmdpreview != save_cmdpreview) {
cmdpreview = save_cmdpreview; // restore preview state
@@ -2360,6 +2362,8 @@ static void cmdpreview_prepare(CpInfo *cpinfo)
cp_bufinfo.buf = buf;
cp_bufinfo.save_b_p_ul = buf->b_p_ul;
cp_bufinfo.save_b_changed = buf->b_changed;
+ cp_bufinfo.save_b_op_start = buf->b_op_start;
+ cp_bufinfo.save_b_op_end = buf->b_op_end;
cp_bufinfo.save_changedtick = buf_get_changedtick(buf);
cmdpreview_save_undo(&cp_bufinfo.undo_info, buf);
kv_push(cpinfo->buf_info, cp_bufinfo);
@@ -2438,6 +2442,9 @@ static void cmdpreview_restore_state(CpInfo *cpinfo)
u_blockfree(buf);
cmdpreview_restore_undo(&cp_bufinfo.undo_info, buf);
+ buf->b_op_start = cp_bufinfo.save_b_op_start;
+ buf->b_op_end = cp_bufinfo.save_b_op_end;
+
if (cp_bufinfo.save_changedtick != buf_get_changedtick(buf)) {
buf_set_changedtick(buf, cp_bufinfo.save_changedtick);
}
@@ -4319,7 +4326,7 @@ static int open_cmdwin(void)
return Ctrl_C;
}
// Command-line buffer has bufhidden=wipe, unlike a true "scratch" buffer.
- set_option_value_give_err("bh", STATIC_CSTR_AS_OPTVAL("wipe"), OPT_LOCAL);
+ set_option_value_give_err(kOptBufhidden, STATIC_CSTR_AS_OPTVAL("wipe"), OPT_LOCAL);
curbuf->b_p_ma = true;
curwin->w_p_fen = false;
curwin->w_p_rl = cmdmsg_rl;
@@ -4337,7 +4344,7 @@ static int open_cmdwin(void)
add_map("<Tab>", "<C-X><C-V>", MODE_INSERT, true);
add_map("<Tab>", "a<C-X><C-V>", MODE_NORMAL, true);
}
- set_option_value_give_err("ft", STATIC_CSTR_AS_OPTVAL("vim"), OPT_LOCAL);
+ set_option_value_give_err(kOptFiletype, STATIC_CSTR_AS_OPTVAL("vim"), OPT_LOCAL);
}
curbuf->b_ro_locked--;
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index f510845ec7..92fbc6fb79 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -67,18 +67,18 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col
} else {
assert(marktree_itr_valid(itr));
if (old_mark.pos.row == row && old_mark.pos.col == col) {
+ // not paired: we can revise in place
if (mt_decor_any(old_mark)) {
+ mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_DECOR_SIGNTEXT;
buf_decor_remove(buf, row, row, mt_decor(old_mark), true);
}
-
- // not paired: we can revise in place
mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_EXTERNAL_MASK;
mt_itr_rawkey(itr).flags |= flags;
mt_itr_rawkey(itr).decor_data = decor.data;
goto revised;
}
- buf_decor_remove(buf, old_mark.pos.row, old_mark.pos.row, mt_decor(old_mark), true);
marktree_del_itr(buf->b_marktree, itr, false);
+ buf_decor_remove(buf, old_mark.pos.row, old_mark.pos.row, mt_decor(old_mark), true);
}
} else {
*ns = MAX(*ns, id);
@@ -389,6 +389,9 @@ void extmark_apply_undo(ExtmarkUndoObject undo_info, bool undo)
} else if (undo_info.type == kExtmarkSavePos) {
ExtmarkSavePos pos = undo_info.data.savepos;
if (undo) {
+ if (pos.old_row >= 0) {
+ extmark_setraw(curbuf, pos.mark, pos.old_row, pos.old_col);
+ }
if (pos.invalidated) {
MarkTreeIter itr[1] = { 0 };
MTKey mark = marktree_lookup(curbuf->b_marktree, pos.mark, itr);
@@ -396,9 +399,6 @@ void extmark_apply_undo(ExtmarkUndoObject undo_info, bool undo)
MTPos end = marktree_get_altpos(curbuf->b_marktree, mark, itr);
buf_put_decor(curbuf, mt_decor(mark), mark.pos.row, end.row < 0 ? mark.pos.row : end.row);
}
- if (pos.old_row >= 0) {
- extmark_setraw(curbuf, pos.mark, pos.old_row, pos.old_col);
- }
// Redo
} else {
if (pos.row >= 0) {
@@ -515,20 +515,6 @@ void extmark_splice_impl(buf_T *buf, int start_row, colnr_T start_col, bcount_t
extmark_splice_delete(buf, start_row, start_col, end_row, end_col, uvp, false, undo);
}
- // Move the signcolumn sentinel line
- if (buf->b_signs_with_text && buf->b_signcols.sentinel) {
- linenr_T se_lnum = buf->b_signcols.sentinel;
- if (se_lnum >= start_row) {
- if (old_row != 0 && se_lnum > old_row + start_row) {
- buf->b_signcols.sentinel += new_row - old_row;
- } else if (new_row == 0) {
- buf->b_signcols.sentinel = 0;
- } else {
- buf->b_signcols.sentinel += new_row;
- }
- }
- }
-
marktree_splice(buf->b_marktree, (int32_t)start_row, start_col,
old_row, old_col,
new_row, new_col);
diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h
index 1a7a1ddeff..5ba079bd12 100644
--- a/src/nvim/extmark.h
+++ b/src/nvim/extmark.h
@@ -1,17 +1,15 @@
#pragma once
#include <stdbool.h>
-#include <stddef.h>
#include <stdint.h>
#include "klib/kvec.h"
-#include "nvim/buffer_defs.h"
-#include "nvim/decoration.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
+#include "nvim/decoration_defs.h" // IWYU pragma: keep
#include "nvim/extmark_defs.h" // IWYU pragma: export
#include "nvim/macros_defs.h"
-#include "nvim/marktree.h"
+#include "nvim/marktree_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h"
-#include "nvim/types_defs.h"
EXTERN int curbuf_splice_pending INIT( = 0);
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 4fe5b1cd44..0e2959835b 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1617,7 +1617,7 @@ failed:
save_file_ff(curbuf);
// If editing a new file: set 'fenc' for the current buffer.
// Also for ":read ++edit file".
- set_string_option_direct("fenc", -1, fenc, OPT_FREE | OPT_LOCAL, 0);
+ set_string_option_direct(kOptFileencoding, fenc, OPT_FREE | OPT_LOCAL, 0);
}
if (fenc_alloced) {
xfree(fenc);
@@ -1965,7 +1965,7 @@ void set_forced_fenc(exarg_T *eap)
}
char *fenc = enc_canonize(eap->cmd + eap->force_enc);
- set_string_option_direct("fenc", -1, fenc, OPT_FREE|OPT_LOCAL, 0);
+ set_string_option_direct(kOptFileencoding, fenc, OPT_FREE|OPT_LOCAL, 0);
xfree(fenc);
}
diff --git a/src/nvim/generators/gen_options.lua b/src/nvim/generators/gen_options.lua
index 3a355634f3..b7356a7bb1 100644
--- a/src/nvim/generators/gen_options.lua
+++ b/src/nvim/generators/gen_options.lua
@@ -1,4 +1,5 @@
local options_file = arg[1]
+local options_enum_file = arg[2]
local opt_fd = assert(io.open(options_file, 'w'))
@@ -41,6 +42,12 @@ local list_flags = {
flagscomma = 'P_COMMA|P_FLAGLIST',
}
+--- @param s string
+--- @return string
+local lowercase_to_titlecase = function(s)
+ return s:sub(1, 1):upper() .. s:sub(2)
+end
+
--- @param o vim.option_meta
--- @return string
local function get_flags(o)
@@ -222,11 +229,25 @@ static vimoption_T options[] = {]])
for i, o in ipairs(options.options) do
dump_option(i, o)
end
-w(' [' .. ('%u'):format(#options.options) .. ']={.fullname=NULL}')
w('};')
w('')
for _, v in ipairs(defines) do
w('#define ' .. v[1] .. ' ' .. v[2])
end
+
+-- Generate options enum file
+opt_fd = assert(io.open(options_enum_file, 'w'))
+
+w('typedef enum {')
+w(' kOptInvalid = -1,')
+
+for i, o in ipairs(options.options) do
+ w((' kOpt%s = %u,'):format(lowercase_to_titlecase(o.full_name), i - 1))
+end
+
+w(' // Option count, used when iterating through options')
+w('#define kOptIndexCount ' .. tostring(#options.options))
+w('} OptIndex;')
+
opt_fd:close()
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 1299aa12e5..c0fa63818e 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -672,7 +672,7 @@ EXTERN bool must_redraw_pum INIT( = false); // redraw pum. NB: must_redraw
EXTERN bool need_highlight_changed INIT( = true);
-EXTERN FILE *scriptout INIT( = NULL); ///< Stream to write script to.
+EXTERN FILE *scriptout INIT( = NULL); ///< Write input to this file ("nvim -w").
// Note that even when handling SIGINT, volatile is not necessary because the
// callback is not called directly from the signal handlers.
@@ -887,6 +887,7 @@ EXTERN const char e_invalblob[] INIT(= N_("E978: Invalid operation for Blob"));
EXTERN const char e_toomanyarg[] INIT(= N_("E118: Too many arguments for function: %s"));
EXTERN const char e_toofewarg[] INIT(= N_("E119: Not enough arguments for function: %s"));
EXTERN const char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
+EXTERN const char e_dictkey_len[] INIT(= N_("E716: Key not present in Dictionary: \"%.*s\""));
EXTERN const char e_listreq[] INIT(= N_("E714: List required"));
EXTERN const char e_listblobreq[] INIT(= N_("E897: List or Blob required"));
EXTERN const char e_listdictarg[] INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
diff --git a/src/nvim/help.c b/src/nvim/help.c
index dc4f6c44ff..28b95b2346 100644
--- a/src/nvim/help.c
+++ b/src/nvim/help.c
@@ -608,7 +608,7 @@ void cleanup_help_tags(int num_file, char **file)
void prepare_help_buffer(void)
{
curbuf->b_help = true;
- set_string_option_direct("buftype", -1, "help", OPT_FREE|OPT_LOCAL, 0);
+ set_string_option_direct(kOptBuftype, "help", OPT_FREE|OPT_LOCAL, 0);
// Always set these options after jumping to a help tag, because the
// user may have an autocommand that gets in the way.
@@ -617,13 +617,13 @@ void prepare_help_buffer(void)
// Only set it when needed, buf_init_chartab() is some work.
char *p = "!-~,^*,^|,^\",192-255";
if (strcmp(curbuf->b_p_isk, p) != 0) {
- set_string_option_direct("isk", -1, p, OPT_FREE|OPT_LOCAL, 0);
+ set_string_option_direct(kOptIskeyword, p, OPT_FREE|OPT_LOCAL, 0);
check_buf_options(curbuf);
(void)buf_init_chartab(curbuf, false);
}
// Don't use the global foldmethod.
- set_string_option_direct("fdm", -1, "manual", OPT_FREE|OPT_LOCAL, 0);
+ set_string_option_direct(kOptFoldmethod, "manual", OPT_FREE|OPT_LOCAL, 0);
curbuf->b_p_ts = 8; // 'tabstop' is 8.
curwin->w_p_list = false; // No list mode.
@@ -649,7 +649,7 @@ void fix_help_buffer(void)
// Set filetype to "help".
if (strcmp(curbuf->b_p_ft, "help") != 0) {
curbuf->b_ro_locked++;
- set_option_value_give_err("ft", STATIC_CSTR_AS_OPTVAL("help"), OPT_LOCAL);
+ set_option_value_give_err(kOptFiletype, STATIC_CSTR_AS_OPTVAL("help"), OPT_LOCAL);
curbuf->b_ro_locked--;
}
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 3bd4aa4f64..4add1e3591 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -1337,9 +1337,10 @@ void do_highlight(const char *line, const bool forceit, const bool init)
// wrong.
if (dark != -1
&& dark != (*p_bg == 'd')
- && !option_was_set("bg")) {
- set_option_value_give_err("bg", CSTR_AS_OPTVAL(dark ? "dark" : "light"), 0);
- reset_option_was_set("bg");
+ && !option_was_set(kOptBackground)) {
+ set_option_value_give_err(kOptBackground,
+ CSTR_AS_OPTVAL(dark ? "dark" : "light"), 0);
+ reset_option_was_set(kOptBackground);
}
}
}
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 5dced37b40..925317e7cb 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -1091,7 +1091,7 @@ void ex_retab(exarg_T *eap)
colnr_T *old_vts_ary = curbuf->b_p_vts_array;
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1) {
- set_string_option_direct("vts", -1, new_ts_str, OPT_FREE | OPT_LOCAL, 0);
+ set_string_option_direct(kOptVartabstop, new_ts_str, OPT_FREE | OPT_LOCAL, 0);
curbuf->b_p_vts_array = new_vts_array;
xfree(old_vts_ary);
} else {
@@ -1115,7 +1115,7 @@ int get_expr_indent(void)
colnr_T save_curswant;
int save_set_curswant;
int save_State;
- int use_sandbox = was_set_insecurely(curwin, "indentexpr", OPT_LOCAL);
+ int use_sandbox = was_set_insecurely(curwin, kOptIndentexpr, OPT_LOCAL);
const sctx_T save_sctx = current_sctx;
// Save and restore cursor position and curswant, in case it was changed
diff --git a/src/nvim/log.c b/src/nvim/log.c
index a93dab6238..4370693f49 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -295,7 +295,7 @@ static bool v_do_log_to_file(FILE *log_file, int log_level, const char *context,
FUNC_ATTR_PRINTF(7, 0)
{
// Name of the Nvim instance that produced the log.
- static char name[16] = { 0 };
+ static char name[32] = { 0 };
static const char *log_levels[] = {
[LOGLVL_DBG] = "DBG",
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c
index fd2bdbd677..e26e38f577 100644
--- a/src/nvim/lua/converter.c
+++ b/src/nvim/lua/converter.c
@@ -148,7 +148,7 @@ static LuaTableProps nlua_traverse_table(lua_State *const lstate)
}
} else {
if (tsize == 0
- || (tsize == ret.maxidx
+ || (tsize <= ret.maxidx
&& other_keys_num == 0
&& ret.string_keys_num == 0)) {
ret.type = kObjectTypeArray;
@@ -1129,10 +1129,6 @@ Object nlua_pop_Object(lua_State *const lstate, bool ref, Error *const err)
}
const size_t idx = cur.obj->data.array.size++;
lua_rawgeti(lstate, -1, (int)idx + 1);
- if (lua_isnil(lstate, -1)) {
- lua_pop(lstate, 2);
- continue;
- }
kvi_push(stack, cur);
cur = (ObjPopStackItem) {
.obj = &cur.obj->data.array.items[idx],
@@ -1258,7 +1254,7 @@ handle_T nlua_pop_handle(lua_State *lstate, Error *err)
handle_T ret;
if (lua_type(lstate, -1) != LUA_TNUMBER) {
api_set_error(err, kErrorTypeValidation, "Expected Lua number");
- ret = (handle_T) - 1;
+ ret = (handle_T)(-1);
} else {
ret = (handle_T)lua_tonumber(lstate, -1);
}
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index d63a9a1307..e665732c1a 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -115,7 +115,7 @@ lua_State *get_global_lstate(void)
/// Convert lua error into a Vim error message
///
/// @param lstate Lua interpreter state.
-/// @param[in] msg Message base, must contain one `%*s`.
+/// @param[in] msg Message base, must contain one `%.*s`.
void nlua_error(lua_State *const lstate, const char *const msg)
FUNC_ATTR_NONNULL_ALL
{
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c
index d7a7abe3c8..fc2fedeaa1 100644
--- a/src/nvim/lua/stdlib.c
+++ b/src/nvim/lua/stdlib.c
@@ -536,11 +536,14 @@ static int nlua_iconv(lua_State *lstate)
return 1;
}
-// Like 'zx' but don't call newFoldLevel()
+// Update foldlevels (e.g., by evaluating 'foldexpr') for all lines in the current window without
+// invoking other side effects. Unlike `zx`, it does not close manually opened folds and does not
+// open folds under the cursor.
static int nlua_foldupdate(lua_State *lstate)
{
curwin->w_foldinvalid = true; // recompute folds
- foldOpenCursor();
+ foldUpdate(curwin, 1, (linenr_T)MAXLNUM);
+ curwin->w_foldinvalid = false;
return 0;
}
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 216e39f3e8..521d67a638 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1123,7 +1123,7 @@ static void command_line_scan(mparm_T *parmp)
} else if (STRNICMP(argv[0] + argv_idx, "clean", 5) == 0) {
parmp->use_vimrc = "NONE";
parmp->clean = true;
- set_option_value_give_err("shadafile", STATIC_CSTR_AS_OPTVAL("NONE"), 0);
+ set_option_value_give_err(kOptShadafile, STATIC_CSTR_AS_OPTVAL("NONE"), 0);
} else if (STRNICMP(argv[0] + argv_idx, "luamod-dev", 9) == 0) {
nlua_disable_preload = true;
} else {
@@ -1137,7 +1137,7 @@ static void command_line_scan(mparm_T *parmp)
}
break;
case 'A': // "-A" start in Arabic mode.
- set_option_value_give_err("arabic", BOOLEAN_OPTVAL(true), 0);
+ set_option_value_give_err(kOptArabic, BOOLEAN_OPTVAL(true), 0);
break;
case 'b': // "-b" binary mode.
// Needs to be effective before expanding file names, because
@@ -1167,8 +1167,8 @@ static void command_line_scan(mparm_T *parmp)
usage();
os_exit(0);
case 'H': // "-H" start in Hebrew mode: rl + keymap=hebrew set.
- set_option_value_give_err("keymap", STATIC_CSTR_AS_OPTVAL("hebrew"), 0);
- set_option_value_give_err("rl", BOOLEAN_OPTVAL(true), 0);
+ set_option_value_give_err(kOptKeymap, STATIC_CSTR_AS_OPTVAL("hebrew"), 0);
+ set_option_value_give_err(kOptRightleft, BOOLEAN_OPTVAL(true), 0);
break;
case 'M': // "-M" no changes or writing of files
reset_modifiable();
@@ -1248,7 +1248,7 @@ static void command_line_scan(mparm_T *parmp)
// default is 10: a little bit verbose
p_verbose = get_number_arg(argv[0], &argv_idx, 10);
if (argv[0][argv_idx] != NUL) {
- set_option_value_give_err("verbosefile", CSTR_AS_OPTVAL(argv[0] + argv_idx), 0);
+ set_option_value_give_err(kOptVerbosefile, CSTR_AS_OPTVAL(argv[0] + argv_idx), 0);
argv_idx = (int)strlen(argv[0]);
}
break;
@@ -1256,7 +1256,7 @@ static void command_line_scan(mparm_T *parmp)
// "-w {scriptout}" write to script
if (ascii_isdigit((argv[0])[argv_idx])) {
n = get_number_arg(argv[0], &argv_idx, 10);
- set_option_value_give_err("window", NUMBER_OPTVAL((OptInt)n), 0);
+ set_option_value_give_err(kOptWindow, NUMBER_OPTVAL((OptInt)n), 0);
break;
}
want_argument = true;
@@ -1352,7 +1352,7 @@ static void command_line_scan(mparm_T *parmp)
break;
case 'i': // "-i {shada}" use for shada
- set_option_value_give_err("shadafile", CSTR_AS_OPTVAL(argv[0]), 0);
+ set_option_value_give_err(kOptShadafile, CSTR_AS_OPTVAL(argv[0]), 0);
break;
case 'l': // "-l" Lua script: args after "-l".
@@ -1362,7 +1362,7 @@ static void command_line_scan(mparm_T *parmp)
parmp->no_swap_file = true;
parmp->use_vimrc = parmp->use_vimrc ? parmp->use_vimrc : "NONE";
if (p_shadafile == NULL || *p_shadafile == NUL) {
- set_option_value_give_err("shadafile", STATIC_CSTR_AS_OPTVAL("NONE"), 0);
+ set_option_value_give_err(kOptShadafile, STATIC_CSTR_AS_OPTVAL("NONE"), 0);
}
parmp->luaf = argv[0];
argc--;
@@ -1398,7 +1398,7 @@ scripterror:
if (ascii_isdigit(*(argv[0]))) {
argv_idx = 0;
n = get_number_arg(argv[0], &argv_idx, 10);
- set_option_value_give_err("window", NUMBER_OPTVAL((OptInt)n), 0);
+ set_option_value_give_err(kOptWindow, NUMBER_OPTVAL((OptInt)n), 0);
argv_idx = -1;
break;
}
@@ -1549,7 +1549,7 @@ static void handle_quickfix(mparm_T *paramp)
{
if (paramp->edit_type == EDIT_QF) {
if (paramp->use_ef != NULL) {
- set_string_option_direct("ef", -1, paramp->use_ef, OPT_FREE, SID_CARG);
+ set_string_option_direct(kOptErrorfile, paramp->use_ef, OPT_FREE, SID_CARG);
}
vim_snprintf(IObuff, IOSIZE, "cfile %s", p_ef);
if (qf_init(NULL, p_ef, p_efm, true, IObuff, p_menc) < 0) {
@@ -1794,7 +1794,7 @@ static void edit_buffers(mparm_T *parmp, char *cwd)
p_shm_save = xstrdup(p_shm);
snprintf(buf, sizeof(buf), "F%s", p_shm);
- set_option_value_give_err("shm", CSTR_AS_OPTVAL(buf), 0);
+ set_option_value_give_err(kOptShortmess, CSTR_AS_OPTVAL(buf), 0);
}
} else {
if (curwin->w_next == NULL) { // just checking
@@ -1839,7 +1839,7 @@ static void edit_buffers(mparm_T *parmp, char *cwd)
}
if (p_shm_save != NULL) {
- set_option_value_give_err("shm", CSTR_AS_OPTVAL(p_shm_save), 0);
+ set_option_value_give_err(kOptShortmess, CSTR_AS_OPTVAL(p_shm_save), 0);
xfree(p_shm_save);
}
diff --git a/src/nvim/map.c b/src/nvim/map.c
index be6bf58daa..0011c97f9b 100644
--- a/src/nvim/map.c
+++ b/src/nvim/map.c
@@ -111,6 +111,9 @@ void mh_clear(MapHash *h)
#define VAL_NAME(x) quasiquote(x, String)
#include "nvim/map_value_impl.c.h"
#undef VAL_NAME
+#define VAL_NAME(x) quasiquote(x, SignRange)
+#include "nvim/map_value_impl.c.h"
+#undef VAL_NAME
#undef KEY_NAME
#define KEY_NAME(x) x##ptr_t
diff --git a/src/nvim/map_defs.h b/src/nvim/map_defs.h
index f3c4e4ea95..b85ba5acaf 100644
--- a/src/nvim/map_defs.h
+++ b/src/nvim/map_defs.h
@@ -48,6 +48,7 @@ static const uint64_t value_init_uint64_t = 0;
static const int64_t value_init_int64_t = 0;
static const String value_init_String = STRING_INIT;
static const ColorItem value_init_ColorItem = COLOR_ITEM_INITIALIZER;
+static const SignRange value_init_SignRange = SIGNRANGE_INIT;
// layer 0: type non-specific code
@@ -150,6 +151,7 @@ KEY_DECLS(uint32_t)
KEY_DECLS(String)
KEY_DECLS(HlEntry)
KEY_DECLS(ColorKey)
+KEY_DECLS(SignRange)
MAP_DECLS(int, int)
MAP_DECLS(int, ptr_t)
@@ -166,6 +168,7 @@ MAP_DECLS(uint32_t, uint32_t)
MAP_DECLS(String, int)
MAP_DECLS(int, String)
MAP_DECLS(ColorKey, ColorItem)
+MAP_DECLS(int, SignRange)
#define set_has(T, set, key) set_has_##T(set, key)
#define set_put(T, set, key) set_put_##T(set, key, NULL)
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 56544a9956..345ec45152 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -2199,7 +2199,7 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
Dictionary dict = mapblock_fill_dict(mp,
did_simplify ? keys_simplified : NULL,
buffer_local, abbr, true);
- (void)object_to_vim(DICTIONARY_OBJ(dict), rettv, NULL);
+ object_to_vim(DICTIONARY_OBJ(dict), rettv, NULL);
api_free_dictionary(dict);
} else {
// Return an empty dictionary.
@@ -2407,7 +2407,7 @@ void f_maplist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
did_simplify ? keys_buf : NULL,
buffer_local, abbr, true);
typval_T d = TV_INITIAL_VALUE;
- (void)object_to_vim(DICTIONARY_OBJ(dict), &d, NULL);
+ object_to_vim(DICTIONARY_OBJ(dict), &d, NULL);
assert(d.v_type == VAR_DICT);
tv_list_append_dict(rettv->vval.v_list, d.vval.v_dict);
api_free_dictionary(dict);
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 5839cf7a2e..1e2462970f 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -1288,12 +1288,12 @@ void mark_adjust_buf(buf_T *buf, linenr_T line1, linenr_T line2, linenr_T amount
if (posp->lnum == lnum && posp->col >= mincol) { \
posp->lnum += lnum_amount; \
assert(col_amount > INT_MIN && col_amount <= INT_MAX); \
- if (col_amount < 0 && posp->col <= (colnr_T) - col_amount) { \
+ if (col_amount < 0 && posp->col <= -col_amount) { \
posp->col = 0; \
} else if (posp->col < spaces_removed) { \
- posp->col = (int)col_amount + spaces_removed; \
+ posp->col = col_amount + spaces_removed; \
} else { \
- posp->col += (colnr_T)col_amount; \
+ posp->col += col_amount; \
} \
} \
}
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c
index f14da1b605..fa5e7dcbe2 100644
--- a/src/nvim/marktree.c
+++ b/src/nvim/marktree.c
@@ -50,15 +50,15 @@
#include <sys/types.h>
#include "klib/kvec.h"
-#include "nvim/garray.h"
+#include "nvim/macros_defs.h"
+#include "nvim/map_defs.h"
#include "nvim/marktree.h"
#include "nvim/memory.h"
#include "nvim/pos_defs.h"
// only for debug functions
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
-#include "nvim/garray_defs.h"
-#include "nvim/macros_defs.h"
+#include "nvim/garray.h"
#define T MT_BRANCH_FACTOR
#define ILEN (sizeof(MTNode) + (2 * T) * sizeof(void *))
@@ -2200,7 +2200,12 @@ String mt_inspect(MarkTree *b, bool keys, bool dot)
return ga_take_string(ga);
}
-void mt_inspect_node(MarkTree *b, garray_T *ga, bool keys, MTNode *n, MTPos off)
+static inline uint64_t mt_dbg_id(uint64_t id)
+{
+ return (id >> 1) & 0xffffffff;
+}
+
+static void mt_inspect_node(MarkTree *b, garray_T *ga, bool keys, MTNode *n, MTPos off)
{
static char buf[1024];
GA_PUT("[");
@@ -2240,7 +2245,7 @@ void mt_inspect_node(MarkTree *b, garray_T *ga, bool keys, MTNode *n, MTPos off)
ga_concat(ga, "]");
}
-void mt_inspect_dotfile_node(MarkTree *b, garray_T *ga, MTNode *n, MTPos off, char *parent)
+static void mt_inspect_dotfile_node(MarkTree *b, garray_T *ga, MTNode *n, MTPos off, char *parent)
{
static char buf[1024];
char namebuf[64];
diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h
index c76359d3f9..46d60a2b69 100644
--- a/src/nvim/marktree.h
+++ b/src/nvim/marktree.h
@@ -1,69 +1,15 @@
#pragma once
#include <stdbool.h>
-#include <stddef.h>
+#include <stddef.h> // IWYU pragma: keep
#include <stdint.h>
-#include "klib/kvec.h"
#include "nvim/decoration_defs.h"
-#include "nvim/garray_defs.h" // IWYU pragma: keep
-#include "nvim/map_defs.h"
+#include "nvim/marktree_defs.h" // IWYU pragma: export
#include "nvim/pos_defs.h" // IWYU pragma: keep
// only for debug functions:
#include "nvim/api/private/defs.h" // IWYU pragma: keep
-#define MT_MAX_DEPTH 20
-#define MT_BRANCH_FACTOR 10
-// note max branch is actually 2*MT_BRANCH_FACTOR
-// and strictly this is ceil(log2(2*MT_BRANCH_FACTOR + 1))
-// as we need a pseudo-index for "right before this node"
-#define MT_LOG2_BRANCH 5
-
-typedef struct {
- int32_t row;
- int32_t col;
-} MTPos;
-#define MTPos(r, c) ((MTPos){ .row = (r), .col = (c) })
-
-typedef struct mtnode_s MTNode;
-
-typedef struct {
- MTPos pos;
- int lvl;
- MTNode *x;
- int i;
- struct {
- int oldcol;
- int i;
- } s[MT_MAX_DEPTH];
-
- size_t intersect_idx;
- MTPos intersect_pos;
- MTPos intersect_pos_x;
-} MarkTreeIter;
-
-#define marktree_itr_valid(itr) ((itr)->x != NULL)
-// access raw key: flags in MT_FLAG_EXTERNAL_MASK and decor_data are safe to modify.
-#define mt_itr_rawkey(itr) ((itr)->x->key[(itr)->i])
-
-// Internal storage
-//
-// NB: actual marks have flags > 0, so we can use (row,col,0) pseudo-key for
-// "space before (row,col)"
-typedef struct {
- MTPos pos;
- uint32_t ns;
- uint32_t id;
- uint16_t flags;
- DecorInlineData decor_data; // "ext" tag in flags
-} MTKey;
-
-typedef struct {
- MTKey start;
- MTPos end_pos;
- bool end_right_gravity;
-} MTPair;
-
#define MT_INVALID_KEY (MTKey) { { -1, -1 }, 0, 0, 0, { .hl = DECOR_HIGHLIGHT_INLINE_INIT } }
#define MT_FLAG_REAL (((uint16_t)1) << 0)
@@ -179,31 +125,6 @@ static inline DecorInline mt_decor(MTKey key)
return (DecorInline){ .ext = key.flags & MT_FLAG_DECOR_EXT, .data = key.decor_data };
}
-typedef kvec_withinit_t(uint64_t, 4) Intersection;
-
-struct mtnode_s {
- int32_t n;
- int16_t level;
- int16_t p_idx; // index in parent
- Intersection intersect;
- // TODO(bfredl): we could consider having a only-sometimes-valid
- // index into parent for faster "cached" lookup.
- MTNode *parent;
- MTKey key[2 * MT_BRANCH_FACTOR - 1];
- MTNode *ptr[];
-};
-
-static inline uint64_t mt_dbg_id(uint64_t id)
-{
- return (id>>1)&0xffffffff;
-}
-
-typedef struct {
- MTNode *root;
- size_t n_keys, n_nodes;
- PMap(uint64_t) id2node[1];
-} MarkTree;
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "marktree.h.generated.h"
#endif
diff --git a/src/nvim/marktree_defs.h b/src/nvim/marktree_defs.h
new file mode 100644
index 0000000000..8aa1b1e376
--- /dev/null
+++ b/src/nvim/marktree_defs.h
@@ -0,0 +1,83 @@
+#pragma once
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "klib/kvec.h"
+#include "nvim/decoration_defs.h"
+#include "nvim/map_defs.h"
+
+enum {
+ MT_MAX_DEPTH = 20,
+ MT_BRANCH_FACTOR = 10,
+ // note max branch is actually 2*MT_BRANCH_FACTOR
+ // and strictly this is ceil(log2(2*MT_BRANCH_FACTOR + 1))
+ // as we need a pseudo-index for "right before this node"
+ MT_LOG2_BRANCH = 5,
+};
+
+typedef struct {
+ int32_t row;
+ int32_t col;
+} MTPos;
+#define MTPos(r, c) ((MTPos){ .row = (r), .col = (c) })
+
+typedef struct mtnode_s MTNode;
+
+typedef struct {
+ MTPos pos;
+ int lvl;
+ MTNode *x;
+ int i;
+ struct {
+ int oldcol;
+ int i;
+ } s[MT_MAX_DEPTH];
+
+ size_t intersect_idx;
+ MTPos intersect_pos;
+ MTPos intersect_pos_x;
+} MarkTreeIter;
+
+#define marktree_itr_valid(itr) ((itr)->x != NULL)
+// access raw key: flags in MT_FLAG_EXTERNAL_MASK and decor_data are safe to modify.
+#define mt_itr_rawkey(itr) ((itr)->x->key[(itr)->i])
+
+// Internal storage
+//
+// NB: actual marks have flags > 0, so we can use (row,col,0) pseudo-key for
+// "space before (row,col)"
+typedef struct {
+ MTPos pos;
+ uint32_t ns;
+ uint32_t id;
+ uint16_t flags;
+ DecorInlineData decor_data; // "ext" tag in flags
+} MTKey;
+
+typedef struct {
+ MTKey start;
+ MTPos end_pos;
+ bool end_right_gravity;
+} MTPair;
+
+typedef kvec_withinit_t(uint64_t, 4) Intersection;
+
+struct mtnode_s {
+ int32_t n;
+ int16_t level;
+ int16_t p_idx; // index in parent
+ Intersection intersect;
+ // TODO(bfredl): we could consider having a only-sometimes-valid
+ // index into parent for faster "cached" lookup.
+ MTNode *parent;
+ MTKey key[2 * MT_BRANCH_FACTOR - 1];
+ MTNode *ptr[];
+};
+
+typedef struct {
+ MTNode *root;
+ size_t n_keys, n_nodes;
+ PMap(uint64_t) id2node[1];
+} MarkTree;
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 709c7f3d40..38ac3b7bcf 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -974,7 +974,7 @@ void ml_recover(bool checkext)
set_fileformat(b0_ff - 1, OPT_LOCAL);
}
if (b0_fenc != NULL) {
- set_option_value_give_err("fenc", CSTR_AS_OPTVAL(b0_fenc), OPT_LOCAL);
+ set_option_value_give_err(kOptFileencoding, CSTR_AS_OPTVAL(b0_fenc), OPT_LOCAL);
xfree(b0_fenc);
}
unchanged(curbuf, true, true);
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 219532e45e..b9935d5b5d 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -2833,7 +2833,7 @@ static int do_more_prompt(int typed_char)
} else {
// redisplay all lines
// TODO(bfredl): this case is not optimized (though only concerns
- // event fragmentization, not unnecessary scroll events).
+ // event fragmentation, not unnecessary scroll events).
grid_fill(&msg_grid_adj, 0, Rows, 0, Columns, ' ', ' ',
HL_ATTR(HLF_MSG));
for (int i = 0; mp != NULL && i < Rows - 1; i++) {
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 227d064a27..12fb7d1f82 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -760,7 +760,7 @@ int win_col_off(win_T *wp)
return ((wp->w_p_nu || wp->w_p_rnu || *wp->w_p_stc != NUL)
? (number_width(wp) + (*wp->w_p_stc == NUL)) : 0)
+ ((cmdwin_type == 0 || wp != curwin) ? 0 : 1)
- + win_fdccol_count(wp) + (win_signcol_count(wp) * SIGN_WIDTH);
+ + win_fdccol_count(wp) + (wp->w_scwidth * SIGN_WIDTH);
}
int curwin_col_off(void)
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 3a4e87edf7..16aa46e97d 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -4630,13 +4630,13 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1)
if (!pre) {
if (subtract) {
if (n > oldn) {
- n = 1 + (n ^ (uvarnumber_T) - 1);
+ n = 1 + (n ^ (uvarnumber_T)(-1));
negative ^= true;
}
} else {
// add
if (n < oldn) {
- n = (n ^ (uvarnumber_T) - 1);
+ n = (n ^ (uvarnumber_T)(-1));
negative ^= true;
}
}
diff --git a/src/nvim/option.c b/src/nvim/option.c
index ba9d1262d4..6aa22c19af 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -156,19 +156,19 @@ typedef enum {
# include "options.generated.h"
#endif
-static char *(p_bin_dep_opts[]) = {
- "textwidth", "wrapmargin", "modeline", "expandtab", NULL
+static int p_bin_dep_opts[] = {
+ kOptTextwidth, kOptWrapmargin, kOptModeline, kOptExpandtab, kOptInvalid
};
-static char *(p_paste_dep_opts[]) = {
- "autoindent", "expandtab", "ruler", "showmatch", "smarttab",
- "softtabstop", "textwidth", "wrapmargin", "revins", "varsofttabstop", NULL
+
+static int p_paste_dep_opts[] = {
+ kOptAutoindent, kOptExpandtab, kOptRuler, kOptShowmatch, kOptSmarttab, kOptSofttabstop,
+ kOptTextwidth, kOptWrapmargin, kOptRevins, kOptVarsofttabstop, kOptInvalid
};
void set_init_tablocal(void)
{
// susy baka: cmdheight calls itself OPT_GLOBAL but is really tablocal!
- int ch_idx = findoption("cmdheight");
- p_ch = (OptInt)(intptr_t)options[ch_idx].def_val;
+ p_ch = (OptInt)(intptr_t)options[kOptCmdheight].def_val;
}
/// Initialize the 'shell' option to a default value.
@@ -182,9 +182,9 @@ static void set_init_default_shell(void)
const size_t len = strlen(shell) + 3; // two quotes and a trailing NUL
char *const cmd = xmalloc(len);
snprintf(cmd, len, "\"%s\"", shell);
- set_string_default("sh", cmd, true);
+ set_string_default(kOptShell, cmd, true);
} else {
- set_string_default("sh", (char *)shell, false);
+ set_string_default(kOptShell, (char *)shell, false);
}
}
}
@@ -199,7 +199,7 @@ static void set_init_default_backupskip(void)
static char *(names[3]) = { "TMPDIR", "TEMP", "TMP" };
#endif
garray_T ga;
- int opt_idx = findoption("backupskip");
+ OptIndex opt_idx = kOptBackupskip;
ga_init(&ga, 1, 100);
for (size_t n = 0; n < ARRAY_SIZE(names); n++) {
@@ -243,7 +243,7 @@ static void set_init_default_backupskip(void)
}
}
if (ga.ga_data != NULL) {
- set_string_default("bsk", ga.ga_data, true);
+ set_string_default(kOptBackupskip, ga.ga_data, true);
}
}
@@ -269,8 +269,8 @@ static void set_init_default_cdpath(void)
}
}
buf[j] = NUL;
- int opt_idx = findoption("cdpath");
- if (opt_idx >= 0) {
+ OptIndex opt_idx = kOptCdpath;
+ if (opt_idx != kOptInvalid) {
options[opt_idx].def_val = buf;
options[opt_idx].flags |= P_DEF_ALLOCED;
} else {
@@ -288,7 +288,7 @@ static void set_init_default_cdpath(void)
/// default.
static void set_init_expand_env(void)
{
- for (int opt_idx = 0; options[opt_idx].fullname; opt_idx++) {
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
vimoption_T *opt = &options[opt_idx];
if (opt->flags & P_NO_DEF_EXP) {
continue;
@@ -346,20 +346,20 @@ void set_init_1(bool clean_arg)
backupdir = xrealloc(backupdir, backupdir_len + 3);
memmove(backupdir + 2, backupdir, backupdir_len + 1);
memmove(backupdir, ".,", 2);
- set_string_default("backupdir", backupdir, true);
- set_string_default("viewdir", stdpaths_user_state_subpath("view", 2, true),
+ set_string_default(kOptBackupdir, backupdir, true);
+ set_string_default(kOptViewdir, stdpaths_user_state_subpath("view", 2, true),
true);
- set_string_default("directory", stdpaths_user_state_subpath("swap", 2, true),
+ set_string_default(kOptDirectory, stdpaths_user_state_subpath("swap", 2, true),
true);
- set_string_default("undodir", stdpaths_user_state_subpath("undo", 2, true),
+ set_string_default(kOptUndodir, stdpaths_user_state_subpath("undo", 2, true),
true);
// Set default for &runtimepath. All necessary expansions are performed in
// this function.
char *rtp = runtimepath_default(clean_arg);
if (rtp) {
- set_string_default("runtimepath", rtp, true);
+ set_string_default(kOptRuntimepath, rtp, true);
// Make a copy of 'rtp' for 'packpath'
- set_string_default("packpath", rtp, false);
+ set_string_default(kOptPackpath, rtp, false);
rtp = NULL; // ownership taken
}
@@ -398,7 +398,7 @@ void set_init_1(bool clean_arg)
// NOTE: mlterm's author is being asked to 'set' a variable
// instead of an environment variable due to inheritance.
if (os_env_exists("MLTERM")) {
- set_option_value_give_err("tbidi", BOOLEAN_OPTVAL(true), 0);
+ set_option_value_give_err(kOptTermbidi, BOOLEAN_OPTVAL(true), 0);
}
didset_options2();
@@ -420,7 +420,7 @@ void set_init_1(bool clean_arg)
/// This does not take care of side effects!
///
/// @param opt_flags OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL
-static void set_option_default(const int opt_idx, int opt_flags)
+static void set_option_default(const OptIndex opt_idx, int opt_flags)
{
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
@@ -430,10 +430,10 @@ static void set_option_default(const int opt_idx, int opt_flags)
uint32_t flags = opt->flags;
if (varp != NULL) { // skip hidden option, nothing to do for it
if (flags & P_STRING) {
- // Use set_string_option_direct() for local options to handle
- // freeing and allocating the value.
+ // Use set_string_option_direct() for local options to handle freeing and allocating the
+ // value.
if (opt->indir != PV_NONE) {
- set_string_option_direct(NULL, opt_idx, opt->def_val, opt_flags, 0);
+ set_string_option_direct(opt_idx, opt->def_val, opt_flags, 0);
} else {
if ((opt_flags & OPT_FREE) && (flags & P_ALLOCED)) {
free_string_option(*(char **)(varp));
@@ -479,7 +479,7 @@ static void set_option_default(const int opt_idx, int opt_flags)
*flagsp = *flagsp & ~P_INSECURE;
}
- set_option_sctx_idx(opt_idx, opt_flags, current_sctx);
+ set_option_sctx(opt_idx, opt_flags, current_sctx);
}
/// Set all options (except terminal options) to their default value.
@@ -487,9 +487,9 @@ static void set_option_default(const int opt_idx, int opt_flags)
/// @param opt_flags OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL
static void set_options_default(int opt_flags)
{
- for (int i = 0; options[i].fullname; i++) {
- if (!(options[i].flags & P_NODEFAULT)) {
- set_option_default(i, opt_flags);
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
+ if (!(options[opt_idx].flags & P_NODEFAULT)) {
+ set_option_default(opt_idx, opt_flags);
}
}
@@ -504,22 +504,23 @@ static void set_options_default(int opt_flags)
/// Set the Vi-default value of a string option.
/// Used for 'sh', 'backupskip' and 'term'.
///
-/// @param name The name of the option
-/// @param val The value of the option
-/// @param allocated If true, do not copy default as it was already allocated.
-static void set_string_default(const char *name, char *val, bool allocated)
+/// @param opt_idx Option index in options[] table.
+/// @param val The value of the option.
+/// @param allocated If true, do not copy default as it was already allocated.
+static void set_string_default(OptIndex opt_idx, char *val, bool allocated)
FUNC_ATTR_NONNULL_ALL
{
- int opt_idx = findoption(name);
- if (opt_idx >= 0) {
- vimoption_T *opt = &options[opt_idx];
- if (opt->flags & P_DEF_ALLOCED) {
- xfree(opt->def_val);
- }
+ if (opt_idx == kOptInvalid) {
+ return;
+ }
- opt->def_val = allocated ? val : xstrdup(val);
- opt->flags |= P_DEF_ALLOCED;
+ vimoption_T *opt = &options[opt_idx];
+ if (opt->flags & P_DEF_ALLOCED) {
+ xfree(opt->def_val);
}
+
+ opt->def_val = allocated ? val : xstrdup(val);
+ opt->flags |= P_DEF_ALLOCED;
}
/// For an option value that contains comma separated items, find "newval" in
@@ -555,10 +556,9 @@ static char *find_dup_item(char *origval, const char *newval, uint32_t flags)
/// Set the Vi-default value of a number option.
/// Used for 'lines' and 'columns'.
-void set_number_default(char *name, OptInt val)
+void set_number_default(OptIndex opt_idx, OptInt val)
{
- int opt_idx = findoption(name);
- if (opt_idx >= 0) {
+ if (opt_idx != kOptInvalid) {
options[opt_idx].def_val = (void *)(intptr_t)val;
}
}
@@ -567,18 +567,18 @@ void set_number_default(char *name, OptInt val)
/// Free all options.
void free_all_options(void)
{
- for (int i = 0; options[i].fullname; i++) {
- if (options[i].indir == PV_NONE) {
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
+ if (options[opt_idx].indir == PV_NONE) {
// global option: free value and default value.
- if ((options[i].flags & P_ALLOCED) && options[i].var != NULL) {
- optval_free(optval_from_varp(i, options[i].var));
+ if ((options[opt_idx].flags & P_ALLOCED) && options[opt_idx].var != NULL) {
+ optval_free(optval_from_varp(opt_idx, options[opt_idx].var));
}
- if (options[i].flags & P_DEF_ALLOCED) {
- optval_free(optval_from_varp(i, &options[i].def_val));
+ if (options[opt_idx].flags & P_DEF_ALLOCED) {
+ optval_free(optval_from_varp(opt_idx, &options[opt_idx].def_val));
}
- } else if (options[i].var != VAR_WIN) {
+ } else if (options[opt_idx].var != VAR_WIN) {
// buffer-local option: free global value
- optval_free(optval_from_varp(i, options[i].var));
+ optval_free(optval_from_varp(opt_idx, options[opt_idx].var));
}
}
free_operatorfunc_option();
@@ -597,18 +597,17 @@ void set_init_2(bool headless)
// 'scroll' defaults to half the window height. The stored default is zero,
// which results in the actual value computed from the window height.
- int idx = findoption("scroll");
- if (idx >= 0 && !(options[idx].flags & P_WAS_SET)) {
- set_option_default(idx, OPT_LOCAL);
+ if (!(options[kOptScroll].flags & P_WAS_SET)) {
+ set_option_default(kOptScroll, OPT_LOCAL);
}
comp_col();
// 'window' is only for backwards compatibility with Vi.
// Default is Rows - 1.
- if (!option_was_set("window")) {
+ if (!option_was_set(kOptWindow)) {
p_window = Rows - 1;
}
- set_number_default("window", Rows - 1);
+ set_number_default(kOptWindow, Rows - 1);
}
/// Initialize the options, part three: After reading the .vimrc
@@ -619,14 +618,8 @@ void set_init_3(void)
// Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
// This is done after other initializations, where 'shell' might have been
// set, but only if they have not been set before.
- int idx_srr = findoption("srr");
- int do_srr = (idx_srr < 0)
- ? false
- : !(options[idx_srr].flags & P_WAS_SET);
- int idx_sp = findoption("sp");
- int do_sp = (idx_sp < 0)
- ? false
- : !(options[idx_sp].flags & P_WAS_SET);
+ int do_srr = !(options[kOptShellredir].flags & P_WAS_SET);
+ int do_sp = !(options[kOptShellpipe].flags & P_WAS_SET);
size_t len = 0;
char *p = (char *)invocation_path_tail(p_sh, &len);
@@ -641,11 +634,11 @@ void set_init_3(void)
|| path_fnamecmp(p, "tcsh") == 0) {
if (do_sp) {
p_sp = "|& tee";
- options[idx_sp].def_val = p_sp;
+ options[kOptShellpipe].def_val = p_sp;
}
if (do_srr) {
p_srr = ">&";
- options[idx_srr].def_val = p_srr;
+ options[kOptShellredir].def_val = p_srr;
}
} else if (path_fnamecmp(p, "sh") == 0
|| path_fnamecmp(p, "ksh") == 0
@@ -660,11 +653,11 @@ void set_init_3(void)
// Always use POSIX shell style redirection if we reach this
if (do_sp) {
p_sp = "2>&1| tee";
- options[idx_sp].def_val = p_sp;
+ options[kOptShellpipe].def_val = p_sp;
}
if (do_srr) {
p_srr = ">%s 2>&1";
- options[idx_srr].def_val = p_srr;
+ options[kOptShellredir].def_val = p_srr;
}
}
xfree(p);
@@ -694,12 +687,11 @@ void set_helplang_default(const char *lang)
if (lang_len < 2) { // safety check
return;
}
- int idx = findoption("hlg");
- if (idx < 0 || (options[idx].flags & P_WAS_SET)) {
+ if (options[kOptHelplang].flags & P_WAS_SET) {
return;
}
- if (options[idx].flags & P_ALLOCED) {
+ if (options[kOptHelplang].flags & P_ALLOCED) {
free_string_option(p_hlg);
}
p_hlg = xmemdupz(lang, lang_len);
@@ -713,7 +705,7 @@ void set_helplang_default(const char *lang)
p_hlg[1] = 'n';
}
p_hlg[2] = NUL;
- options[idx].flags |= P_ALLOCED;
+ options[kOptHelplang].flags |= P_ALLOCED;
}
/// 'title' and 'icon' only default to true if they have not been set or reset
@@ -726,14 +718,12 @@ void set_title_defaults(void)
// If GUI is (going to be) used, we can always set the window title and
// icon name. Saves a bit of time, because the X11 display server does
// not need to be contacted.
- int idx1 = findoption("title");
- if (idx1 >= 0 && !(options[idx1].flags & P_WAS_SET)) {
- options[idx1].def_val = 0;
+ if (!(options[kOptTitle].flags & P_WAS_SET)) {
+ options[kOptTitle].def_val = 0;
p_title = 0;
}
- idx1 = findoption("icon");
- if (idx1 >= 0 && !(options[idx1].flags & P_WAS_SET)) {
- options[idx1].def_val = 0;
+ if (!(options[kOptIcon].flags & P_WAS_SET)) {
+ options[kOptIcon].def_val = 0;
p_icon = 0;
}
}
@@ -754,7 +744,7 @@ void ex_set(exarg_T *eap)
}
/// Get the default value for a string option.
-static char *stropt_get_default_val(int opt_idx, uint64_t flags)
+static char *stropt_get_default_val(OptIndex opt_idx, uint64_t flags)
{
char *newval = options[opt_idx].def_val;
// expand environment variables and ~ since the default value was
@@ -775,8 +765,7 @@ static char *stropt_get_default_val(int opt_idx, uint64_t flags)
}
/// Copy the new string value into allocated memory for the option.
-/// Can't use set_string_option_direct(), because we need to remove the
-/// backslashes.
+/// Can't use set_string_option_direct(), because we need to remove the backslashes.
static char *stropt_copy_value(char *origval, char **argp, set_op_T op,
uint32_t flags FUNC_ATTR_UNUSED)
{
@@ -824,7 +813,7 @@ static char *stropt_copy_value(char *origval, char **argp, set_op_T op,
}
/// Expand environment variables and ~ in string option value 'newval'.
-static char *stropt_expand_envvar(int opt_idx, char *origval, char *newval, set_op_T op)
+static char *stropt_expand_envvar(OptIndex opt_idx, char *origval, char *newval, set_op_T op)
{
char *s = option_expand(opt_idx, newval);
if (s == NULL) {
@@ -924,8 +913,8 @@ static void stropt_remove_dupflags(char *newval, uint32_t flags)
/// set {opt}<
/// set {opt}={val}
/// set {opt}:{val}
-static char *stropt_get_newval(int nextchar, int opt_idx, char **argp, void *varp, char *origval,
- set_op_T *op_arg, uint32_t flags)
+static char *stropt_get_newval(int nextchar, OptIndex opt_idx, char **argp, void *varp,
+ char *origval, set_op_T *op_arg, uint32_t flags)
{
char *arg = *argp;
set_op_T op = *op_arg;
@@ -1031,15 +1020,15 @@ static set_prefix_T get_option_prefix(char **argp)
/// @param[out] keyp
/// @param[out] len Length of option name
/// @return FAIL if an error is detected, OK otherwise
-static int parse_option_name(char *arg, int *keyp, int *lenp, int *opt_idxp)
+static int parse_option_name(char *arg, int *keyp, int *lenp, OptIndex *opt_idxp)
{
// find end of name
int key = 0;
int len;
- int opt_idx;
+ OptIndex opt_idx;
if (*arg == '<') {
- opt_idx = -1;
+ opt_idx = kOptInvalid;
// look out for <t_>;>
if (arg[1] == 't' && arg[2] == '_' && arg[3] && arg[4]) {
len = 5;
@@ -1056,7 +1045,7 @@ static int parse_option_name(char *arg, int *keyp, int *lenp, int *opt_idxp)
opt_idx = findoption_len(arg + 1, (size_t)(len - 1));
}
len++;
- if (opt_idx == -1) {
+ if (opt_idx == kOptInvalid) {
key = find_key_option(arg + 1, true);
}
} else {
@@ -1070,7 +1059,7 @@ static int parse_option_name(char *arg, int *keyp, int *lenp, int *opt_idxp)
}
}
opt_idx = findoption_len(arg, (size_t)len);
- if (opt_idx == -1) {
+ if (opt_idx == kOptInvalid) {
key = find_key_option(arg, false);
}
}
@@ -1082,7 +1071,7 @@ static int parse_option_name(char *arg, int *keyp, int *lenp, int *opt_idxp)
return OK;
}
-static int validate_opt_idx(win_T *win, int opt_idx, int opt_flags, uint32_t flags,
+static int validate_opt_idx(win_T *win, OptIndex opt_idx, int opt_flags, uint32_t flags,
set_prefix_T prefix, const char **errmsg)
{
// Only bools can have a prefix of 'inv' or 'no'
@@ -1094,12 +1083,12 @@ static int validate_opt_idx(win_T *win, int opt_idx, int opt_flags, uint32_t fla
// Skip all options that are not window-local (used when showing
// an already loaded buffer in a window).
if ((opt_flags & OPT_WINONLY)
- && (opt_idx < 0 || options[opt_idx].var != VAR_WIN)) {
+ && (opt_idx == kOptInvalid || options[opt_idx].var != VAR_WIN)) {
return FAIL;
}
// Skip all options that are window-local (used for :vimgrep).
- if ((opt_flags & OPT_NOWIN) && opt_idx >= 0
+ if ((opt_flags & OPT_NOWIN) && opt_idx != kOptInvalid
&& options[opt_idx].var == VAR_WIN) {
return FAIL;
}
@@ -1118,7 +1107,7 @@ static int validate_opt_idx(win_T *win, int opt_idx, int opt_flags, uint32_t fla
// 'foldmethod' becomes "marker" instead of "diff" and that
// "wrap" gets set.
if (win->w_p_diff
- && opt_idx >= 0 // shut up coverity warning
+ && opt_idx != kOptInvalid // shut up coverity warning
&& (options[opt_idx].indir == PV_FDM
|| options[opt_idx].indir == PV_WRAP)) {
return FAIL;
@@ -1135,7 +1124,7 @@ static int validate_opt_idx(win_T *win, int opt_idx, int opt_flags, uint32_t fla
}
/// Get new option value from argp. Allocated OptVal must be freed by caller.
-static OptVal get_option_newval(int opt_idx, int opt_flags, set_prefix_T prefix, char **argp,
+static OptVal get_option_newval(OptIndex opt_idx, int opt_flags, set_prefix_T prefix, char **argp,
int nextchar, set_op_T op, uint32_t flags, void *varp, char *errbuf,
const size_t errbuflen, const char **errmsg)
FUNC_ATTR_WARN_UNUSED_RESULT
@@ -1275,7 +1264,7 @@ static void do_one_set_option(int opt_flags, char **argp, bool *did_show, char *
// find end of name
int key = 0;
int len;
- int opt_idx;
+ OptIndex opt_idx;
if (parse_option_name(arg, &key, &len, &opt_idx) == FAIL) {
*errmsg = e_invarg;
return;
@@ -1296,7 +1285,7 @@ static void do_one_set_option(int opt_flags, char **argp, bool *did_show, char *
uint8_t nextchar = (uint8_t)arg[len]; // next non-white char after option name
- if (opt_idx == -1 && key == 0) { // found a mismatch: skip
+ if (opt_idx == kOptInvalid && key == 0) { // found a mismatch: skip
*errmsg = e_unknown_option;
return;
}
@@ -1304,7 +1293,7 @@ static void do_one_set_option(int opt_flags, char **argp, bool *did_show, char *
uint32_t flags; // flags for current option
void *varp = NULL; // pointer to variable for current option
- if (opt_idx >= 0) {
+ if (opt_idx != kOptInvalid) {
if (options[opt_idx].var == NULL) { // hidden option: skip
// Only give an error message when requesting the value of
// a hidden option, ignore setting it.
@@ -1357,7 +1346,7 @@ static void do_one_set_option(int opt_flags, char **argp, bool *did_show, char *
gotocmdline(true); // cursor at status line
*did_show = true; // remember that we did a line
}
- if (opt_idx >= 0) {
+ if (opt_idx != kOptInvalid) {
showoneopt(&options[opt_idx], opt_flags);
if (p_verbose > 0) {
// Mention where the option was last set.
@@ -1625,7 +1614,7 @@ char *find_shada_parameter(int type)
/// These string options cannot be indirect!
/// If "val" is NULL expand the current value of the option.
/// Return pointer to NameBuff, or NULL when not expanded.
-static char *option_expand(int opt_idx, char *val)
+static char *option_expand(OptIndex opt_idx, char *val)
{
// if option doesn't need expansion nothing to do
if (!(options[opt_idx].flags & P_EXPAND) || options[opt_idx].var == NULL) {
@@ -1700,33 +1689,33 @@ static void didset_options2(void)
/// Check for string options that are NULL (normally only termcap options).
void check_options(void)
{
- for (int opt_idx = 0; options[opt_idx].fullname != NULL; opt_idx++) {
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
if ((options[opt_idx].flags & P_STRING) && options[opt_idx].var != NULL) {
check_string_option((char **)get_varp(&(options[opt_idx])));
}
}
}
-/// Return true when option "opt" was set from a modeline or in secure mode.
-/// Return false when it wasn't.
-/// Return -1 for an unknown option.
-int was_set_insecurely(win_T *const wp, char *opt, int opt_flags)
+/// Check if option was set insecurely.
+///
+/// @param wp Window.
+/// @param opt_idx Option index in options[] table.
+/// @param opt_flags Option flags.
+///
+/// @return True if option was set from a modeline or in secure mode, false if it wasn't.
+int was_set_insecurely(win_T *const wp, OptIndex opt_idx, int opt_flags)
{
- int idx = findoption(opt);
+ assert(opt_idx != kOptInvalid);
- if (idx >= 0) {
- uint32_t *flagp = insecure_flag(wp, idx, opt_flags);
- return (*flagp & P_INSECURE) != 0;
- }
- internal_error("was_set_insecurely()");
- return -1;
+ uint32_t *flagp = insecure_flag(wp, opt_idx, opt_flags);
+ return (*flagp & P_INSECURE) != 0;
}
/// Get a pointer to the flags used for the P_INSECURE flag of option
/// "opt_idx". For some local options a local flags field is used.
/// NOTE: Caller must make sure that "wp" is set to the window from which
/// the option is used.
-uint32_t *insecure_flag(win_T *const wp, int opt_idx, int opt_flags)
+uint32_t *insecure_flag(win_T *const wp, OptIndex opt_idx, int opt_flags)
{
if (opt_flags & OPT_LOCAL) {
assert(wp != NULL);
@@ -1829,21 +1818,16 @@ bool parse_winhl_opt(win_T *wp)
return true;
}
-/// Get the script context of global option "name".
-sctx_T *get_option_sctx(const char *const name)
+/// Get the script context of global option at index opt_idx.
+sctx_T *get_option_sctx(OptIndex opt_idx)
{
- int idx = findoption(name);
-
- if (idx >= 0) {
- return &options[idx].last_set.script_ctx;
- }
- siemsg("no such option: %s", name);
- return NULL;
+ assert(opt_idx != kOptInvalid);
+ return &options[opt_idx].last_set.script_ctx;
}
/// Set the script_ctx for an option, taking care of setting the buffer- or
/// window-local value.
-void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
+void set_option_sctx(OptIndex opt_idx, int opt_flags, sctx_T script_ctx)
{
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
int indir = (int)options[opt_idx].indir;
@@ -1877,7 +1861,7 @@ void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
}
/// Apply the OptionSet autocommand.
-static void apply_optionset_autocmd(int opt_idx, int opt_flags, OptVal oldval, OptVal oldval_g,
+static void apply_optionset_autocmd(OptIndex opt_idx, int opt_flags, OptVal oldval, OptVal oldval_g,
OptVal oldval_l, OptVal newval, const char *errmsg)
{
// Don't do this while starting up, failure or recursively.
@@ -1952,7 +1936,7 @@ static const char *did_set_arabic(optset_T *args)
p_deco = true;
// Force-set the necessary keymap for arabic.
- errmsg = set_option_value("keymap", STATIC_CSTR_AS_OPTVAL("arabic"), OPT_LOCAL);
+ errmsg = set_option_value(kOptKeymap, STATIC_CSTR_AS_OPTVAL("arabic"), OPT_LOCAL);
} else {
// 'arabic' is reset, handle various sub-settings.
if (!p_tbidi) {
@@ -2809,7 +2793,7 @@ static const char *check_num_option_bounds(OptInt *pp, OptInt old_value, char *e
cmdline_row = new_row;
}
}
- if (p_window >= Rows || !option_was_set("window")) {
+ if (p_window >= Rows || !option_was_set(kOptWindow)) {
p_window = Rows - 1;
}
}
@@ -3029,8 +3013,8 @@ void check_redraw(uint32_t flags)
/// @param[in] arg Option to find index for.
/// @param[in] len Length of the option.
///
-/// @return Index of the option or -1 if option was not found.
-int findoption_len(const char *const arg, const size_t len)
+/// @return Index of the option or kOptInvalid if option was not found.
+OptIndex findoption_len(const char *const arg, const size_t len)
{
const char *s;
static int quick_tab[27] = { 0, 0 }; // quick access table
@@ -3040,7 +3024,9 @@ int findoption_len(const char *const arg, const size_t len)
// letter. There are 26 letters, plus the first "t_" option.
if (quick_tab[1] == 0) {
const char *p = options[0].fullname;
- for (uint16_t i = 1; (s = options[i].fullname) != NULL; i++) {
+ for (OptIndex i = 1; i < kOptIndexCount; i++) {
+ s = options[i].fullname;
+
if (s[0] != p[0]) {
if (s[0] == 't' && s[1] == '_') {
quick_tab[26] = i;
@@ -3054,10 +3040,10 @@ int findoption_len(const char *const arg, const size_t len)
// Check for name starting with an illegal character.
if (len == 0 || arg[0] < 'a' || arg[0] > 'z') {
- return -1;
+ return kOptInvalid;
}
- int opt_idx;
+ OptIndex opt_idx;
const bool is_term_opt = (len > 2 && arg[0] == 't' && arg[1] == '_');
if (is_term_opt) {
opt_idx = quick_tab[26];
@@ -3065,24 +3051,31 @@ int findoption_len(const char *const arg, const size_t len)
opt_idx = quick_tab[CHAR_ORD_LOW(arg[0])];
}
// Match full name
- for (; (s = options[opt_idx].fullname) != NULL; opt_idx++) {
+ for (; opt_idx < kOptIndexCount; opt_idx++) {
+ s = options[opt_idx].fullname;
+
+ // Break if first character no longer matches.
+ if (s[0] != arg[0]) {
+ opt_idx = kOptIndexCount;
+ break;
+ }
+
if (strncmp(arg, s, len) == 0 && s[len] == NUL) {
break;
}
}
- if (s == NULL && !is_term_opt) {
+ if (opt_idx == kOptIndexCount && !is_term_opt) {
opt_idx = quick_tab[CHAR_ORD_LOW(arg[0])];
// Match short name
- for (; options[opt_idx].fullname != NULL; opt_idx++) {
+ for (; opt_idx < kOptIndexCount; opt_idx++) {
s = options[opt_idx].shortname;
if (s != NULL && strncmp(arg, s, len) == 0 && s[len] == NUL) {
break;
}
- s = NULL;
}
}
- if (s == NULL) {
- opt_idx = -1;
+ if (opt_idx == kOptIndexCount) {
+ opt_idx = kOptInvalid;
} else {
// Nvim: handle option aliases.
if (strncmp(options[opt_idx].fullname, "viminfo", 7) == 0) {
@@ -3099,51 +3092,36 @@ int findoption_len(const char *const arg, const size_t len)
bool is_tty_option(const char *name)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
- return (name[0] == 't' && name[1] == '_')
- || strequal(name, "term")
- || strequal(name, "ttytype");
+ return (name[0] == 't' && name[1] == '_') || strequal(name, "term") || strequal(name, "ttytype");
}
#define TCO_BUFFER_SIZE 8
-/// @param name TUI-related option
-/// @param[out,allocated] value option string value
-bool get_tty_option(const char *name, char **value)
+/// Get value of TTY option.
+///
+/// @param name Name of TTY option.
+///
+/// @return [allocated] TTY option value. Returns NIL_OPTVAL if option isn't a TTY option.
+OptVal get_tty_option(const char *name)
{
- if (strequal(name, "t_Co")) {
- if (value) {
- if (t_colors <= 1) {
- *value = xstrdup("");
- } else {
- *value = xmalloc(TCO_BUFFER_SIZE);
- snprintf(*value, TCO_BUFFER_SIZE, "%d", t_colors);
- }
- }
- return true;
- }
-
- if (strequal(name, "term")) {
- if (value) {
- *value = p_term ? xstrdup(p_term) : xstrdup("nvim");
- }
- return true;
- }
-
- if (strequal(name, "ttytype")) {
- if (value) {
- *value = p_ttytype ? xstrdup(p_ttytype) : xstrdup("nvim");
- }
- return true;
- }
+ char *value = NULL;
- if (is_tty_option(name)) {
- if (value) {
- // XXX: All other t_* options were removed in 3baba1e7.
- *value = xstrdup("");
+ if (strequal(name, "t_Co")) {
+ if (t_colors <= 1) {
+ value = xstrdup("");
+ } else {
+ value = xmalloc(TCO_BUFFER_SIZE);
+ snprintf(value, TCO_BUFFER_SIZE, "%d", t_colors);
}
- return true;
+ } else if (strequal(name, "term")) {
+ value = p_term ? xstrdup(p_term) : xstrdup("nvim");
+ } else if (strequal(name, "ttytype")) {
+ value = p_ttytype ? xstrdup(p_ttytype) : xstrdup("nvim");
+ } else if (is_tty_option(name)) {
+ // XXX: All other t_* options were removed in 3baba1e7.
+ value = xstrdup("");
}
- return false;
+ return value == NULL ? NIL_OPTVAL : CSTR_AS_OPTVAL(value);
}
bool set_tty_option(const char *name, char *value)
@@ -3171,8 +3149,8 @@ bool set_tty_option(const char *name, char *value)
///
/// @param[in] arg Option name.
///
-/// @return Option index or -1 if option was not found.
-int findoption(const char *const arg)
+/// @return Option index or kOptInvalid if option was not found.
+OptIndex findoption(const char *const arg)
FUNC_ATTR_NONNULL_ALL
{
return findoption_len(arg, strlen(arg));
@@ -3232,9 +3210,9 @@ bool optval_equal(OptVal o1, OptVal o2)
/// Match type of OptVal with the type of the target option. Returns true if the types match and
/// false otherwise.
-static bool optval_match_type(OptVal o, int opt_idx)
+static bool optval_match_type(OptVal o, OptIndex opt_idx)
{
- assert(opt_idx >= 0);
+ assert(opt_idx != kOptInvalid);
uint32_t flags = options[opt_idx].flags;
switch (o.type) {
@@ -3254,7 +3232,7 @@ static bool optval_match_type(OptVal o, int opt_idx)
///
/// @param opt_idx Option index in options[] table.
/// @param[out] varp Pointer to option variable.
-OptVal optval_from_varp(int opt_idx, void *varp)
+OptVal optval_from_varp(OptIndex opt_idx, void *varp)
{
// Special case: 'modified' is b_changed, but we also want to consider it set when 'ff' or 'fenc'
// changed.
@@ -3294,7 +3272,7 @@ OptVal optval_from_varp(int opt_idx, void *varp)
/// @param[out] varp Pointer to option variable.
/// @param[in] value New option value.
/// @param free_oldval Free old value.
-static void set_option_varp(int opt_idx, void *varp, OptVal value, bool free_oldval)
+static void set_option_varp(OptIndex opt_idx, void *varp, OptVal value, bool free_oldval)
FUNC_ATTR_NONNULL_ARG(2)
{
assert(optval_match_type(value, opt_idx));
@@ -3390,7 +3368,7 @@ OptVal object_as_optval(Object o, bool *error)
/// @param[in] varp Pointer to option variable.
///
/// @return [allocated] Option value equal to the unset value for the option.
-static OptVal optval_unset_local(int opt_idx, void *varp)
+static OptVal optval_unset_local(OptIndex opt_idx, void *varp)
{
vimoption_T *opt = &options[opt_idx];
// For global-local options, use the unset value of the local value.
@@ -3412,14 +3390,14 @@ static OptVal optval_unset_local(int opt_idx, void *varp)
}
}
// For options that aren't global-local, just set the local value to the global value.
- return get_option_value(opt->fullname, NULL, OPT_GLOBAL, NULL);
+ return get_option_value(opt_idx, OPT_GLOBAL);
}
/// Get an allocated string containing a list of valid types for an option.
/// For options with a singular type, it returns the name of the type. For options with multiple
/// possible types, it returns a slash separated list of types. For example, if an option can be a
/// number, boolean or string, the function returns "Number/Boolean/String"
-static char *option_get_valid_types(int opt_idx)
+static char *option_get_valid_types(OptIndex opt_idx)
{
uint32_t flags = options[opt_idx].flags;
uint32_t type_count = 0;
@@ -3458,52 +3436,48 @@ static char *option_get_valid_types(int opt_idx)
#undef OPTION_ADD_TYPE
}
-/// Gets the value for an option.
+/// Check if option is hidden.
///
-/// @param[in] name Option name.
-/// @param[out] flagsp Set to the option flags (P_xxxx) (if not NULL).
-/// @param[in] scope Option scope (can be OPT_LOCAL, OPT_GLOBAL or a combination).
-/// @param[out] hidden Whether option is hidden.
+/// @param opt_idx Option index in options[] table.
///
-/// @return [allocated] Option value. Returns NIL_OPTVAL for invalid options.
-OptVal get_option_value(const char *name, uint32_t *flagsp, int scope, bool *hidden)
+/// @return True if option is hidden, false otherwise. Returns false if option name is invalid.
+bool is_option_hidden(OptIndex opt_idx)
{
- // Make sure that hidden and flagsp are never returned uninitialized
- if (hidden != NULL) {
- *hidden = false;
- }
- if (flagsp != NULL) {
- *flagsp = 0;
- }
+ return opt_idx == kOptInvalid ? false : get_varp(&options[opt_idx]) == NULL;
+}
- char *str;
- if (get_tty_option(name, &str)) {
- return CSTR_AS_OPTVAL(str);
- }
+/// Get option flags.
+///
+/// @param opt_idx Option index in options[] table.
+///
+/// @return Option flags. Returns 0 for invalid option name.
+uint32_t get_option_flags(OptIndex opt_idx)
+{
+ return opt_idx == kOptInvalid ? 0 : options[opt_idx].flags;
+}
- int opt_idx = findoption(name);
- if (opt_idx < 0) { // option not in the table
+/// Gets the value for an option.
+///
+/// @param opt_idx Option index in options[] table.
+/// @param[in] scope Option scope (can be OPT_LOCAL, OPT_GLOBAL or a combination).
+///
+/// @return [allocated] Option value. Returns NIL_OPTVAL for invalid option index.
+OptVal get_option_value(OptIndex opt_idx, int scope)
+{
+ if (opt_idx == kOptInvalid) { // option not in the options[] table.
return NIL_OPTVAL;
}
vimoption_T *opt = &options[opt_idx];
void *varp = get_varp_scope(opt, scope);
- if (hidden != NULL) {
- *hidden = varp == NULL;
- }
-
- if (flagsp != NULL) {
- // Return the P_xxxx option flags.
- *flagsp = opt->flags;
- }
-
return optval_copy(optval_from_varp(opt_idx, varp));
}
/// Return information for option at 'opt_idx'
-vimoption_T *get_option(int opt_idx)
+vimoption_T *get_option(OptIndex opt_idx)
{
+ assert(opt_idx != kOptInvalid);
return &options[opt_idx];
}
@@ -3529,7 +3503,7 @@ static bool is_option_local_value_unset(vimoption_T *opt, buf_T *buf, win_T *win
/// Handle side-effects of setting an option.
///
-/// @param opt_idx Index in options[] table. Must be >= 0.
+/// @param opt_idx Index in options[] table. Must not be kOptInvalid.
/// @param[in] varp Option variable pointer, cannot be NULL.
/// @param old_value Old option value.
/// @param new_value New option value.
@@ -3540,7 +3514,7 @@ static bool is_option_local_value_unset(vimoption_T *opt, buf_T *buf, win_T *win
/// @param errbuflen Length of error buffer.
///
/// @return NULL on success, an untranslated error message on error.
-static const char *did_set_option(int opt_idx, void *varp, OptVal old_value, OptVal new_value,
+static const char *did_set_option(OptIndex opt_idx, void *varp, OptVal old_value, OptVal new_value,
int opt_flags, bool *value_checked, bool value_replaced,
char *errbuf, size_t errbuflen)
{
@@ -3607,7 +3581,7 @@ static const char *did_set_option(int opt_idx, void *varp, OptVal old_value, Opt
new_value = optval_from_varp(opt_idx, varp);
// Remember where the option was set.
- set_option_sctx_idx(opt_idx, opt_flags, current_sctx);
+ set_option_sctx(opt_idx, opt_flags, current_sctx);
// Free options that are in allocated memory.
// Use "free_oldval", because recursiveness may change the flags (esp. init_highlight()).
if (free_oldval) {
@@ -3687,7 +3661,7 @@ static const char *did_set_option(int opt_idx, void *varp, OptVal old_value, Opt
/// Set the value of an option using an OptVal.
///
-/// @param opt_idx Index in options[] table. Must be >= 0.
+/// @param opt_idx Index in options[] table. Must not be kOptInvalid.
/// @param[in] varp Option variable pointer, cannot be NULL.
/// @param value New option value. Might get freed.
/// @param opt_flags Option flags.
@@ -3696,10 +3670,10 @@ static const char *did_set_option(int opt_idx, void *varp, OptVal old_value, Opt
/// @param errbuflen Length of error buffer.
///
/// @return NULL on success, an untranslated error message on error.
-static const char *set_option(const int opt_idx, void *varp, OptVal value, int opt_flags,
+static const char *set_option(const OptIndex opt_idx, void *varp, OptVal value, int opt_flags,
const bool value_replaced, char *errbuf, size_t errbuflen)
{
- assert(opt_idx >= 0 && varp != NULL);
+ assert(opt_idx != kOptInvalid && varp != NULL);
const char *errmsg = NULL;
bool value_checked = false;
@@ -3827,29 +3801,20 @@ err:
return errmsg;
}
-/// Set the value of an option
+/// Set the value of an option.
///
-/// @param[in] name Option name.
+/// @param opt_idx Index in options[] table. Must not be kOptInvalid.
/// @param[in] value Option value. If NIL_OPTVAL, the option value is cleared.
/// @param[in] opt_flags Flags: OPT_LOCAL, OPT_GLOBAL, or 0 (both).
///
/// @return NULL on success, an untranslated error message on error.
-const char *set_option_value(const char *const name, const OptVal value, int opt_flags)
- FUNC_ATTR_NONNULL_ARG(1)
+const char *set_option_value(const OptIndex opt_idx, const OptVal value, int opt_flags)
{
- static char errbuf[IOSIZE];
-
- if (is_tty_option(name)) {
- return NULL; // Fail silently; many old vimrcs set t_xx options.
- }
-
- int opt_idx = findoption(name);
- if (opt_idx < 0) {
- snprintf(errbuf, sizeof(errbuf), _(e_unknown_option2), name);
- return errbuf;
- }
+ assert(opt_idx != kOptInvalid);
+ static char errbuf[IOSIZE];
uint32_t flags = options[opt_idx].flags;
+
// Disallow changing some options in the sandbox
if (sandbox > 0 && (flags & P_SECURE)) {
return _(e_sandbox);
@@ -3861,31 +3826,51 @@ const char *set_option_value(const char *const name, const OptVal value, int opt
return NULL;
}
- const char *errmsg = NULL;
+ return set_option(opt_idx, varp, optval_copy(value), opt_flags, true, errbuf, sizeof(errbuf));
+}
- errmsg = set_option(opt_idx, varp, optval_copy(value), opt_flags, true, errbuf, sizeof(errbuf));
+/// Set the value of an option. Supports TTY options, unlike set_option_value().
+///
+/// @param name Option name. Used for error messages and for setting TTY options.
+/// @param opt_idx Option indx in options[] table. If less than zero, `name` is used to
+/// check if the option is a TTY option, and an error is shown if it's not.
+/// If the option is a TTY option, the function fails silently.
+/// @param value Option value. If NIL_OPTVAL, the option value is cleared.
+/// @param[in] opt_flags Flags: OPT_LOCAL, OPT_GLOBAL, or 0 (both).
+///
+/// @return NULL on success, an untranslated error message on error.
+const char *set_option_value_handle_tty(const char *name, OptIndex opt_idx, const OptVal value,
+ int opt_flags)
+ FUNC_ATTR_NONNULL_ARG(1)
+{
+ static char errbuf[IOSIZE];
- return errmsg;
+ if (opt_idx == kOptInvalid) {
+ if (is_tty_option(name)) {
+ return NULL; // Fail silently; many old vimrcs set t_xx options.
+ }
+
+ snprintf(errbuf, sizeof(errbuf), _(e_unknown_option2), name);
+ return errbuf;
+ }
+
+ return set_option_value(opt_idx, value, opt_flags);
}
-/// Call set_option_value() and when an error is returned report it.
+/// Call set_option_value() and when an error is returned, report it.
///
-/// @param opt_flags OPT_LOCAL or 0 (both)
-void set_option_value_give_err(const char *name, OptVal value, int opt_flags)
+/// @param opt_idx Option index in options[] table.
+/// @param value Option value. If NIL_OPTVAL, the option value is cleared.
+/// @param opt_flags OPT_LOCAL or 0 (both)
+void set_option_value_give_err(const OptIndex opt_idx, OptVal value, int opt_flags)
{
- const char *errmsg = set_option_value(name, value, opt_flags);
+ const char *errmsg = set_option_value(opt_idx, value, opt_flags);
if (errmsg != NULL) {
emsg(_(errmsg));
}
}
-bool is_option_allocated(const char *name)
-{
- int idx = findoption(name);
- return idx >= 0 && (options[idx].flags & P_ALLOCED);
-}
-
// Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number.
// When "has_lt" is true there is a '<' before "*arg_arg".
// Returns 0 when the key is not recognized.
@@ -3942,33 +3927,35 @@ static void showoptions(bool all, int opt_flags)
for (int run = 1; run <= 2 && !got_int; run++) {
// collect the items in items[]
int item_count = 0;
- for (vimoption_T *p = &options[0]; p->fullname != NULL; p++) {
+ vimoption_T *opt;
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
+ opt = &options[opt_idx];
// apply :filter /pat/
- if (message_filtered(p->fullname)) {
+ if (message_filtered(opt->fullname)) {
continue;
}
void *varp = NULL;
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) != 0) {
- if (p->indir != PV_NONE) {
- varp = get_varp_scope(p, opt_flags);
+ if (opt->indir != PV_NONE) {
+ varp = get_varp_scope(opt, opt_flags);
}
} else {
- varp = get_varp(p);
+ varp = get_varp(opt);
}
- if (varp != NULL && (all || !optval_default(p, varp))) {
+ if (varp != NULL && (all || !optval_default(opt, varp))) {
int len;
if (opt_flags & OPT_ONECOLUMN) {
len = Columns;
- } else if (p->flags & P_BOOL) {
+ } else if (opt->flags & P_BOOL) {
len = 1; // a toggle option fits always
} else {
- option_value2string(p, opt_flags);
- len = (int)strlen(p->fullname) + vim_strsize(NameBuff) + 1;
+ option_value2string(opt, opt_flags);
+ len = (int)strlen(opt->fullname) + vim_strsize(NameBuff) + 1;
}
if ((len <= INC - GAP && run == 1)
|| (len > INC - GAP && run == 2)) {
- items[item_count++] = p;
+ items[item_count++] = opt;
}
}
}
@@ -4025,7 +4012,7 @@ static int optval_default(vimoption_T *p, const void *varp)
/// Send update to UIs with values of UI relevant options
void ui_refresh_options(void)
{
- for (int opt_idx = 0; options[opt_idx].fullname; opt_idx++) {
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
uint32_t flags = options[opt_idx].flags;
if (!(flags & P_UI_OPTION)) {
continue;
@@ -4112,39 +4099,42 @@ int makeset(FILE *fd, int opt_flags, int local_only)
// Do the loop over "options[]" twice: once for options with the
// P_PRI_MKRC flag and once without.
for (int pri = 1; pri >= 0; pri--) {
- for (vimoption_T *p = &options[0]; p->fullname; p++) {
- if (!(p->flags & P_NO_MKRC)
- && ((pri == 1) == ((p->flags & P_PRI_MKRC) != 0))) {
+ vimoption_T *opt;
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
+ opt = &options[opt_idx];
+
+ if (!(opt->flags & P_NO_MKRC)
+ && ((pri == 1) == ((opt->flags & P_PRI_MKRC) != 0))) {
// skip global option when only doing locals
- if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL)) {
+ if (opt->indir == PV_NONE && !(opt_flags & OPT_GLOBAL)) {
continue;
}
// Do not store options like 'bufhidden' and 'syntax' in a vimrc
// file, they are always buffer-specific.
- if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB)) {
+ if ((opt_flags & OPT_GLOBAL) && (opt->flags & P_NOGLOB)) {
continue;
}
- void *varp = get_varp_scope(p, opt_flags); // currently used value
+ void *varp = get_varp_scope(opt, opt_flags); // currently used value
// Hidden options are never written.
if (!varp) {
continue;
}
// Global values are only written when not at the default value.
- if ((opt_flags & OPT_GLOBAL) && optval_default(p, varp)) {
+ if ((opt_flags & OPT_GLOBAL) && optval_default(opt, varp)) {
continue;
}
if ((opt_flags & OPT_SKIPRTP)
- && (p->var == &p_rtp || p->var == &p_pp)) {
+ && (opt->var == &p_rtp || opt->var == &p_pp)) {
continue;
}
int round = 2;
void *varp_local = NULL; // fresh value
- if (p->indir != PV_NONE) {
- if (p->var == VAR_WIN) {
+ if (opt->indir != PV_NONE) {
+ if (opt->var == VAR_WIN) {
// skip window-local option when only doing globals
if (!(opt_flags & OPT_LOCAL)) {
continue;
@@ -4152,8 +4142,8 @@ int makeset(FILE *fd, int opt_flags, int local_only)
// When fresh value of window-local option is not at the
// default, need to write it too.
if (!(opt_flags & OPT_GLOBAL) && !local_only) {
- void *varp_fresh = get_varp_scope(p, OPT_GLOBAL); // local value
- if (!optval_default(p, varp_fresh)) {
+ void *varp_fresh = get_varp_scope(opt, OPT_GLOBAL); // local value
+ if (!optval_default(opt, varp_fresh)) {
round = 1;
varp_local = varp;
varp = varp_fresh;
@@ -4172,12 +4162,12 @@ int makeset(FILE *fd, int opt_flags, int local_only)
cmd = "setlocal";
}
- if (p->flags & P_BOOL) {
- if (put_setbool(fd, cmd, p->fullname, *(int *)varp) == FAIL) {
+ if (opt->flags & P_BOOL) {
+ if (put_setbool(fd, cmd, opt->fullname, *(int *)varp) == FAIL) {
return FAIL;
}
- } else if (p->flags & P_NUM) {
- if (put_setnum(fd, cmd, p->fullname, (OptInt *)varp) == FAIL) {
+ } else if (opt->flags & P_NUM) {
+ if (put_setnum(fd, cmd, opt->fullname, (OptInt *)varp) == FAIL) {
return FAIL;
}
} else { // P_STRING
@@ -4185,15 +4175,15 @@ int makeset(FILE *fd, int opt_flags, int local_only)
// Don't set 'syntax' and 'filetype' again if the value is
// already right, avoids reloading the syntax file.
- if (p->indir == PV_SYN || p->indir == PV_FT) {
- if (fprintf(fd, "if &%s != '%s'", p->fullname,
+ if (opt->indir == PV_SYN || opt->indir == PV_FT) {
+ if (fprintf(fd, "if &%s != '%s'", opt->fullname,
*(char **)(varp)) < 0
|| put_eol(fd) < 0) {
return FAIL;
}
do_endif = true;
}
- if (put_setstring(fd, cmd, p->fullname, (char **)varp, p->flags) == FAIL) {
+ if (put_setstring(fd, cmd, opt->fullname, (char **)varp, opt->flags) == FAIL) {
return FAIL;
}
if (do_endif) {
@@ -4404,7 +4394,7 @@ void *get_varp_scope(vimoption_T *p, int scope)
/// Get pointer to option variable at 'opt_idx', depending on local or global
/// scope.
-void *get_option_varp_scope_from(int opt_idx, int scope, buf_T *buf, win_T *win)
+void *get_option_varp_scope_from(OptIndex opt_idx, int scope, buf_T *buf, win_T *win)
{
return get_varp_scope_from(&(options[opt_idx]), scope, buf, win);
}
@@ -4871,19 +4861,19 @@ void didset_window_options(win_T *wp, bool valid_cursor)
}
/// Index into the options table for a buffer-local option enum.
-static int buf_opt_idx[BV_COUNT];
+static OptIndex buf_opt_idx[BV_COUNT];
#define COPY_OPT_SCTX(buf, bv) buf->b_p_script_ctx[bv] = options[buf_opt_idx[bv]].last_set
/// Initialize buf_opt_idx[] if not done already.
static void init_buf_opt_idx(void)
{
- static int did_init_buf_opt_idx = false;
+ static bool did_init_buf_opt_idx = false;
if (did_init_buf_opt_idx) {
return;
}
did_init_buf_opt_idx = true;
- for (int i = 0; options[i].fullname != NULL; i++) {
+ for (OptIndex i = 0; i < kOptIndexCount; i++) {
if (options[i].indir & PV_BUF) {
buf_opt_idx[options[i].indir & PV_MASK] = i;
}
@@ -5172,14 +5162,9 @@ void buf_copy_options(buf_T *buf, int flags)
/// Reset the 'modifiable' option and its default value.
void reset_modifiable(void)
{
- int opt_idx;
-
curbuf->b_p_ma = false;
p_ma = false;
- opt_idx = findoption("ma");
- if (opt_idx >= 0) {
- options[opt_idx].def_val = false;
- }
+ options[kOptModifiable].def_val = false;
}
/// Set the global value for 'iminsert' to the local value.
@@ -5194,7 +5179,7 @@ void set_imsearch_global(buf_T *buf)
p_imsearch = buf->b_p_imsearch;
}
-static int expand_option_idx = -1;
+static int expand_option_idx = kOptInvalid;
static int expand_option_start_col = 0;
static char expand_option_name[5] = { 't', '_', NUL, NUL, NUL };
static int expand_option_flags = 0;
@@ -5244,7 +5229,7 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
char nextchar;
uint32_t flags = 0;
- int opt_idx = 0;
+ OptIndex opt_idx = 0;
int is_term_option = false;
if (*arg == '<') {
@@ -5285,7 +5270,7 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
}
nextchar = *p;
opt_idx = findoption_len(arg, (size_t)(p - arg));
- if (opt_idx == -1 || options[opt_idx].var == NULL) {
+ if (opt_idx == kOptInvalid || options[opt_idx].var == NULL) {
xp->xp_context = EXPAND_NOTHING;
return;
}
@@ -5318,7 +5303,7 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
// Below are for handling expanding a specific option's value after the '=' or ':'
if (is_term_option) {
- expand_option_idx = -1;
+ expand_option_idx = kOptInvalid;
} else {
expand_option_idx = opt_idx;
}
@@ -5342,8 +5327,7 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
if (expand_option_subtract) {
xp->xp_context = EXPAND_SETTING_SUBTRACT;
return;
- } else if (expand_option_idx >= 0
- && options[expand_option_idx].opt_expand_cb != NULL) {
+ } else if (expand_option_idx != kOptInvalid && options[expand_option_idx].opt_expand_cb != NULL) {
xp->xp_context = EXPAND_STRING_SETTING;
} else if (*xp->xp_pattern == NUL) {
xp->xp_context = EXPAND_OLD_SETTING;
@@ -5504,8 +5488,8 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, char *fuzzystr, int *numM
}
}
char *str;
- for (size_t opt_idx = 0; (str = options[opt_idx].fullname) != NULL;
- opt_idx++) {
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
+ str = options[opt_idx].fullname;
if (options[opt_idx].var == NULL) {
continue;
}
@@ -5569,7 +5553,7 @@ static char *escape_option_str_cmdline(char *var)
// The reverse is found at stropt_copy_value().
for (var = buf; *var != NUL; MB_PTR_ADV(var)) {
if (var[0] == '\\' && var[1] == '\\'
- && expand_option_idx >= 0
+ && expand_option_idx != kOptInvalid
&& (options[expand_option_idx].flags & P_EXPAND)
&& vim_isfilec((uint8_t)var[2])
&& (var[2] != '\\' || (var == buf && var[4] != '\\'))) {
@@ -5588,12 +5572,12 @@ int ExpandOldSetting(int *numMatches, char ***matches)
*numMatches = 0;
*matches = xmalloc(sizeof(char *));
- // For a terminal key code expand_option_idx is < 0.
- if (expand_option_idx < 0) {
+ // For a terminal key code expand_option_idx is kOptInvalid.
+ if (expand_option_idx == kOptInvalid) {
expand_option_idx = findoption(expand_option_name);
}
- if (expand_option_idx >= 0) {
+ if (expand_option_idx != kOptInvalid) {
// Put string of option value in NameBuff.
option_value2string(&options[expand_option_idx], expand_option_flags);
var = NameBuff;
@@ -5611,8 +5595,7 @@ int ExpandOldSetting(int *numMatches, char ***matches)
/// Expansion handler for :set=/:set+= when the option has a custom expansion handler.
int ExpandStringSetting(expand_T *xp, regmatch_T *regmatch, int *numMatches, char ***matches)
{
- if (expand_option_idx < 0
- || options[expand_option_idx].opt_expand_cb == NULL) {
+ if (expand_option_idx == kOptInvalid || options[expand_option_idx].opt_expand_cb == NULL) {
// Not supposed to reach this. This function is only for options with
// custom expansion callbacks.
return FAIL;
@@ -5644,7 +5627,7 @@ int ExpandStringSetting(expand_T *xp, regmatch_T *regmatch, int *numMatches, cha
/// Expansion handler for :set-=
int ExpandSettingSubtract(expand_T *xp, regmatch_T *regmatch, int *numMatches, char ***matches)
{
- if (expand_option_idx < 0) {
+ if (expand_option_idx == kOptInvalid) {
// term option
return ExpandOldSetting(numMatches, matches);
}
@@ -5824,35 +5807,24 @@ void vimrc_found(char *fname, char *envname)
}
}
-/// Check whether global option has been set
+/// Check whether global option has been set.
///
/// @param[in] name Option name.
///
-/// @return True if it was set.
-bool option_was_set(const char *name)
+/// @return True if option was set.
+bool option_was_set(OptIndex opt_idx)
{
- int idx;
-
- idx = findoption(name);
- if (idx < 0) { // Unknown option.
- return false;
- } else if (options[idx].flags & P_WAS_SET) {
- return true;
- }
- return false;
+ assert(opt_idx != kOptInvalid);
+ return options[opt_idx].flags & P_WAS_SET;
}
/// Reset the flag indicating option "name" was set.
///
/// @param[in] name Option name.
-void reset_option_was_set(const char *name)
+void reset_option_was_set(OptIndex opt_idx)
{
- const int idx = findoption(name);
- if (idx < 0) {
- return;
- }
-
- options[idx].flags &= ~P_WAS_SET;
+ assert(opt_idx != kOptInvalid);
+ options[opt_idx].flags &= ~P_WAS_SET;
}
/// fill_culopt_flags() -- called when 'culopt' changes value
@@ -5951,17 +5923,14 @@ int option_set_callback_func(char *optval, Callback *optcb)
return OK;
}
-static void didset_options_sctx(int opt_flags, char **buf)
+static void didset_options_sctx(int opt_flags, int *buf)
{
for (int i = 0;; i++) {
- if (buf[i] == NULL) {
+ if (buf[i] == kOptInvalid) {
break;
}
- int idx = findoption(buf[i]);
- if (idx >= 0) {
- set_option_sctx_idx(idx, opt_flags, current_sctx);
- }
+ set_option_sctx(buf[i], opt_flags, current_sctx);
}
}
@@ -6101,7 +6070,7 @@ void set_fileformat(int eol_style, int opt_flags)
// p is NULL if "eol_style" is EOL_UNKNOWN.
if (p != NULL) {
- set_string_option_direct("ff", -1, p, OPT_FREE | opt_flags, 0);
+ set_string_option_direct(kOptFileformat, p, OPT_FREE | opt_flags, 0);
}
// This may cause the buffer to become (un)modified.
@@ -6172,27 +6141,13 @@ bool fish_like_shell(void)
return strstr(path_tail(p_sh), "fish") != NULL;
}
-/// Return the number of requested sign columns, based on current
-/// buffer signs and on user configuration.
-int win_signcol_count(win_T *wp)
-{
- if (wp->w_minscwidth <= SCL_NO) {
- return 0;
- }
-
- int needed_signcols = buf_signcols(wp->w_buffer, wp->w_maxscwidth);
- int ret = MAX(wp->w_minscwidth, MIN(wp->w_maxscwidth, needed_signcols));
- assert(ret <= SIGN_SHOW_MAX);
- return ret;
-}
-
/// Get window or buffer local options
dict_T *get_winbuf_options(const int bufopt)
FUNC_ATTR_WARN_UNUSED_RESULT
{
dict_T *const d = tv_dict_alloc();
- for (int opt_idx = 0; options[opt_idx].fullname; opt_idx++) {
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
struct vimoption *opt = &options[opt_idx];
if ((bufopt && (opt->indir & PV_BUF))
@@ -6236,8 +6191,8 @@ int get_sidescrolloff_value(win_T *wp)
Dictionary get_vimoption(String name, int scope, buf_T *buf, win_T *win, Error *err)
{
- int opt_idx = findoption_len(name.data, name.size);
- VALIDATE_S(opt_idx >= 0, "option (not found)", name.data, {
+ OptIndex opt_idx = findoption_len(name.data, name.size);
+ VALIDATE_S(opt_idx != kOptInvalid, "option (not found)", name.data, {
return (Dictionary)ARRAY_DICT_INIT;
});
@@ -6247,9 +6202,9 @@ Dictionary get_vimoption(String name, int scope, buf_T *buf, win_T *win, Error *
Dictionary get_all_vimoptions(void)
{
Dictionary retval = ARRAY_DICT_INIT;
- for (size_t i = 0; options[i].fullname != NULL; i++) {
- Dictionary opt_dict = vimoption2dict(&options[i], OPT_GLOBAL, curbuf, curwin);
- PUT(retval, options[i].fullname, DICTIONARY_OBJ(opt_dict));
+ for (OptIndex opt_idx = 0; opt_idx < kOptIndexCount; opt_idx++) {
+ Dictionary opt_dict = vimoption2dict(&options[opt_idx], OPT_GLOBAL, curbuf, curwin);
+ PUT(retval, options[opt_idx].fullname, DICTIONARY_OBJ(opt_dict));
}
return retval;
}
diff --git a/src/nvim/option.h b/src/nvim/option.h
index ebf8e0417d..db438342ab 100644
--- a/src/nvim/option.h
+++ b/src/nvim/option.h
@@ -87,14 +87,11 @@ typedef enum {
OPT_SKIPRTP = 0x100, ///< "skiprtp" in 'sessionoptions'
} OptionFlags;
-/// Return value from get_option_value_strict
+/// Return value from get_option_attrs().
enum {
- SOPT_BOOL = 0x01, ///< Boolean option
- SOPT_NUM = 0x02, ///< Number option
- SOPT_STRING = 0x04, ///< String option
- SOPT_GLOBAL = 0x08, ///< Option has global value
- SOPT_WIN = 0x10, ///< Option has window-local value
- SOPT_BUF = 0x20, ///< Option has buffer-local value
+ SOPT_GLOBAL = 0x01, ///< Option has global value
+ SOPT_WIN = 0x02, ///< Option has window-local value
+ SOPT_BUF = 0x04, ///< Option has buffer-local value
};
// OptVal helper macros.
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 6d0401f319..28718c6269 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -122,3 +122,8 @@ typedef enum {
kOptReqWin = 1, ///< Request window-local option value
kOptReqBuf = 2, ///< Request buffer-local option value
} OptReqScope;
+
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+// Initialize the OptIndex enum.
+# include "options_enum.generated.h"
+#endif
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index daaf73d241..8f0be0eb1b 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -94,56 +94,6 @@ return {
type = 'number',
},
{
- abbreviation = 'arab',
- cb = 'did_set_arabic',
- defaults = { if_true = false },
- desc = [=[
- This option can be set to start editing Arabic text.
- Setting this option will:
- - Set the 'rightleft' option, unless 'termbidi' is set.
- - Set the 'arabicshape' option, unless 'termbidi' is set.
- - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
- between typing English and Arabic key mapping.
- - Set the 'delcombine' option
-
- Resetting this option will:
- - Reset the 'rightleft' option.
- - Disable the use of 'keymap' (without changing its value).
- Note that 'arabicshape' and 'delcombine' are not reset (it is a global
- option).
- Also see |arabic.txt|.
- ]=],
- full_name = 'arabic',
- redraw = { 'curswant' },
- scope = { 'window' },
- short_desc = N_('Arabic as a default second language'),
- type = 'bool',
- },
- {
- abbreviation = 'arshape',
- defaults = { if_true = true },
- desc = [=[
- When on and 'termbidi' is off, the required visual character
- corrections that need to take place for displaying the Arabic language
- take effect. Shaping, in essence, gets enabled; the term is a broad
- one which encompasses:
- a) the changing/morphing of characters based on their location
- within a word (initial, medial, final and stand-alone).
- b) the enabling of the ability to compose characters
- c) the enabling of the required combining of some characters
- When disabled the display shows each character's true stand-alone
- form.
- Arabic is a complex language which requires other settings, for
- further details see |arabic.txt|.
- ]=],
- full_name = 'arabicshape',
- redraw = { 'all_windows', 'ui_option' },
- scope = { 'global' },
- short_desc = N_('do shaping for Arabic characters'),
- type = 'bool',
- varname = 'p_arshape',
- },
- {
abbreviation = 'ari',
defaults = { if_true = false },
desc = [=[
@@ -203,6 +153,56 @@ return {
varname = 'p_ambw',
},
{
+ abbreviation = 'arab',
+ cb = 'did_set_arabic',
+ defaults = { if_true = false },
+ desc = [=[
+ This option can be set to start editing Arabic text.
+ Setting this option will:
+ - Set the 'rightleft' option, unless 'termbidi' is set.
+ - Set the 'arabicshape' option, unless 'termbidi' is set.
+ - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
+ between typing English and Arabic key mapping.
+ - Set the 'delcombine' option
+
+ Resetting this option will:
+ - Reset the 'rightleft' option.
+ - Disable the use of 'keymap' (without changing its value).
+ Note that 'arabicshape' and 'delcombine' are not reset (it is a global
+ option).
+ Also see |arabic.txt|.
+ ]=],
+ full_name = 'arabic',
+ redraw = { 'curswant' },
+ scope = { 'window' },
+ short_desc = N_('Arabic as a default second language'),
+ type = 'bool',
+ },
+ {
+ abbreviation = 'arshape',
+ defaults = { if_true = true },
+ desc = [=[
+ When on and 'termbidi' is off, the required visual character
+ corrections that need to take place for displaying the Arabic language
+ take effect. Shaping, in essence, gets enabled; the term is a broad
+ one which encompasses:
+ a) the changing/morphing of characters based on their location
+ within a word (initial, medial, final and stand-alone).
+ b) the enabling of the ability to compose characters
+ c) the enabling of the required combining of some characters
+ When disabled the display shows each character's true stand-alone
+ form.
+ Arabic is a complex language which requires other settings, for
+ further details see |arabic.txt|.
+ ]=],
+ full_name = 'arabicshape',
+ redraw = { 'all_windows', 'ui_option' },
+ scope = { 'global' },
+ short_desc = N_('do shaping for Arabic characters'),
+ type = 'bool',
+ varname = 'p_arshape',
+ },
+ {
abbreviation = 'acd',
cb = 'did_set_autochdir',
defaults = { if_true = false },
@@ -1129,6 +1129,25 @@ return {
varname = 'p_cino',
},
{
+ abbreviation = 'cinsd',
+ alloced = true,
+ defaults = { if_true = 'public,protected,private' },
+ deny_duplicates = true,
+ desc = [=[
+ Keywords that are interpreted as a C++ scope declaration by |cino-g|.
+ Useful e.g. for working with the Qt framework that defines additional
+ scope declarations "signals", "public slots" and "private slots": >
+ set cinscopedecls+=signals,public\ slots,private\ slots
+ <
+ ]=],
+ full_name = 'cinscopedecls',
+ list = 'onecomma',
+ scope = { 'buffer' },
+ short_desc = N_("words that are recognized by 'cino-g'"),
+ type = 'string',
+ varname = 'p_cinsd',
+ },
+ {
abbreviation = 'cinw',
alloced = true,
defaults = { if_true = 'if,else,while,do,for,switch' },
@@ -1149,25 +1168,6 @@ return {
varname = 'p_cinw',
},
{
- abbreviation = 'cinsd',
- alloced = true,
- defaults = { if_true = 'public,protected,private' },
- deny_duplicates = true,
- desc = [=[
- Keywords that are interpreted as a C++ scope declaration by |cino-g|.
- Useful e.g. for working with the Qt framework that defines additional
- scope declarations "signals", "public slots" and "private slots": >
- set cinscopedecls+=signals,public\ slots,private\ slots
- <
- ]=],
- full_name = 'cinscopedecls',
- list = 'onecomma',
- scope = { 'buffer' },
- short_desc = N_("words that are recognized by 'cino-g'"),
- type = 'string',
- varname = 'p_cinsd',
- },
- {
abbreviation = 'cb',
cb = 'did_set_clipboard',
defaults = { if_true = '' },
@@ -1394,65 +1394,6 @@ return {
varname = 'p_cpt',
},
{
- abbreviation = 'cocu',
- alloced = true,
- cb = 'did_set_concealcursor',
- defaults = { if_true = '' },
- desc = [=[
- Sets the modes in which text in the cursor line can also be concealed.
- When the current mode is listed then concealing happens just like in
- other lines.
- n Normal mode
- v Visual mode
- i Insert mode
- c Command line editing, for 'incsearch'
-
- 'v' applies to all lines in the Visual area, not only the cursor.
- A useful value is "nc". This is used in help files. So long as you
- are moving around text is concealed, but when starting to insert text
- or selecting a Visual area the concealed text is displayed, so that
- you can see what you are doing.
- Keep in mind that the cursor position is not always where it's
- displayed. E.g., when moving vertically it may change column.
- ]=],
- expand_cb = 'expand_set_concealcursor',
- full_name = 'concealcursor',
- list = 'flags',
- redraw = { 'current_window' },
- scope = { 'window' },
- short_desc = N_('whether concealable text is hidden in cursor line'),
- type = 'string',
- },
- {
- abbreviation = 'cole',
- defaults = { if_true = 0 },
- desc = [=[
- Determine how text with the "conceal" syntax attribute |:syn-conceal|
- is shown:
-
- Value Effect ~
- 0 Text is shown normally
- 1 Each block of concealed text is replaced with one
- character. If the syntax item does not have a custom
- replacement character defined (see |:syn-cchar|) the
- character defined in 'listchars' is used.
- It is highlighted with the "Conceal" highlight group.
- 2 Concealed text is completely hidden unless it has a
- custom replacement character defined (see
- |:syn-cchar|).
- 3 Concealed text is completely hidden.
-
- Note: in the cursor line concealed text is not hidden, so that you can
- edit and copy the text. This can be changed with the 'concealcursor'
- option.
- ]=],
- full_name = 'conceallevel',
- redraw = { 'current_window' },
- scope = { 'window' },
- short_desc = N_('whether concealable text is shown or hidden'),
- type = 'number',
- },
- {
abbreviation = 'cfu',
alloced = true,
cb = 'did_set_completefunc',
@@ -1543,6 +1484,65 @@ return {
varname = 'p_csl',
},
{
+ abbreviation = 'cocu',
+ alloced = true,
+ cb = 'did_set_concealcursor',
+ defaults = { if_true = '' },
+ desc = [=[
+ Sets the modes in which text in the cursor line can also be concealed.
+ When the current mode is listed then concealing happens just like in
+ other lines.
+ n Normal mode
+ v Visual mode
+ i Insert mode
+ c Command line editing, for 'incsearch'
+
+ 'v' applies to all lines in the Visual area, not only the cursor.
+ A useful value is "nc". This is used in help files. So long as you
+ are moving around text is concealed, but when starting to insert text
+ or selecting a Visual area the concealed text is displayed, so that
+ you can see what you are doing.
+ Keep in mind that the cursor position is not always where it's
+ displayed. E.g., when moving vertically it may change column.
+ ]=],
+ expand_cb = 'expand_set_concealcursor',
+ full_name = 'concealcursor',
+ list = 'flags',
+ redraw = { 'current_window' },
+ scope = { 'window' },
+ short_desc = N_('whether concealable text is hidden in cursor line'),
+ type = 'string',
+ },
+ {
+ abbreviation = 'cole',
+ defaults = { if_true = 0 },
+ desc = [=[
+ Determine how text with the "conceal" syntax attribute |:syn-conceal|
+ is shown:
+
+ Value Effect ~
+ 0 Text is shown normally
+ 1 Each block of concealed text is replaced with one
+ character. If the syntax item does not have a custom
+ replacement character defined (see |:syn-cchar|) the
+ character defined in 'listchars' is used.
+ It is highlighted with the "Conceal" highlight group.
+ 2 Concealed text is completely hidden unless it has a
+ custom replacement character defined (see
+ |:syn-cchar|).
+ 3 Concealed text is completely hidden.
+
+ Note: in the cursor line concealed text is not hidden, so that you can
+ edit and copy the text. This can be changed with the 'concealcursor'
+ option.
+ ]=],
+ full_name = 'conceallevel',
+ redraw = { 'current_window' },
+ scope = { 'window' },
+ short_desc = N_('whether concealable text is shown or hidden'),
+ type = 'number',
+ },
+ {
abbreviation = 'cf',
defaults = { if_true = false },
desc = [=[
@@ -3241,27 +3241,6 @@ return {
varname = 'p_fex',
},
{
- abbreviation = 'fo',
- alloced = true,
- cb = 'did_set_formatoptions',
- defaults = { if_true = macros('DFLT_FO_VIM') },
- desc = [=[
- This is a sequence of letters which describes how automatic
- formatting is to be done.
- See |fo-table| for possible values and |gq| for how to format text.
- Commas can be inserted for readability.
- To avoid problems with flags that are added in the future, use the
- "+=" and "-=" feature of ":set" |add-option-flags|.
- ]=],
- expand_cb = 'expand_set_formatoptions',
- full_name = 'formatoptions',
- list = 'flags',
- scope = { 'buffer' },
- short_desc = N_('how automatic formatting is to be done'),
- type = 'string',
- varname = 'p_fo',
- },
- {
abbreviation = 'flp',
alloced = true,
defaults = { if_true = '^\\s*\\d\\+[\\]:.)}\\t ]\\s*' },
@@ -3283,6 +3262,27 @@ return {
varname = 'p_flp',
},
{
+ abbreviation = 'fo',
+ alloced = true,
+ cb = 'did_set_formatoptions',
+ defaults = { if_true = macros('DFLT_FO_VIM') },
+ desc = [=[
+ This is a sequence of letters which describes how automatic
+ formatting is to be done.
+ See |fo-table| for possible values and |gq| for how to format text.
+ Commas can be inserted for readability.
+ To avoid problems with flags that are added in the future, use the
+ "+=" and "-=" feature of ":set" |add-option-flags|.
+ ]=],
+ expand_cb = 'expand_set_formatoptions',
+ full_name = 'formatoptions',
+ list = 'flags',
+ scope = { 'buffer' },
+ short_desc = N_('how automatic formatting is to be done'),
+ type = 'string',
+ varname = 'p_fo',
+ },
+ {
abbreviation = 'fp',
defaults = { if_true = '' },
desc = [=[
@@ -6557,27 +6557,6 @@ return {
type = 'number',
},
{
- abbreviation = 'sms',
- cb = 'did_set_smoothscroll',
- defaults = { if_true = false },
- desc = [=[
- Scrolling works with screen lines. When 'wrap' is set and the first
- line in the window wraps part of it may not be visible, as if it is
- above the window. "<<<" is displayed at the start of the first line,
- highlighted with |hl-NonText|.
- You may also want to add "lastline" to the 'display' option to show as
- much of the last line as possible.
- NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y
- and scrolling with the mouse.
- ]=],
- full_name = 'smoothscroll',
- pv_name = 'p_sms',
- redraw = { 'current_window' },
- scope = { 'window' },
- short_desc = N_("scroll by screen lines when 'wrap' is set"),
- type = 'bool',
- },
- {
abbreviation = 'scbk',
cb = 'did_set_scrollback',
defaults = {
@@ -7230,6 +7209,23 @@ return {
varname = 'p_stmp',
},
{
+ abbreviation = 'sxe',
+ defaults = { if_true = '' },
+ desc = [=[
+ When 'shellxquote' is set to "(" then the characters listed in this
+ option will be escaped with a '^' character. This makes it possible
+ to execute most external commands with cmd.exe.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+ ]=],
+ full_name = 'shellxescape',
+ scope = { 'global' },
+ secure = true,
+ short_desc = N_("characters to escape when 'shellxquote' is ("),
+ type = 'string',
+ varname = 'p_sxe',
+ },
+ {
abbreviation = 'sxq',
defaults = {
condition = 'MSWIN',
@@ -7256,23 +7252,6 @@ return {
varname = 'p_sxq',
},
{
- abbreviation = 'sxe',
- defaults = { if_true = '' },
- desc = [=[
- When 'shellxquote' is set to "(" then the characters listed in this
- option will be escaped with a '^' character. This makes it possible
- to execute most external commands with cmd.exe.
- This option cannot be set from a |modeline| or in the |sandbox|, for
- security reasons.
- ]=],
- full_name = 'shellxescape',
- scope = { 'global' },
- secure = true,
- short_desc = N_("characters to escape when 'shellxquote' is ("),
- type = 'string',
- varname = 'p_sxe',
- },
- {
abbreviation = 'sr',
defaults = { if_true = false },
desc = [=[
@@ -7668,6 +7647,27 @@ return {
varname = 'p_sta',
},
{
+ abbreviation = 'sms',
+ cb = 'did_set_smoothscroll',
+ defaults = { if_true = false },
+ desc = [=[
+ Scrolling works with screen lines. When 'wrap' is set and the first
+ line in the window wraps part of it may not be visible, as if it is
+ above the window. "<<<" is displayed at the start of the first line,
+ highlighted with |hl-NonText|.
+ You may also want to add "lastline" to the 'display' option to show as
+ much of the last line as possible.
+ NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y
+ and scrolling with the mouse.
+ ]=],
+ full_name = 'smoothscroll',
+ pv_name = 'p_sms',
+ redraw = { 'current_window' },
+ scope = { 'window' },
+ short_desc = N_("scroll by screen lines when 'wrap' is set"),
+ type = 'bool',
+ },
+ {
abbreviation = 'sts',
defaults = { if_true = 0 },
desc = [=[
@@ -7821,6 +7821,31 @@ return {
varname = 'p_spl',
},
{
+ abbreviation = 'spo',
+ cb = 'did_set_spelloptions',
+ defaults = { if_true = '' },
+ deny_duplicates = true,
+ desc = [=[
+ A comma-separated list of options for spell checking:
+ camel When a word is CamelCased, assume "Cased" is a
+ separate word: every upper-case character in a word
+ that comes after a lower case character indicates the
+ start of a new word.
+ noplainbuffer Only spellcheck a buffer when 'syntax' is enabled,
+ or when extmarks are set within the buffer. Only
+ designated regions of the buffer are spellchecked in
+ this case.
+ ]=],
+ expand_cb = 'expand_set_spelloptions',
+ full_name = 'spelloptions',
+ list = 'onecomma',
+ redraw = { 'current_buffer' },
+ scope = { 'buffer' },
+ secure = true,
+ type = 'string',
+ varname = 'p_spo',
+ },
+ {
abbreviation = 'sps',
cb = 'did_set_spellsuggest',
defaults = { if_true = 'best' },
@@ -7901,31 +7926,6 @@ return {
varname = 'p_sps',
},
{
- abbreviation = 'spo',
- cb = 'did_set_spelloptions',
- defaults = { if_true = '' },
- deny_duplicates = true,
- desc = [=[
- A comma-separated list of options for spell checking:
- camel When a word is CamelCased, assume "Cased" is a
- separate word: every upper-case character in a word
- that comes after a lower case character indicates the
- start of a new word.
- noplainbuffer Only spellcheck a buffer when 'syntax' is enabled,
- or when extmarks are set within the buffer. Only
- designated regions of the buffer are spellchecked in
- this case.
- ]=],
- expand_cb = 'expand_set_spelloptions',
- full_name = 'spelloptions',
- list = 'onecomma',
- redraw = { 'current_buffer' },
- scope = { 'buffer' },
- secure = true,
- type = 'string',
- varname = 'p_spo',
- },
- {
abbreviation = 'sb',
defaults = { if_true = false },
desc = [=[
@@ -8456,28 +8456,6 @@ return {
varname = 'p_syn',
},
{
- abbreviation = 'tfu',
- cb = 'did_set_tagfunc',
- defaults = { if_true = '' },
- desc = [=[
- This option specifies a function to be used to perform tag searches.
- The function gets the tag pattern and should return a List of matching
- tags. See |tag-function| for an explanation of how to write the
- function and an example. The value can be the name of a function, a
- |lambda| or a |Funcref|. See |option-value-function| for more
- information.
- This option cannot be set from a |modeline| or in the |sandbox|, for
- security reasons.
- ]=],
- full_name = 'tagfunc',
- func = true,
- scope = { 'buffer' },
- secure = true,
- short_desc = N_('function used to perform tag searches'),
- type = 'string',
- varname = 'p_tfu',
- },
- {
abbreviation = 'tal',
cb = 'did_set_tabline',
defaults = { if_true = '' },
@@ -8656,6 +8634,28 @@ return {
varname = 'p_tc',
},
{
+ abbreviation = 'tfu',
+ cb = 'did_set_tagfunc',
+ defaults = { if_true = '' },
+ desc = [=[
+ This option specifies a function to be used to perform tag searches.
+ The function gets the tag pattern and should return a List of matching
+ tags. See |tag-function| for an explanation of how to write the
+ function and an example. The value can be the name of a function, a
+ |lambda| or a |Funcref|. See |option-value-function| for more
+ information.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+ ]=],
+ full_name = 'tagfunc',
+ func = true,
+ scope = { 'buffer' },
+ secure = true,
+ short_desc = N_('function used to perform tag searches'),
+ type = 'string',
+ varname = 'p_tfu',
+ },
+ {
abbreviation = 'tl',
defaults = { if_true = 0 },
desc = [=[
@@ -8764,6 +8764,10 @@ return {
Enables 24-bit RGB color in the |TUI|. Uses "gui" |:highlight|
attributes instead of "cterm" attributes. |guifg|
Requires an ISO-8613-3 compatible terminal.
+
+ Nvim will automatically attempt to determine if the host terminal
+ supports 24-bit color and will enable this option if it does
+ (unless explicitly disabled by the user).
]=],
full_name = 'termguicolors',
redraw = { 'ui_option' },
@@ -9789,39 +9793,6 @@ return {
type = 'number',
},
{
- abbreviation = 'winhl',
- alloced = true,
- cb = 'did_set_winhighlight',
- defaults = { if_true = '' },
- deny_duplicates = true,
- desc = [=[
- Window-local highlights. Comma-delimited list of highlight
- |group-name| pairs "{hl-from}:{hl-to},..." where each {hl-from} is
- a |highlight-groups| item to be overridden by {hl-to} group in
- the window.
-
- Note: highlight namespaces take precedence over 'winhighlight'.
- See |nvim_win_set_hl_ns()| and |nvim_set_hl()|.
-
- Highlights of vertical separators are determined by the window to the
- left of the separator. The 'tabline' highlight of a tabpage is
- decided by the last-focused window of the tabpage. Highlights of
- the popupmenu are determined by the current window. Highlights in the
- message area cannot be overridden.
-
- Example: show a different color for non-current windows: >
- set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC
- <
- ]=],
- expand_cb = 'expand_set_winhighlight',
- full_name = 'winhighlight',
- list = 'onecommacolon',
- redraw = { 'current_window' },
- scope = { 'window' },
- short_desc = N_('Setup window-local highlights'),
- type = 'string',
- },
- {
abbreviation = 'wi',
cb = 'did_set_window',
defaults = {
@@ -9846,6 +9817,35 @@ return {
varname = 'p_window',
},
{
+ abbreviation = 'wfh',
+ defaults = { if_true = false },
+ desc = [=[
+ Keep the window height when windows are opened or closed and
+ 'equalalways' is set. Also for |CTRL-W_=|. Set by default for the
+ |preview-window| and |quickfix-window|.
+ The height may be changed anyway when running out of room.
+ ]=],
+ full_name = 'winfixheight',
+ redraw = { 'statuslines' },
+ scope = { 'window' },
+ short_desc = N_('keep window height when opening/closing windows'),
+ type = 'bool',
+ },
+ {
+ abbreviation = 'wfw',
+ defaults = { if_true = false },
+ desc = [=[
+ Keep the window width when windows are opened or closed and
+ 'equalalways' is set. Also for |CTRL-W_=|.
+ The width may be changed anyway when running out of room.
+ ]=],
+ full_name = 'winfixwidth',
+ redraw = { 'statuslines' },
+ scope = { 'window' },
+ short_desc = N_('keep window width when opening/closing windows'),
+ type = 'bool',
+ },
+ {
abbreviation = 'wh',
cb = 'did_set_winheight',
defaults = { if_true = 1 },
@@ -9875,33 +9875,37 @@ return {
varname = 'p_wh',
},
{
- abbreviation = 'wfh',
- defaults = { if_true = false },
- desc = [=[
- Keep the window height when windows are opened or closed and
- 'equalalways' is set. Also for |CTRL-W_=|. Set by default for the
- |preview-window| and |quickfix-window|.
- The height may be changed anyway when running out of room.
- ]=],
- full_name = 'winfixheight',
- redraw = { 'statuslines' },
- scope = { 'window' },
- short_desc = N_('keep window height when opening/closing windows'),
- type = 'bool',
- },
- {
- abbreviation = 'wfw',
- defaults = { if_true = false },
+ abbreviation = 'winhl',
+ alloced = true,
+ cb = 'did_set_winhighlight',
+ defaults = { if_true = '' },
+ deny_duplicates = true,
desc = [=[
- Keep the window width when windows are opened or closed and
- 'equalalways' is set. Also for |CTRL-W_=|.
- The width may be changed anyway when running out of room.
+ Window-local highlights. Comma-delimited list of highlight
+ |group-name| pairs "{hl-from}:{hl-to},..." where each {hl-from} is
+ a |highlight-groups| item to be overridden by {hl-to} group in
+ the window.
+
+ Note: highlight namespaces take precedence over 'winhighlight'.
+ See |nvim_win_set_hl_ns()| and |nvim_set_hl()|.
+
+ Highlights of vertical separators are determined by the window to the
+ left of the separator. The 'tabline' highlight of a tabpage is
+ decided by the last-focused window of the tabpage. Highlights of
+ the popupmenu are determined by the current window. Highlights in the
+ message area cannot be overridden.
+
+ Example: show a different color for non-current windows: >
+ set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC
+ <
]=],
- full_name = 'winfixwidth',
- redraw = { 'statuslines' },
+ expand_cb = 'expand_set_winhighlight',
+ full_name = 'winhighlight',
+ list = 'onecommacolon',
+ redraw = { 'current_window' },
scope = { 'window' },
- short_desc = N_('keep window width when opening/closing windows'),
- type = 'bool',
+ short_desc = N_('Setup window-local highlights'),
+ type = 'string',
},
{
abbreviation = 'wmh',
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index 544524dd42..002cc68a3b 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -283,7 +283,7 @@ static void set_string_option_global(vimoption_T *opt, char **varp)
/// Set a string option to a new value (without checking the effect).
/// The string is copied into allocated memory.
-/// if ("opt_idx" == -1) "name" is used, otherwise "opt_idx" is used.
+/// if ("opt_idx" == kOptInvalid) "name" is used, otherwise "opt_idx" is used.
/// When "set_sid" is zero set the scriptID to current_sctx.sc_sid. When
/// "set_sid" is SID_NONE don't set the scriptID. Otherwise set the scriptID to
/// "set_sid".
@@ -291,22 +291,9 @@ static void set_string_option_global(vimoption_T *opt, char **varp)
/// @param opt_flags OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL.
///
/// TODO(famiu): Remove this and its win/buf variants.
-void set_string_option_direct(const char *name, int opt_idx, const char *val, int opt_flags,
- int set_sid)
+void set_string_option_direct(OptIndex opt_idx, const char *val, int opt_flags, int set_sid)
{
- int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
- int idx = opt_idx;
-
- if (idx == -1) { // Use name.
- idx = findoption(name);
- if (idx < 0) { // Not found (should not happen).
- internal_error("set_string_option_direct()");
- siemsg(_("For option %s"), name);
- return;
- }
- }
-
- vimoption_T *opt = get_option(idx);
+ vimoption_T *opt = get_option(opt_idx);
if (opt->var == NULL) { // can't set hidden option
return;
@@ -314,53 +301,53 @@ void set_string_option_direct(const char *name, int opt_idx, const char *val, in
assert(opt->var != &p_shada);
+ int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
char *s = xstrdup(val);
- {
- char **varp = (char **)get_varp_scope(opt, both ? OPT_LOCAL : opt_flags);
- if ((opt_flags & OPT_FREE) && (opt->flags & P_ALLOCED)) {
- free_string_option(*varp);
- }
- *varp = s;
+ char **varp = (char **)get_varp_scope(opt, both ? OPT_LOCAL : opt_flags);
- // For buffer/window local option may also set the global value.
- if (both) {
- set_string_option_global(opt, varp);
- }
+ if ((opt_flags & OPT_FREE) && (opt->flags & P_ALLOCED)) {
+ free_string_option(*varp);
+ }
+ *varp = s;
- opt->flags |= P_ALLOCED;
+ // For buffer/window local option may also set the global value.
+ if (both) {
+ set_string_option_global(opt, varp);
+ }
- // When setting both values of a global option with a local value,
- // make the local value empty, so that the global value is used.
- if ((opt->indir & PV_BOTH) && both) {
- free_string_option(*varp);
- *varp = empty_string_option;
- }
- if (set_sid != SID_NONE) {
- sctx_T script_ctx;
+ opt->flags |= P_ALLOCED;
- if (set_sid == 0) {
- script_ctx = current_sctx;
- } else {
- script_ctx.sc_sid = set_sid;
- script_ctx.sc_seq = 0;
- script_ctx.sc_lnum = 0;
- }
- set_option_sctx_idx(idx, opt_flags, script_ctx);
+ // When setting both values of a global option with a local value,
+ // make the local value empty, so that the global value is used.
+ if ((opt->indir & PV_BOTH) && both) {
+ free_string_option(*varp);
+ *varp = empty_string_option;
+ }
+ if (set_sid != SID_NONE) {
+ sctx_T script_ctx;
+
+ if (set_sid == 0) {
+ script_ctx = current_sctx;
+ } else {
+ script_ctx.sc_sid = set_sid;
+ script_ctx.sc_seq = 0;
+ script_ctx.sc_lnum = 0;
}
+ set_option_sctx(opt_idx, opt_flags, script_ctx);
}
}
/// Like set_string_option_direct(), but for a window-local option in "wp".
/// Blocks autocommands to avoid the old curwin becoming invalid.
-void set_string_option_direct_in_win(win_T *wp, const char *name, int opt_idx, const char *val,
- int opt_flags, int set_sid)
+void set_string_option_direct_in_win(win_T *wp, OptIndex opt_idx, const char *val, int opt_flags,
+ int set_sid)
{
win_T *save_curwin = curwin;
block_autocmds();
curwin = wp;
curbuf = curwin->w_buffer;
- set_string_option_direct(name, opt_idx, val, opt_flags, set_sid);
+ set_string_option_direct(opt_idx, val, opt_flags, set_sid);
curwin = save_curwin;
curbuf = curwin->w_buffer;
unblock_autocmds();
@@ -368,14 +355,14 @@ void set_string_option_direct_in_win(win_T *wp, const char *name, int opt_idx, c
/// Like set_string_option_direct(), but for a buffer-local option in "buf".
/// Blocks autocommands to avoid the old curwin becoming invalid.
-void set_string_option_direct_in_buf(buf_T *buf, const char *name, int opt_idx, const char *val,
- int opt_flags, int set_sid)
+void set_string_option_direct_in_buf(buf_T *buf, OptIndex opt_idx, const char *val, int opt_flags,
+ int set_sid)
{
buf_T *save_curbuf = curbuf;
block_autocmds();
curbuf = buf;
- set_string_option_direct(name, opt_idx, val, opt_flags, set_sid);
+ set_string_option_direct(opt_idx, val, opt_flags, set_sid);
curbuf = save_curbuf;
unblock_autocmds();
}
@@ -2095,6 +2082,8 @@ const char *did_set_signcolumn(optset_T *args)
if (check_signcolumn(win) != OK) {
return e_invarg;
}
+ int scwidth = win->w_minscwidth <= 0 ? 0 : MIN(win->w_maxscwidth, win->w_scwidth);
+ win->w_scwidth = MAX(win->w_minscwidth, scwidth);
// When changing the 'signcolumn' to or from 'number', recompute the
// width of the number column if 'number' or 'relativenumber' is set.
if ((*oldval == 'n' && *(oldval + 1) == 'u') || win->w_minscwidth == SCL_NUM) {
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 28de003212..0fc461ae0f 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -1666,7 +1666,7 @@ static char *eval_includeexpr(const char *const ptr, const size_t len)
current_sctx = curbuf->b_p_script_ctx[BV_INEX].script_ctx;
char *res = eval_to_string_safe(curbuf->b_p_inex,
- was_set_insecurely(curwin, "includeexpr", OPT_LOCAL));
+ was_set_insecurely(curwin, kOptIncludeexpr, OPT_LOCAL));
set_vim_var_string(VV_FNAME, NULL, 0);
current_sctx = save_sctx;
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index fbddb1ab4a..cbfaa4ace3 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -14,6 +14,7 @@
#include "nvim/indent.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/marktree.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/move.h"
diff --git a/src/nvim/plines.h b/src/nvim/plines.h
index 6aede88c8b..7227db4524 100644
--- a/src/nvim/plines.h
+++ b/src/nvim/plines.h
@@ -1,10 +1,10 @@
#pragma once
#include <stdbool.h>
-#include <stdint.h>
+#include <stdint.h> // IWYU pragma: keep
#include "nvim/buffer_defs.h"
-#include "nvim/marktree.h"
+#include "nvim/marktree_defs.h"
#include "nvim/pos_defs.h" // IWYU pragma: keep
/// Argument for lbr_chartabsize().
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index f009722357..56fc16a82e 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -767,11 +767,11 @@ static bool pum_set_selected(int n, int repeat)
if (res == OK) {
// Edit a new, empty buffer. Set options for a "wipeout"
// buffer.
- set_option_value_give_err("swf", BOOLEAN_OPTVAL(false), OPT_LOCAL);
- set_option_value_give_err("bl", BOOLEAN_OPTVAL(false), OPT_LOCAL);
- set_option_value_give_err("bt", STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL);
- set_option_value_give_err("bh", STATIC_CSTR_AS_OPTVAL("wipe"), OPT_LOCAL);
- set_option_value_give_err("diff", BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value_give_err(kOptSwapfile, BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value_give_err(kOptBuflisted, BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value_give_err(kOptBuftype, STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL);
+ set_option_value_give_err(kOptBufhidden, STATIC_CSTR_AS_OPTVAL("wipe"), OPT_LOCAL);
+ set_option_value_give_err(kOptDiff, BOOLEAN_OPTVAL(false), OPT_LOCAL);
}
}
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 112f9aa35a..976b7e837d 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -3645,12 +3645,12 @@ static int qf_goto_cwindow(const qf_info_T *qi, bool resize, int sz, bool vertsp
static void qf_set_cwindow_options(void)
{
// switch off 'swapfile'
- set_option_value_give_err("swf", BOOLEAN_OPTVAL(false), OPT_LOCAL);
- set_option_value_give_err("bt", STATIC_CSTR_AS_OPTVAL("quickfix"), OPT_LOCAL);
- set_option_value_give_err("bh", STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL);
+ set_option_value_give_err(kOptSwapfile, BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value_give_err(kOptBuftype, STATIC_CSTR_AS_OPTVAL("quickfix"), OPT_LOCAL);
+ set_option_value_give_err(kOptBufhidden, STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL);
RESET_BINDING(curwin);
curwin->w_p_diff = false;
- set_option_value_give_err("fdm", STATIC_CSTR_AS_OPTVAL("manual"), OPT_LOCAL);
+ set_option_value_give_err(kOptFoldmethod, STATIC_CSTR_AS_OPTVAL("manual"), OPT_LOCAL);
}
// Open a new quickfix or location list window, load the quickfix buffer and
@@ -4212,7 +4212,7 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int q
// resembles reading a file into a buffer, it's more logical when using
// autocommands.
curbuf->b_ro_locked++;
- set_option_value_give_err("ft", STATIC_CSTR_AS_OPTVAL("qf"), OPT_LOCAL);
+ set_option_value_give_err(kOptFiletype, STATIC_CSTR_AS_OPTVAL("qf"), OPT_LOCAL);
curbuf->b_p_ma = false;
keep_filetype = true; // don't detect 'filetype'
@@ -5090,7 +5090,7 @@ void ex_cfile(exarg_T *eap)
}
}
if (*eap->arg != NUL) {
- set_string_option_direct("ef", -1, eap->arg, OPT_FREE, 0);
+ set_string_option_direct(kOptErrorfile, eap->arg, OPT_FREE, 0);
}
char *enc = (*curbuf->b_p_menc != NUL) ? curbuf->b_p_menc : p_menc;
@@ -7220,7 +7220,7 @@ void ex_helpgrep(exarg_T *eap)
bool updated = false;
// Make 'cpoptions' empty, the 'l' flag should not be used here.
char *const save_cpo = p_cpo;
- const bool save_cpo_allocated = is_option_allocated("cpo");
+ const bool save_cpo_allocated = (get_option(kOptCpoptions)->flags & P_ALLOCED);
p_cpo = empty_string_option;
bool new_qi = false;
@@ -7258,7 +7258,7 @@ void ex_helpgrep(exarg_T *eap)
// Darn, some plugin changed the value. If it's still empty it was
// changed and restored, need to restore in the complicated way.
if (*p_cpo == NUL) {
- set_option_value_give_err("cpo", CSTR_AS_OPTVAL(save_cpo), 0);
+ set_option_value_give_err(kOptCpoptions, CSTR_AS_OPTVAL(save_cpo), 0);
}
if (save_cpo_allocated) {
free_string_option(save_cpo);
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 087c26a46f..d0305a1082 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -1061,7 +1061,7 @@ static int add_pack_dir_to_rtp(char *fname, bool is_pack)
xstrlcat(new_rtp, afterdir, new_rtp_capacity);
}
- set_option_value_give_err("rtp", CSTR_AS_OPTVAL(new_rtp), 0);
+ set_option_value_give_err(kOptRuntimepath, CSTR_AS_OPTVAL(new_rtp), 0);
xfree(new_rtp);
retval = OK;
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index 819fbcf885..02e7c3cc68 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -2604,7 +2604,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, ShaDaReadDef
case VAR_LIST: {
list_T *l = vartv.vval.v_list;
int copyID = get_copyID();
- if (!set_ref_in_list(l, copyID, NULL)
+ if (!set_ref_in_list_items(l, copyID, NULL)
&& copyID == l->lv_copyID) {
tv_clear(&vartv);
continue;
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 5065bee347..d20d113d9c 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -3218,14 +3218,14 @@ void ex_spelldump(exarg_T *eap)
if (no_spell_checking(curwin)) {
return;
}
- OptVal spl = get_option_value("spl", NULL, OPT_LOCAL, NULL);
+ OptVal spl = get_option_value(kOptSpelllang, OPT_LOCAL);
// Create a new empty buffer in a new window.
do_cmdline_cmd("new");
// enable spelling locally in the new window
- set_option_value_give_err("spell", BOOLEAN_OPTVAL(true), OPT_LOCAL);
- set_option_value_give_err("spl", spl, OPT_LOCAL);
+ set_option_value_give_err(kOptSpell, BOOLEAN_OPTVAL(true), OPT_LOCAL);
+ set_option_value_give_err(kOptSpelllang, spl, OPT_LOCAL);
optval_free(spl);
if (!buf_is_empty(curbuf)) {
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 4aa0508329..027013c5f0 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -5600,7 +5600,7 @@ static void init_spellfile(void)
&& strstr(path_tail(fname), ".ascii.") != NULL)
? "ascii"
: spell_enc()));
- set_option_value_give_err("spellfile", CSTR_AS_OPTVAL(buf), OPT_LOCAL);
+ set_option_value_give_err(kOptSpellfile, CSTR_AS_OPTVAL(buf), OPT_LOCAL);
break;
}
aspath = false;
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c
index 4dac1b1451..c7d9a65b86 100644
--- a/src/nvim/statusline.c
+++ b/src/nvim/statusline.c
@@ -296,7 +296,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
char buf[MAXPATHL];
char transbuf[MAXPATHL];
char *stl;
- char *opt_name;
+ OptIndex opt_idx = kOptInvalid;
int opt_scope = 0;
stl_hlrec_t *hltab;
StlClickRecord *tabtab;
@@ -320,9 +320,9 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
fillchar = ' ';
attr = HL_ATTR(HLF_TPF);
maxwidth = Columns;
- opt_name = "tabline";
+ opt_idx = kOptTabline;
} else if (draw_winbar) {
- opt_name = "winbar";
+ opt_idx = kOptWinbar;
stl = ((*wp->w_p_wbr != NUL) ? wp->w_p_wbr : p_wbr);
opt_scope = ((*wp->w_p_wbr != NUL) ? OPT_LOCAL : 0);
row = -1; // row zero is first row of text
@@ -351,7 +351,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
if (draw_ruler) {
stl = p_ruf;
- opt_name = "rulerformat";
+ opt_idx = kOptRulerformat;
// advance past any leading group spec - implicit in ru_col
if (*stl == '%') {
if (*++stl == '-') {
@@ -379,7 +379,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
attr = HL_ATTR(HLF_MSG);
}
} else {
- opt_name = "statusline";
+ opt_idx = kOptStatusline;
stl = ((*wp->w_p_stl != NUL) ? wp->w_p_stl : p_stl);
opt_scope = ((*wp->w_p_stl != NUL) ? OPT_LOCAL : 0);
}
@@ -402,7 +402,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
// Make a copy, because the statusline may include a function call that
// might change the option value and free the memory.
stl = xstrdup(stl);
- build_stl_str_hl(ewp, buf, sizeof(buf), stl, opt_name, opt_scope,
+ build_stl_str_hl(ewp, buf, sizeof(buf), stl, opt_idx, opt_scope,
fillchar, maxwidth, &hltab, &tabtab, NULL);
xfree(stl);
@@ -881,7 +881,7 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, linenr_T relnum, statuscol_T *
StlClickRecord *clickrec;
char *stc = xstrdup(wp->w_p_stc);
- int width = build_stl_str_hl(wp, stcp->text, MAXPATHL, stc, "statuscolumn", OPT_LOCAL, ' ',
+ int width = build_stl_str_hl(wp, stcp->text, MAXPATHL, stc, kOptStatuscolumn, OPT_LOCAL, ' ',
stcp->width, &stcp->hlrec, fillclick ? &clickrec : NULL, stcp);
xfree(stc);
@@ -913,8 +913,8 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, linenr_T relnum, statuscol_T *
/// Note: This should not be NameBuff
/// @param outlen The length of the output buffer
/// @param fmt The statusline format string
-/// @param opt_name The option name corresponding to "fmt"
-/// @param opt_scope The scope corresponding to "opt_name"
+/// @param opt_idx Index of the option corresponding to "fmt"
+/// @param opt_scope The scope corresponding to "opt_idx"
/// @param fillchar Character to use when filling empty space in the statusline
/// @param maxwidth The maximum width to make the statusline
/// @param hltab HL attributes (can be NULL)
@@ -922,9 +922,9 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, linenr_T relnum, statuscol_T *
/// @param stcp Status column attributes (can be NULL)
///
/// @return The final width of the statusline
-int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_name, int opt_scope,
- int fillchar, int maxwidth, stl_hlrec_t **hltab, StlClickRecord **tabtab,
- statuscol_T *stcp)
+int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, OptIndex opt_idx,
+ int opt_scope, int fillchar, int maxwidth, stl_hlrec_t **hltab,
+ StlClickRecord **tabtab, statuscol_T *stcp)
{
static size_t stl_items_len = 20; // Initial value, grows as needed.
static stl_item_t *stl_items = NULL;
@@ -957,10 +957,10 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n
stl_separator_locations = xmalloc(sizeof(int) * stl_items_len);
}
- // if "fmt" was set insecurely it needs to be evaluated in the sandbox
- // "opt_name" will be NULL when caller is nvim_eval_statusline()
- const int use_sandbox = opt_name ? was_set_insecurely(wp, opt_name, opt_scope)
- : false;
+ // If "fmt" was set insecurely it needs to be evaluated in the sandbox.
+ // "opt_idx" will be kOptInvalid when caller is nvim_eval_statusline().
+ const int use_sandbox = (opt_idx != kOptInvalid) ? was_set_insecurely(wp, opt_idx, opt_scope)
+ : false;
// When the format starts with "%!" then evaluate it as an expression and
// use the result as the actual format string.
@@ -1545,7 +1545,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n
break;
case STL_SHOWCMD:
- if (p_sc && (opt_name == NULL || strcmp(opt_name, p_sloc) == 0)) {
+ if (p_sc && (opt_idx == kOptInvalid || findoption(p_sloc) == opt_idx)) {
str = showcmd_buf;
}
break;
@@ -2177,8 +2177,8 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n
// TODO(Bram): find out why using called_emsg_before makes tests fail, does it
// matter?
// if (called_emsg > called_emsg_before)
- if (opt_name && did_emsg > did_emsg_before) {
- set_string_option_direct(opt_name, -1, "", OPT_FREE | opt_scope, SID_ERROR);
+ if (opt_idx != kOptInvalid && did_emsg > did_emsg_before) {
+ set_string_option_direct(opt_idx, "", OPT_FREE | opt_scope, SID_ERROR);
}
// A user function may reset KeyTyped, restore it.
diff --git a/src/nvim/statusline.h b/src/nvim/statusline.h
index eab7c1aa47..59a900d566 100644
--- a/src/nvim/statusline.h
+++ b/src/nvim/statusline.h
@@ -4,6 +4,7 @@
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
+#include "nvim/option_defs.h"
#include "nvim/statusline_defs.h" // IWYU pragma: export
/// Array defining what should be done when tabline is clicked
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index fda6aa41e8..af9693c4b0 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -233,7 +233,7 @@ void terminal_open(Terminal **termpp, buf_T *buf, TerminalOptions opts)
aucmd_prepbuf(&aco, buf);
refresh_screen(rv, buf);
- set_option_value("buftype", STATIC_CSTR_AS_OPTVAL("terminal"), OPT_LOCAL);
+ set_option_value(kOptBuftype, STATIC_CSTR_AS_OPTVAL("terminal"), OPT_LOCAL);
// Default settings for terminal buffers
buf->b_p_ma = false; // 'nomodifiable'
@@ -241,8 +241,8 @@ void terminal_open(Terminal **termpp, buf_T *buf, TerminalOptions opts)
buf->b_p_scbk = // 'scrollback' (initialize local from global)
(p_scbk < 0) ? 10000 : MAX(1, p_scbk);
buf->b_p_tw = 0; // 'textwidth'
- set_option_value("wrap", BOOLEAN_OPTVAL(false), OPT_LOCAL);
- set_option_value("list", BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value(kOptWrap, BOOLEAN_OPTVAL(false), OPT_LOCAL);
+ set_option_value(kOptList, BOOLEAN_OPTVAL(false), OPT_LOCAL);
if (buf->b_ffname != NULL) {
buf_set_term_title(buf, buf->b_ffname, strlen(buf->b_ffname));
}
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c
index 7219e04add..3484d104fd 100644
--- a/src/nvim/textformat.c
+++ b/src/nvim/textformat.c
@@ -678,7 +678,7 @@ void auto_format(bool trailblank, bool prev_line)
// Do the formatting and restore the cursor position. "saved_cursor" will
// be adjusted for the text formatting.
saved_cursor = pos;
- format_lines((linenr_T) - 1, false);
+ format_lines(-1, false);
curwin->w_cursor = saved_cursor;
saved_cursor.lnum = 0;
@@ -761,7 +761,7 @@ int comp_textwidth(bool ff)
textwidth -= 1;
}
textwidth -= win_fdccol_count(curwin);
- textwidth -= win_signcol_count(curwin);
+ textwidth -= curwin->w_scwidth;
if (curwin->w_p_nu || curwin->w_p_rnu) {
textwidth -= 8;
@@ -870,7 +870,7 @@ void op_formatexpr(oparg_T *oap)
/// @param c character to be inserted
int fex_format(linenr_T lnum, long count, int c)
{
- int use_sandbox = was_set_insecurely(curwin, "formatexpr", OPT_LOCAL);
+ int use_sandbox = was_set_insecurely(curwin, kOptFormatexpr, OPT_LOCAL);
const sctx_T save_sctx = current_sctx;
// Set v:lnum to the first line number and v:count to the number of lines.
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index c533b288c1..6c47d1b5c7 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -156,14 +156,15 @@ void tinput_init(TermInput *input, Loop *loop)
rstream_init_fd(loop, &input->read_stream, input->in_fd, READ_STREAM_SIZE);
// initialize a timer handle for handling ESC with libtermkey
- time_watcher_init(loop, &input->timer_handle, input);
+ uv_timer_init(&loop->uv, &input->timer_handle);
+ input->timer_handle.data = input;
}
void tinput_destroy(TermInput *input)
{
map_destroy(int, &kitty_key_map);
rbuffer_free(input->key_buffer);
- time_watcher_close(&input->timer_handle, NULL);
+ uv_close((uv_handle_t *)&input->timer_handle, NULL);
stream_close(&input->read_stream, NULL, NULL);
termkey_destroy(input->tk);
}
@@ -176,7 +177,7 @@ void tinput_start(TermInput *input)
void tinput_stop(TermInput *input)
{
rstream_stop(&input->read_stream);
- time_watcher_stop(&input->timer_handle);
+ uv_timer_stop(&input->timer_handle);
}
static void tinput_done_event(void **argv)
@@ -466,17 +467,16 @@ static void tk_getkeys(TermInput *input, bool force)
if (input->ttimeout && input->ttimeoutlen >= 0) {
// Stop the current timer if already running
- time_watcher_stop(&input->timer_handle);
- time_watcher_start(&input->timer_handle, tinput_timer_cb,
- (uint64_t)input->ttimeoutlen, 0);
+ uv_timer_stop(&input->timer_handle);
+ uv_timer_start(&input->timer_handle, tinput_timer_cb, (uint64_t)input->ttimeoutlen, 0);
} else {
tk_getkeys(input, true);
}
}
-static void tinput_timer_cb(TimeWatcher *watcher, void *data)
+static void tinput_timer_cb(uv_timer_t *handle)
{
- TermInput *input = (TermInput *)data;
+ TermInput *input = handle->data;
// If the raw buffer is not empty, process the raw buffer first because it is
// processing an incomplete bracketed paster sequence.
if (rbuffer_size(input->read_stream.buffer)) {
@@ -489,8 +489,8 @@ static void tinput_timer_cb(TimeWatcher *watcher, void *data)
/// Handle focus events.
///
/// If the upcoming sequence of bytes in the input stream matches the termcode
-/// for "focus gained" or "focus lost", consume that sequence and schedule an
-/// event on the main loop.
+/// for "focus gained" or "focus lost", consume that sequence and send an event
+/// to Nvim server.
///
/// @param input the input stream
/// @return true iff handle_focus_event consumed some input
@@ -757,8 +757,8 @@ static void tinput_read_cb(Stream *stream, RBuffer *buf, size_t count_, void *da
int64_t ms = input->ttimeout
? (input->ttimeoutlen >= 0 ? input->ttimeoutlen : 0) : 0;
// Stop the current timer if already running
- time_watcher_stop(&input->timer_handle);
- time_watcher_start(&input->timer_handle, tinput_timer_cb, (uint32_t)ms, 0);
+ uv_timer_stop(&input->timer_handle);
+ uv_timer_start(&input->timer_handle, tinput_timer_cb, (uint32_t)ms, 0);
return;
}
diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h
index 9d276277de..bc490754be 100644
--- a/src/nvim/tui/input.h
+++ b/src/nvim/tui/input.h
@@ -6,7 +6,6 @@
#include "nvim/event/loop.h"
#include "nvim/event/stream.h"
-#include "nvim/event/time.h"
#include "nvim/rbuffer_defs.h"
#include "nvim/tui/input_defs.h" // IWYU pragma: export
#include "nvim/tui/tui.h"
@@ -33,7 +32,7 @@ typedef struct {
OptInt ttimeoutlen;
TermKey *tk;
TermKey_Terminfo_Getstr_Hook *tk_ti_hook_fn; ///< libtermkey terminfo hook
- TimeWatcher timer_handle;
+ uv_timer_t timer_handle;
Loop *loop;
Stream read_stream;
RBuffer *key_buffer;
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index c71eb633e9..70df1464ed 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -42,9 +42,6 @@
# include "nvim/os/tty.h"
#endif
-// Space reserved in two output buffers to make the cursor normal or invisible
-// when flushing. No existing terminal will require 32 bytes to do that.
-#define CNORM_COMMAND_MAX_SIZE 32
#define OUTBUF_SIZE 0xffff
#define TOO_MANY_EVENTS 1000000
@@ -77,7 +74,7 @@ struct TUIData {
TermInput input;
uv_loop_t write_loop;
unibi_term *ut;
- char *term; // value of $TERM
+ char *term; ///< value of $TERM
union {
uv_tty_t tty;
uv_pipe_t pipe;
@@ -148,7 +145,8 @@ static bool cursor_style_enabled = false;
# include "tui/tui.c.generated.h"
#endif
-void tui_start(TUIData **tui_p, int *width, int *height, char **term)
+void tui_start(TUIData **tui_p, int *width, int *height, char **term, bool *rgb)
+ FUNC_ATTR_NONNULL_ALL
{
TUIData *tui = xcalloc(1, sizeof(TUIData));
tui->is_starting = true;
@@ -169,14 +167,14 @@ void tui_start(TUIData **tui_p, int *width, int *height, char **term)
uv_timer_init(&tui->loop->uv, &tui->startup_delay_timer);
tui->startup_delay_timer.data = tui;
- uv_timer_start(&tui->startup_delay_timer, after_startup_cb,
- 100, 0);
+ uv_timer_start(&tui->startup_delay_timer, after_startup_cb, 100, 0);
*tui_p = tui;
loop_poll_events(&main_loop, 1);
*width = tui->width;
*height = tui->height;
*term = tui->term;
+ *rgb = tui->rgb;
}
void tui_set_key_encoding(TUIData *tui)
@@ -334,6 +332,9 @@ static void terminfo_start(TUIData *tui)
int konsolev = konsolev_env ? (int)strtol(konsolev_env, NULL, 10)
: (konsole ? 1 : 0);
+ // truecolor support must be checked before patching/augmenting terminfo
+ tui->rgb = term_has_truecolor(tui, colorterm);
+
patch_terminfo_bugs(tui, term, colorterm, vtev, konsolev, iterm_env, nsterm);
augment_terminfo(tui, term, vtev, konsolev, iterm_env, nsterm);
tui->can_change_scroll_region =
@@ -1307,39 +1308,6 @@ void tui_default_colors_set(TUIData *tui, Integer rgb_fg, Integer rgb_bg, Intege
invalidate(tui, 0, tui->grid.height, 0, tui->grid.width);
}
-/// Begin flushing the TUI. If 'termsync' is set and the terminal supports synchronized updates,
-/// begin a synchronized update. Otherwise, hide the cursor to avoid cursor jumping.
-static void tui_flush_start(TUIData *tui)
- FUNC_ATTR_NONNULL_ALL
-{
- if (tui->sync_output && tui->unibi_ext.sync != -1) {
- UNIBI_SET_NUM_VAR(tui->params[0], 1);
- unibi_out_ext(tui, tui->unibi_ext.sync);
- } else if (!tui->is_invisible) {
- unibi_out(tui, unibi_cursor_invisible);
- tui->is_invisible = true;
- }
-}
-
-/// Finish flushing the TUI. If 'termsync' is set and the terminal supports synchronized updates,
-/// end a synchronized update. Otherwise, make the cursor visible again.
-static void tui_flush_end(TUIData *tui)
- FUNC_ATTR_NONNULL_ALL
-{
- if (tui->sync_output && tui->unibi_ext.sync != -1) {
- UNIBI_SET_NUM_VAR(tui->params[0], 0);
- unibi_out_ext(tui, tui->unibi_ext.sync);
- }
- bool should_invisible = tui->busy || tui->want_invisible;
- if (tui->is_invisible && !should_invisible) {
- unibi_out(tui, unibi_cursor_normal);
- tui->is_invisible = false;
- } else if (!tui->is_invisible && should_invisible) {
- unibi_out(tui, unibi_cursor_invisible);
- tui->is_invisible = true;
- }
-}
-
void tui_flush(TUIData *tui)
{
UGrid *grid = &tui->grid;
@@ -1356,8 +1324,6 @@ void tui_flush(TUIData *tui)
tui_busy_stop(tui); // avoid hidden cursor
}
- tui_flush_start(tui);
-
while (kv_size(tui->invalid_regions)) {
Rect r = kv_pop(tui->invalid_regions);
assert(r.bot <= grid->height && r.right <= grid->width);
@@ -1385,8 +1351,6 @@ void tui_flush(TUIData *tui)
cursor_goto(tui, tui->row, tui->col);
- tui_flush_end(tui);
-
flush_buf(tui);
}
@@ -1439,7 +1403,7 @@ void tui_suspend(TUIData *tui)
tui_mouse_on(tui);
}
stream_set_blocking(tui->input.in_fd, false); // libuv expects this
- ui_client_attach(tui->width, tui->height, tui->term);
+ ui_client_attach(tui->width, tui->height, tui->term, tui->rgb);
#endif
}
@@ -1752,6 +1716,44 @@ static int unibi_find_ext_bool(unibi_term *ut, const char *name)
return -1;
}
+/// Determine if the terminal supports truecolor or not:
+///
+/// 1. If $COLORTERM is "24bit" or "truecolor", return true
+/// 2. Else, check terminfo for Tc, RGB, setrgbf, or setrgbb capabilities. If
+/// found, return true
+/// 3. Else, return false
+static bool term_has_truecolor(TUIData *tui, const char *colorterm)
+{
+ // Check $COLORTERM
+ if (strequal(colorterm, "truecolor") || strequal(colorterm, "24bit")) {
+ return true;
+ }
+
+ // Check for Tc and RGB
+ for (size_t i = 0; i < unibi_count_ext_bool(tui->ut); i++) {
+ const char *n = unibi_get_ext_bool_name(tui->ut, i);
+ if (n && (!strcmp(n, "Tc") || !strcmp(n, "RGB"))) {
+ return true;
+ }
+ }
+
+ // Check for setrgbf and setrgbb
+ bool setrgbf = false;
+ bool setrgbb = false;
+ for (size_t i = 0; i < unibi_count_ext_str(tui->ut) && (!setrgbf || !setrgbb); i++) {
+ const char *n = unibi_get_ext_str_name(tui->ut, i);
+ if (n) {
+ if (!setrgbf && !strcmp(n, "setrgbf")) {
+ setrgbf = true;
+ } else if (!setrgbb && !strcmp(n, "setrgbb")) {
+ setrgbb = true;
+ }
+ }
+ }
+
+ return setrgbf && setrgbb;
+}
+
/// Patches the terminfo records after loading from system or built-in db.
/// Several entries in terminfo are known to be deficient or outright wrong;
/// and several terminal emulators falsely announce incorrect terminal types.
@@ -2253,23 +2255,97 @@ static void augment_terminfo(TUIData *tui, const char *term, int vte_version, in
}
}
+static bool should_invisible(TUIData *tui)
+{
+ return tui->busy || tui->want_invisible;
+}
+
+/// Write the sequence to begin flushing output to `buf`.
+/// If 'termsync' is set and the terminal supports synchronized output, begin synchronized update.
+/// Otherwise, hide the cursor to avoid cursor jumping.
+///
+/// @param buf the buffer to write the sequence to
+/// @param len the length of `buf`
+static size_t flush_buf_start(TUIData *tui, char *buf, size_t len)
+ FUNC_ATTR_NONNULL_ALL
+{
+ const char *str = NULL;
+
+ if (tui->sync_output && tui->unibi_ext.sync != -1) {
+ UNIBI_SET_NUM_VAR(tui->params[0], 1);
+ str = unibi_get_ext_str(tui->ut, (size_t)tui->unibi_ext.sync);
+ } else if (!tui->is_invisible) {
+ str = unibi_get_str(tui->ut, unibi_cursor_invisible);
+ tui->is_invisible = true;
+ }
+
+ if (str == NULL) {
+ return 0;
+ }
+
+ return unibi_run(str, tui->params, buf, len);
+}
+
+/// Write the sequence to end flushing output to `buf`.
+/// If 'termsync' is set and the terminal supports synchronized output, end synchronized update.
+/// Otherwise, make the cursor visible again.
+///
+/// @param buf the buffer to write the sequence to
+/// @param len the length of `buf`
+static size_t flush_buf_end(TUIData *tui, char *buf, size_t len)
+ FUNC_ATTR_NONNULL_ALL
+{
+ size_t offset = 0;
+ if (tui->sync_output && tui->unibi_ext.sync != -1) {
+ UNIBI_SET_NUM_VAR(tui->params[0], 0);
+ const char *str = unibi_get_ext_str(tui->ut, (size_t)tui->unibi_ext.sync);
+ offset = unibi_run(str, tui->params, buf, len);
+ }
+
+ const char *str = NULL;
+ if (tui->is_invisible && !should_invisible(tui)) {
+ str = unibi_get_str(tui->ut, unibi_cursor_normal);
+ tui->is_invisible = false;
+ } else if (!tui->is_invisible && should_invisible(tui)) {
+ str = unibi_get_str(tui->ut, unibi_cursor_invisible);
+ tui->is_invisible = true;
+ }
+
+ if (str != NULL) {
+ assert(len >= offset);
+ offset += unibi_run(str, tui->params, buf + offset, len - offset);
+ }
+
+ return offset;
+}
+
static void flush_buf(TUIData *tui)
{
uv_write_t req;
- uv_buf_t buf;
+ uv_buf_t bufs[3];
+ char pre[32];
+ char post[32];
- if (tui->bufpos <= 0) {
+ if (tui->bufpos <= 0 && tui->is_invisible == should_invisible(tui)) {
return;
}
- buf.base = tui->buf;
- buf.len = UV_BUF_LEN(tui->bufpos);
+ bufs[0].base = pre;
+ bufs[0].len = UV_BUF_LEN(flush_buf_start(tui, pre, sizeof(pre)));
+
+ bufs[1].base = tui->buf;
+ bufs[1].len = UV_BUF_LEN(tui->bufpos);
+
+ bufs[2].base = post;
+ bufs[2].len = UV_BUF_LEN(flush_buf_end(tui, post, sizeof(post)));
if (tui->screenshot) {
- fwrite(buf.base, buf.len, 1, tui->screenshot);
+ for (size_t i = 0; i < ARRAY_SIZE(bufs); i++) {
+ fwrite(bufs[i].base, bufs[i].len, 1, tui->screenshot);
+ }
} else {
int ret
- = uv_write(&req, (uv_stream_t *)&tui->output_handle, &buf, 1, NULL);
+ = uv_write(&req, (uv_stream_t *)&tui->output_handle, bufs, ARRAY_SIZE(bufs), NULL);
if (ret) {
ELOG("uv_write failed: %s", uv_strerror(ret));
}
diff --git a/src/nvim/types_defs.h b/src/nvim/types_defs.h
index c06737abb5..27227685fa 100644
--- a/src/nvim/types_defs.h
+++ b/src/nvim/types_defs.h
@@ -48,3 +48,10 @@ typedef enum {
#define TRISTATE_FROM_INT(val) ((val) == 0 ? kFalse : ((val) >= 1 ? kTrue : kNone))
typedef int64_t OptInt;
+
+// Range entry for the "b_signcols.invalid" map in which the keys are the range start.
+typedef struct {
+ int end; // End of the invalid range.
+ int add; // Number of signs added in the invalid range, negative for deleted signs.
+} SignRange;
+#define SIGNRANGE_INIT { 0, 0 }
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index cb4ebb5c3b..0fc0c5bf86 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -63,6 +63,7 @@ bool ui_cb_ext[kUIExtCount]; ///< Internalized UI capabilities.
static bool has_mouse = false;
static int pending_has_mouse = -1;
+static bool pending_default_colors = false;
static Array call_buf = ARRAY_DICT_INIT;
@@ -234,7 +235,7 @@ void ui_refresh(void)
p_lz = save_p_lz;
if (ext_widgets[kUIMessages]) {
- set_option_value("cmdheight", NUMBER_OPTVAL(0), 0);
+ set_option_value(kOptCmdheight, NUMBER_OPTVAL(0), 0);
command_height();
}
ui_mode_info_set();
@@ -283,8 +284,21 @@ void ui_schedule_refresh(void)
void ui_default_colors_set(void)
{
- ui_call_default_colors_set(normal_fg, normal_bg, normal_sp,
- cterm_normal_fg_color, cterm_normal_bg_color);
+ // Throttle setting of default colors at startup, so it only happens once
+ // if the user sets the colorscheme in startup.
+ pending_default_colors = true;
+ if (starting == 0) {
+ ui_may_set_default_colors();
+ }
+}
+
+static void ui_may_set_default_colors(void)
+{
+ if (pending_default_colors) {
+ pending_default_colors = false;
+ ui_call_default_colors_set(normal_fg, normal_bg, normal_sp,
+ cterm_normal_fg_color, cterm_normal_bg_color);
+ }
}
void ui_busy_start(void)
@@ -442,6 +456,9 @@ void ui_line(ScreenGrid *grid, int row, int startcol, int endcol, int clearcol,
flags |= kLineFlagInvalid;
}
+ // set default colors now so that that text won't have to be repainted later
+ ui_may_set_default_colors();
+
size_t off = grid->line_offset[row] + (size_t)startcol;
ui_call_raw_line(grid->handle, row, startcol, endcol, clearcol, clearattr,
diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c
index eb32c16881..d744560a86 100644
--- a/src/nvim/ui_client.c
+++ b/src/nvim/ui_client.c
@@ -70,14 +70,14 @@ uint64_t ui_client_start_server(int argc, char **argv)
return channel->id;
}
-void ui_client_attach(int width, int height, char *term)
+void ui_client_attach(int width, int height, char *term, bool rgb)
{
MAXSIZE_TEMP_ARRAY(args, 3);
ADD_C(args, INTEGER_OBJ(width));
ADD_C(args, INTEGER_OBJ(height));
MAXSIZE_TEMP_DICT(opts, 9);
- PUT_C(opts, "rgb", BOOLEAN_OBJ(true));
+ PUT_C(opts, "rgb", BOOLEAN_OBJ(rgb));
PUT_C(opts, "ext_linegrid", BOOLEAN_OBJ(true));
PUT_C(opts, "ext_termcolors", BOOLEAN_OBJ(true));
if (term) {
@@ -111,9 +111,10 @@ void ui_client_run(bool remote_ui)
ui_client_is_remote = remote_ui;
int width, height;
char *term;
- tui_start(&tui, &width, &height, &term);
+ bool rgb;
+ tui_start(&tui, &width, &height, &term, &rgb);
- ui_client_attach(width, height, term);
+ ui_client_attach(width, height, term, rgb);
// os_exit() will be invoked when the client channel detaches
while (true) {
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 928dd2967c..fd3bb41de0 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -3031,9 +3031,9 @@ void u_undoline(void)
char *oldp = u_save_line(curbuf->b_u_line_lnum);
ml_replace(curbuf->b_u_line_lnum, curbuf->b_u_line_ptr, true);
- changed_bytes(curbuf->b_u_line_lnum, 0);
extmark_splice_cols(curbuf, (int)curbuf->b_u_line_lnum - 1, 0, (colnr_T)strlen(oldp),
(colnr_T)strlen(curbuf->b_u_line_ptr), kExtmarkUndo);
+ changed_bytes(curbuf->b_u_line_lnum, 0);
xfree(curbuf->b_u_line_ptr);
curbuf->b_u_line_ptr = oldp;
diff --git a/src/nvim/version.c b/src/nvim/version.c
index fc93a01b32..2caf2c0cb8 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -896,7 +896,7 @@ static const int included_patches[] = {
// 1586,
1585,
// 1584,
- // 1583,
+ 1583,
1582,
1581,
// 1580,
diff --git a/src/nvim/window.c b/src/nvim/window.c
index ef1ef89d95..98c62d6f44 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5183,7 +5183,7 @@ void win_new_screensize(void)
if (old_Rows != Rows) {
// If 'window' uses the whole screen, keep it using that.
// Don't change it when set with "-w size" on the command line.
- if (p_window == old_Rows - 1 || (old_Rows == 0 && !option_was_set("window"))) {
+ if (p_window == old_Rows - 1 || (old_Rows == 0 && !option_was_set(kOptWindow))) {
p_window = Rows - 1;
}
old_Rows = Rows;
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua
index ed93135acb..b618bf0e6c 100644
--- a/test/functional/api/buffer_spec.lua
+++ b/test/functional/api/buffer_spec.lua
@@ -170,10 +170,7 @@ describe('api/buf', function()
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
www |
xxx |
@@ -186,10 +183,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 0, 2, true, {"aaabbb"})
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
www |
xxx |
@@ -203,10 +197,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 3, 4, true, {"wwweeee"})
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
wwweeee |
xxx |
@@ -220,10 +211,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 3, 3, true, {"mmm"})
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
wwweeee |
xxx |
@@ -236,10 +224,7 @@ describe('api/buf', function()
meths.win_set_cursor(0, {7, 0})
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
wwweeee |
xxx |
@@ -252,10 +237,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 4, 4, true, {"mmmeeeee"})
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
mmmeeeee |
wwweeee |
@@ -275,10 +257,7 @@ describe('api/buf', function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:[No Name] }|
www |
xxx |
@@ -291,10 +270,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 0, 2, true, {"aaabbb"})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:[No Name] }|
www |
xxx |
@@ -308,10 +284,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 3, 4, true, {"wwweeee"})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:[No Name] }|
wwweeee |
xxx |
@@ -325,10 +298,7 @@ describe('api/buf', function()
meths.buf_set_lines(buf, 3, 3, true, {"mmm"})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:[No Name] }|
mmm |
wwweeee |
@@ -1690,10 +1660,7 @@ describe('api/buf', function()
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
www |
xxx |
@@ -1706,10 +1673,7 @@ describe('api/buf', function()
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:[No Name] }|
www |
xxx |
@@ -1729,10 +1693,7 @@ describe('api/buf', function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:[No Name] }|
www |
xxx |
@@ -1745,10 +1706,7 @@ describe('api/buf', function()
meths.buf_set_text(buf, 0,3, 1,0, {"X"})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:[No Name] }|
www |
xxx |
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua
index bf76db432f..6c250ad6ce 100644
--- a/test/functional/api/buffer_updates_spec.lua
+++ b/test/functional/api/buffer_updates_spec.lua
@@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq, ok = helpers.eq, helpers.ok
+local funcs = helpers.funcs
local buffer, command, eval, nvim, next_msg = helpers.buffer,
helpers.command, helpers.eval, helpers.nvim, helpers.next_msg
local nvim_prog = helpers.nvim_prog
@@ -832,7 +833,10 @@ describe('API: buffer events:', function()
it('when :terminal lines change', function()
local buffer_lines = {}
local expected_lines = {}
- command('terminal "'..nvim_prog..'" -u NONE -i NONE -n -c "set shortmess+=A"')
+ funcs.termopen({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '-n', '-c', 'set shortmess+=A' }, {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
+
local b = nvim('get_current_buf')
ok(buffer('attach', b, true, {}))
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua
index 44a151cf6a..facabee7a4 100644
--- a/test/functional/api/extmark_spec.lua
+++ b/test/functional/api/extmark_spec.lua
@@ -435,14 +435,7 @@ describe('API/extmarks', function()
-- This shouldn't seg fault
screen:expect([[
12345^ 1 |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*8
|
]])
end)
@@ -495,14 +488,7 @@ describe('API/extmarks', function()
insert('abc')
screen:expect([[
ab^c12345 |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*8
|
]])
local rv = get_extmark_by_id(ns, marks[1])
@@ -1628,26 +1614,23 @@ describe('API/extmarks', function()
screen = Screen.new(40, 6)
screen:attach()
feed('dd6iaaa bbb ccc<CR><ESC>gg')
- set_extmark(ns, 1, 0, 0, { invalidate = true, sign_text = 'S1' })
- set_extmark(ns, 2, 1, 0, { invalidate = true, sign_text = 'S2' })
+ meths.set_option_value('signcolumn', 'auto:2', {})
+ set_extmark(ns, 1, 0, 0, { invalidate = true, sign_text = 'S1', end_row = 1 })
+ set_extmark(ns, 2, 1, 0, { invalidate = true, sign_text = 'S2', end_row = 2 })
-- mark with invalidate is removed
- command('d')
+ command('d2')
screen:expect([[
S2^aaa bbb ccc |
- aaa bbb ccc |
- aaa bbb ccc |
- aaa bbb ccc |
- aaa bbb ccc |
- |
+ aaa bbb ccc |*3
+ |*2
]])
-- mark is restored with undo_restore == true
command('silent undo')
screen:expect([[
- S1^aaa bbb ccc |
- S2aaa bbb ccc |
- aaa bbb ccc |
- aaa bbb ccc |
- aaa bbb ccc |
+ S1 ^aaa bbb ccc |
+ S1S2aaa bbb ccc |
+ S2 aaa bbb ccc |
+ aaa bbb ccc |*2
|
]])
-- mark is deleted with undo_restore == false
@@ -1922,12 +1905,9 @@ describe('API/win_extmark', function()
screen:expect({
grid = [[
## grid 1
- [4:--------------------]|
- [4:--------------------]|
- [4:--------------------]|
+ [4:--------------------]|*3
[No Name] [+] |
- [2:--------------------]|
- [2:--------------------]|
+ [2:--------------------]|*2
[No Name] [+] |
[3:--------------------]|
## grid 2
@@ -1958,12 +1938,9 @@ describe('API/win_extmark', function()
screen:expect({
grid = [[
## grid 1
- [4:--------------------]|
- [4:--------------------]|
- [4:--------------------]|
+ [4:--------------------]|*3
[No Name] [+] |
- [2:--------------------]|
- [2:--------------------]|
+ [2:--------------------]|*2
[No Name] [+] |
[3:--------------------]|
## grid 2
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 7287666190..3d3b478d66 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -285,12 +285,7 @@ describe('API', function()
meths.exec2("echo 'hello'", { output = false })
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
hello |
]]}
end)
@@ -304,10 +299,7 @@ describe('API', function()
meths.exec2("echo 'hello'", { output = true })
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
exec([[
@@ -318,10 +310,7 @@ describe('API', function()
feed([[:echon 1 | call Print() | echon 5<CR>]])
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
15 |
]]}
end)
@@ -1140,8 +1129,7 @@ describe('API', function()
nvim('paste', '', true, 3)
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
:Foo^ |
]])
end)
@@ -1152,8 +1140,7 @@ describe('API', function()
nvim('paste', 'normal! \023\022\006\027', true, -1)
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
:normal! ^W^V^F^[^ |
]])
end)
@@ -1319,6 +1306,10 @@ describe('API', function()
eq("Key not found: lua", pcall_err(meths.del_var, 'lua'))
meths.set_var('lua', 1)
+ -- Empty keys are allowed in Vim dicts (and msgpack).
+ nvim('set_var', 'dict_empty_key', {[''] = 'empty key'})
+ eq({[''] = 'empty key'}, nvim('get_var', 'dict_empty_key'))
+
-- Set locked g: var.
command('lockvar lua')
eq('Key is locked: lua', pcall_err(meths.del_var, 'lua'))
@@ -1983,7 +1974,7 @@ describe('API', function()
it('errors when context dictionary is invalid', function()
eq('E474: Failed to convert list to msgpack string buffer',
pcall_err(nvim, 'load_context', { regs = { {} }, jumps = { {} } }))
- eq("Empty dictionary keys aren't allowed",
+ eq('E474: Failed to convert list to msgpack string buffer',
pcall_err(nvim, 'load_context', { regs = { { [''] = '' } } }))
end)
end)
@@ -2102,9 +2093,7 @@ describe('API', function()
feed([[:call nvim_out_write("\na\n")<CR>]])
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2: }|
|
a |
@@ -2114,8 +2103,7 @@ describe('API', function()
feed([[:call nvim_out_write("b\n\nc\n")<CR>]])
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2: }|
b |
|
@@ -2128,9 +2116,7 @@ describe('API', function()
feed([[:lua vim.api.nvim_out_write('aaa\0bbb\0\0ccc\nddd\0\0\0eee\n')<CR>]])
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2: }|
aaa{3:^@}bbb{3:^@^@}ccc |
ddd{3:^@^@^@}eee |
@@ -2157,12 +2143,7 @@ describe('API', function()
nvim_async('err_write', 'has bork\n')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{1:has bork} |
]])
end)
@@ -2171,9 +2152,7 @@ describe('API', function()
nvim_async('err_write', 'something happened\nvery bad\n')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3: }|
{1:something happened} |
{1:very bad} |
@@ -2201,12 +2180,7 @@ describe('API', function()
nvim_async('err_write', 'fail\n')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{1:very fail} |
]])
helpers.poke_eventloop()
@@ -2215,9 +2189,7 @@ describe('API', function()
nvim_async('err_write', 'more fail\ntoo fail\n')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3: }|
{1:more fail} |
{1:too fail} |
@@ -2230,9 +2202,7 @@ describe('API', function()
nvim_async('err_write', 'aaa\0bbb\0\0ccc\nddd\0\0\0eee\n')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3: }|
{1:aaa^@bbb^@^@ccc} |
{1:ddd^@^@^@eee} |
@@ -2270,12 +2240,7 @@ describe('API', function()
feed('<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]])
end)
@@ -2392,7 +2357,11 @@ describe('API', function()
eq(info, meths.get_chan_info(3))
-- :terminal with args + running process.
- command(':exe "terminal" shellescape(v:progpath) "-u NONE -i NONE"')
+ command('enew')
+ local progpath_esc = eval('shellescape(v:progpath)')
+ funcs.termopen(('%s -u NONE -i NONE'):format(progpath_esc), {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
eq(-1, eval('jobwait([&channel], 0)[0]')) -- Running?
local expected2 = {
stream = 'job',
@@ -2402,11 +2371,11 @@ describe('API', function()
eval('&shell'),
'/s',
'/c',
- fmt('"%s -u NONE -i NONE"', eval('shellescape(v:progpath)')),
+ fmt('"%s -u NONE -i NONE"', progpath_esc),
} or {
eval('&shell'),
eval('&shellcmdflag'),
- fmt('%s -u NONE -i NONE', eval('shellescape(v:progpath)')),
+ fmt('%s -u NONE -i NONE', progpath_esc),
}
),
mode = 'terminal',
@@ -2851,8 +2820,7 @@ describe('API', function()
meths.set_current_buf(2)
screen:expect([[
^some text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]], {
[1] = {bold = true, foreground = Screen.colors.Blue1},
@@ -2929,8 +2897,7 @@ describe('API', function()
meths.set_current_buf(edited_buf)
screen:expect([[
^some text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
eq('nofile', meths.get_option_value('buftype', {buf=edited_buf}))
@@ -2942,8 +2909,7 @@ describe('API', function()
command('bwipe')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end)
@@ -3221,12 +3187,7 @@ describe('API', function()
feed(':call nvim_echo([["msg"]], v:false, {})<CR>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
msg |
]]}
end)
@@ -3235,12 +3196,7 @@ describe('API', function()
nvim_async("echo", {{"msg_a"}, {"msg_b", "Statement"}, {"msg_c", "Special"}}, true, {})
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
msg_a{3:msg_b}{4:msg_c} |
]]}
end)
@@ -3249,9 +3205,7 @@ describe('API', function()
nvim_async("echo", {{"msg_a\nmsg_a", "Statement"}, {"msg_b", "Special"}}, true, {})
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2: }|
{3:msg_a} |
{3:msg_a}{4:msg_b} |
@@ -3330,8 +3284,7 @@ describe('API', function()
{0:~}{3:Press ENTER or type command to continue}{1: }{0: }|
{0:~}{4:term://~/config2/docs/pres//32693:vim --clean +smile 29,39 All}{0: }|
{0:~}{1::call nvim__screenshot("smile2.cat") }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end)
@@ -3359,13 +3312,8 @@ describe('API', function()
screen:expect{grid=[[
|
{0:~}{1:^ }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~}{1: }{0: }|*4
+ {0:~ }|*3
|
]]}
@@ -3373,13 +3321,8 @@ describe('API', function()
screen:expect{grid=[[
|
{0:~}{7: }{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~}{1: }{0: }|*4
+ {0:~ }|*3
{6:-- TERMINAL --} |
]]}
@@ -3392,13 +3335,8 @@ describe('API', function()
screen:expect{grid=[[
|
{0:~}{1:herrejösses!}{7: }{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~}{1: }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~}{1: }{0: }|*4
+ {0:~ }|*3
{6:-- TERMINAL --} |
]]}
eq('ba\024blaherrejösses!', exec_lua [[ return stream ]])
@@ -4151,8 +4089,7 @@ describe('API', function()
screen:expect([[
foo |
bar |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
Entering Ex mode. Type "visual" to go to Normal mode. |
:1^ |
@@ -4510,10 +4447,7 @@ describe('API', function()
meths.cmd({cmd = 'echo', args = {[['hello']]}}, {output = true})
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
exec([[
@@ -4524,10 +4458,7 @@ describe('API', function()
feed([[:echon 1 | call Print() | echon 5<CR>]])
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
15 |
]]}
end)
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua
index 6737c2d15b..67284c01e0 100644
--- a/test/functional/api/window_spec.lua
+++ b/test/functional/api/window_spec.lua
@@ -96,14 +96,7 @@ describe('API/win', function()
screen:expect{grid=[[
^prologue |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*8
]]}
-- cursor position is at beginning
eq({1, 0}, window('get_cursor', win))
@@ -111,13 +104,7 @@ describe('API/win', function()
-- move cursor to end
window('set_cursor', win, {101, 0})
screen:expect{grid=[[
- |
- |
- |
- |
- |
- |
- |
+ |*7
^epilogue |
|
]]}
@@ -126,14 +113,7 @@ describe('API/win', function()
window('set_cursor', win, {1, 0})
screen:expect{grid=[[
^prologue |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*8
]]}
-- move focus to new window
@@ -144,12 +124,10 @@ describe('API/win', function()
eq({1, 0}, window('get_cursor', win))
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
prologue |
- |
- |
+ |*2
{3:[No Name] [+] }|
|
]]}
@@ -158,11 +136,9 @@ describe('API/win', function()
window('set_cursor', win, {101, 0})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
- |
- |
+ |*2
epilogue |
{3:[No Name] [+] }|
|
@@ -172,12 +148,10 @@ describe('API/win', function()
window('set_cursor', win, {1, 0})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
prologue |
- |
- |
+ |*2
{3:[No Name] [+] }|
|
]]}
@@ -232,8 +206,7 @@ describe('API/win', function()
bbb │bbb |
ccc │ccc |
{2:dd^d }│{2:ddd }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{3:[No Name] [+] 4,3 All }{4:[No Name] [+] 4,3 All}|
|
]])
@@ -243,8 +216,7 @@ describe('API/win', function()
bbb │bbb |
ccc │ccc |
{2:dd^d }│ddd |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{3:[No Name] [+] 4,3 All }{4:[No Name] [+] 1,1 All}|
|
]])
@@ -272,8 +244,7 @@ describe('API/win', function()
bb{2:b} │bb{2:b} |
cc{2:c} │cc{2:c} |
dd^d │ddd |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{3:[No Name] [+] }{4:[No Name] [+] }|
|
]])
@@ -283,8 +254,7 @@ describe('API/win', function()
bb{2:b} │bbb |
cc{2:c} │{2:c}cc |
dd^d │{2:d}dd |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{3:[No Name] [+] }{4:[No Name] [+] }|
|
]])
diff --git a/test/functional/autocmd/autocmd_oldtest_spec.lua b/test/functional/autocmd/autocmd_oldtest_spec.lua
index dfd746a06e..3ff4d9b873 100644
--- a/test/functional/autocmd/autocmd_oldtest_spec.lua
+++ b/test/functional/autocmd/autocmd_oldtest_spec.lua
@@ -75,7 +75,7 @@ describe('oldtests', function()
funcs.writefile(funcs.split(content, "\n"), fname)
funcs.delete('Xout')
- funcs.system(string.format('%s -u NORC -i NONE -N -S %s', meths.get_vvar('progpath'), fname))
+ funcs.system(string.format('%s --clean -N -S %s', meths.get_vvar('progpath'), fname))
eq(1, funcs.filereadable('Xout'))
funcs.delete('Xxx1')
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua
index 63a487c8bc..b9ece82420 100644
--- a/test/functional/autocmd/autocmd_spec.lua
+++ b/test/functional/autocmd/autocmd_spec.lua
@@ -272,42 +272,22 @@ describe('autocmd', function()
]])
screen:expect([[
^bb |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]])
feed(":enew | doautoall User<cr>")
screen:expect([[
{2:bb }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {3:~ }|*4
+ {1:~ }|*4
^:enew | doautoall User |
]])
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
13 |
]])
eq(7, eval('g:test'))
@@ -323,28 +303,15 @@ describe('autocmd', function()
feed(":doautoall User<cr>")
screen:expect([[
{2:bb }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {3:~ }|*4
+ {1:~ }|*4
^:doautoall User |
]])
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
13 |
]])
-- win vars in aucmd_win should have been reset
@@ -373,11 +340,7 @@ describe('autocmd', function()
]]
screen:expect [[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{3:[No Name] }|
|
{2:[No Name] }|
diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua
index 82fb9b9444..577ee53c9d 100644
--- a/test/functional/autocmd/cmdline_spec.lua
+++ b/test/functional/autocmd/cmdline_spec.lua
@@ -68,9 +68,7 @@ describe('cmdline autocommands', function()
feed(':')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
@@ -94,11 +92,7 @@ describe('cmdline autocommands', function()
screen:expect([[
|
^lorem ipsum |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -160,10 +154,7 @@ describe('cmdline autocommands', function()
|
lorem ipsum |
^lorem ipsum. |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
diff --git a/test/functional/autocmd/focus_spec.lua b/test/functional/autocmd/focus_spec.lua
index c72842f14b..6a5cdbb96e 100644
--- a/test/functional/autocmd/focus_spec.lua
+++ b/test/functional/autocmd/focus_spec.lua
@@ -2,7 +2,6 @@ local helpers = require('test.functional.helpers')(after_each)
local thelpers = require('test.functional.terminal.helpers')
local luv = require('luv')
local clear = helpers.clear
-local nvim_prog = helpers.nvim_prog
local feed_command = helpers.feed_command
local feed_data = thelpers.feed_data
@@ -14,10 +13,12 @@ describe('autoread TUI FocusGained/FocusLost', function()
before_each(function()
clear()
- screen = thelpers.screen_setup(
- 0,
- '["'..nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "set noswapfile noshowcmd noruler"]'
- )
+ screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'set noswapfile noshowcmd noruler notermguicolors',
+ })
end)
teardown(function()
@@ -39,9 +40,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -49,9 +48,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
feed_command('edit '..path)
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:xtest-foo }|
:edit xtest-foo |
{3:-- TERMINAL --} |
@@ -60,9 +57,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
feed_data('\027[O')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:xtest-foo }|
:edit xtest-foo |
{3:-- TERMINAL --} |
diff --git a/test/functional/autocmd/show_spec.lua b/test/functional/autocmd/show_spec.lua
index 9e0a5b819a..437b664bf5 100644
--- a/test/functional/autocmd/show_spec.lua
+++ b/test/functional/autocmd/show_spec.lua
@@ -79,10 +79,7 @@ describe(":autocmd", function()
feed('q')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua
index 65f947132e..5ae468e560 100644
--- a/test/functional/core/fileio_spec.lua
+++ b/test/functional/core/fileio_spec.lua
@@ -30,6 +30,8 @@ local feed_command = helpers.feed_command
local skip = helpers.skip
local is_os = helpers.is_os
local is_ci = helpers.is_ci
+local spawn = helpers.spawn
+local set_session = helpers.set_session
describe('fileio', function()
before_each(function()
@@ -49,48 +51,74 @@ describe('fileio', function()
rmdir('Xtest_backupdir with spaces')
end)
- it('fsync() codepaths #8304', function()
- clear({ args={ '-i', 'Xtest_startup_shada',
- '--cmd', 'set nofsync',
- '--cmd', 'set directory=Xtest_startup_swapdir' } })
+ local args = { nvim_prog, '--clean', '--cmd', 'set nofsync directory=Xtest_startup_swapdir', }
+ --- Starts a new nvim session and returns an attached screen.
+ local function startup(extra_args)
+ extra_args = extra_args or {}
+ local argv = vim.tbl_flatten({args, '--embed', extra_args})
+ local screen_nvim = spawn(argv)
+ set_session(screen_nvim)
+ local screen = Screen.new(70, 10)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.NvimDarkGrey4};
+ [2] = {background = Screen.colors.NvimDarkGrey1, foreground = Screen.colors.NvimLightGrey3};
+ [3] = {foreground = Screen.colors.NvimLightCyan};
+ })
+ return screen
+ end
+
+ it("fsync() with 'nofsync' #8304", function()
+ clear({ args={ '--cmd', 'set nofsync directory=Xtest_startup_swapdir', } })
-- These cases ALWAYS force fsync (regardless of 'fsync' option):
-- 1. Idle (CursorHold) with modified buffers (+ 'swapfile').
command('write Xtest_startup_file1')
- feed('ifoo<esc>h')
+ feed('Afoo<esc>h')
command('write')
- eq(0, request('nvim__stats').fsync) -- 'nofsync' is the default.
+ eq(0, request('nvim__stats').fsync)
command('set swapfile')
command('set updatetime=1')
- feed('izub<esc>h') -- File is 'modified'.
+ feed('Azub<esc>h') -- File is 'modified'.
sleep(3) -- Allow 'updatetime' to expire.
retry(3, nil, function()
eq(1, request('nvim__stats').fsync)
end)
- command('set updatetime=9999')
-
- -- 2. Exit caused by deadly signal (+ 'swapfile').
- local j = funcs.jobstart({ nvim_prog, '-u', 'NONE', '-i',
- 'Xtest_startup_shada', '--headless',
- '-c', 'set swapfile',
- '-c', 'write Xtest_startup_file2',
- '-c', 'put =localtime()', })
- sleep(10) -- Let Nvim start.
- funcs.jobstop(j) -- Send deadly signal.
-
- -- 3. SIGPWR signal.
- -- ??
+ command('set updatetime=100000 updatecount=100000')
- -- 4. Explicit :preserve command.
+ -- 2. Explicit :preserve command.
command('preserve')
- eq(2, request('nvim__stats').fsync)
+ -- TODO: should be exactly 2; where is the extra fsync() is coming from? #26404
+ ok(request('nvim__stats').fsync == 2 or request('nvim__stats').fsync == 3)
- -- 5. Enable 'fsync' option, write file.
+ -- 3. Enable 'fsync' option, write file.
command('set fsync')
- feed('ibaz<esc>h')
+ feed('Abaz<esc>h')
command('write')
- eq(4, request('nvim__stats').fsync)
+ -- TODO: should be exactly 4; where is the extra fsync() is coming from? #26404
+ ok(request('nvim__stats').fsync == 4 or request('nvim__stats').fsync == 5)
+ eq('foozubbaz', trim(read_file('Xtest_startup_file1')))
+
+ -- 4. Exit caused by deadly signal (+ 'swapfile').
+ local j = funcs.jobstart(vim.tbl_flatten({args, '--embed'}), {rpc=true})
+ funcs.rpcrequest(j, 'nvim_exec2', [[
+ set nofsync directory=Xtest_startup_swapdir
+ edit Xtest_startup_file2
+ write
+ put ='fsyncd text'
+ ]], {})
+ eq('Xtest_startup_swapdir', funcs.rpcrequest(j, 'nvim_eval', '&directory'))
+ funcs.jobstop(j) -- Send deadly signal.
+
+ local screen = startup()
+ feed(':recover Xtest_startup_file2<cr>')
+ screen:expect({any = [[Using swap file "Xtest_startup_swapdir[/\]Xtest_startup_file2%.swp"]]})
+ feed('<cr>')
+ screen:expect({any = 'fsyncd text'})
+
+ -- 5. SIGPWR signal.
+ -- oldtest: Test_signal_PWR()
end)
it('backup #9709', function()
@@ -243,8 +271,7 @@ describe('fileio', function()
command("e Xtest-overwrite-forced")
screen:expect([[
^foobar |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
"Xtest-overwrite-forced" [noeol] 1L, 6B |
]])
@@ -268,16 +295,14 @@ describe('fileio', function()
feed("<cr>")
screen:expect([[
^foobar |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
-- Use a screen test because the warning does not set v:errmsg.
command("w!")
screen:expect([[
^foobar |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
<erwrite-forced" [noeol] 1L, 6B written |
]])
end)
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 038368c387..6d021fb73f 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -676,7 +676,7 @@ describe('jobs', function()
on_stderr = function(chan, data, name) stderr = data end,
on_stdout = function(chan, data, name) stdout = data end,
}
- local j1 = vim.fn.jobstart({ vim.v.progpath, '-es', '-V1',( '+echo "%s="..getenv("%s")'):format(envname, envname), '+qa!' }, opt)
+ local j1 = vim.fn.jobstart({ vim.v.progpath, '-es', '-V1',('+echo "%s="..getenv("%s")'):format(envname, envname), '+qa!' }, opt)
vim.fn.jobwait({ j1 }, 10000)
return join({ join(stdout), join(stderr) })
]],
@@ -894,8 +894,7 @@ describe('jobs', function()
feed_command('call PrintAndWait()')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
aaa |
bbb |
@@ -1151,10 +1150,7 @@ describe("pty process teardown", function()
screen:attach()
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
end)
@@ -1162,20 +1158,18 @@ describe("pty process teardown", function()
it("does not prevent/delay exit. #4798 #4900", function()
skip(is_os('win'))
-- Use a nested nvim (in :term) to test without --headless.
- feed_command(":terminal '"..helpers.nvim_prog
- .."' -u NONE -i NONE --cmd '"..nvim_set.."' "
+ funcs.termopen({
+ helpers.nvim_prog, '-u', 'NONE', '-i', "NONE", '--cmd', nvim_set,
-- Use :term again in the _nested_ nvim to get a PTY process.
-- Use `sleep` to simulate a long-running child of the PTY.
- .."+terminal +'!(sleep 300 &)' +qa")
+ '+terminal', '+!(sleep 300 &)', '+qa',
+ }, { env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } })
-- Exiting should terminate all descendants (PTY, its children, ...).
screen:expect([[
^ |
[Process exited 0] |
- |
- |
- |
- |
+ |*4
]])
end)
end)
diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua
index d705d56575..723bcbe153 100644
--- a/test/functional/core/main_spec.lua
+++ b/test/functional/core/main_spec.lua
@@ -62,19 +62,18 @@ describe('command-line option', function()
screen:attach()
local args = {
nvim_prog_abs(), '-u', 'NONE', '-i', 'NONE',
- '--cmd', '"set noswapfile shortmess+=IFW fileformats=unix"',
+ '--cmd', '"set noswapfile shortmess+=IFW fileformats=unix notermguicolors"',
'-s', '-'
}
-- Need to explicitly pipe to stdin so that the embedded Nvim instance doesn't try to read
-- data from the terminal #18181
- funcs.termopen(string.format([[echo "" | %s]], table.concat(args, " ")))
+ funcs.termopen(string.format([[echo "" | %s]], table.concat(args, " ")), {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
screen:expect([[
{1:^ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*4
{3:[No Name] 0,0-1 All}|
{1: }|
|
@@ -87,11 +86,7 @@ describe('command-line option', function()
screen:expect([[
|
[Process exited 1] |
- |
- |
- |
- |
- |
+ |*5
-- TERMINAL -- |
]])
--[=[ Example of incorrect output:
@@ -102,8 +97,7 @@ describe('command-line option', function()
LENO' failed. |
|
[Process exited 6] |
- |
- |
+ |*2
]])
]=]
end)
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index 94ec3d4907..44e71c4946 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -49,8 +49,7 @@ describe('startup', function()
funcs.termopen({ nvim_prog, '-u', 'NONE', '--server', eval('v:servername'), '--remote-ui' })
screen:expect([[
^Cannot attach UI of :terminal child to its parent. (Unset $NVIM to skip this check) |
- |
- |
+ |*2
]])
end)
@@ -69,8 +68,17 @@ describe('startup', function()
local screen
screen = Screen.new(60, 7)
screen:attach()
- command([[let g:id = termopen('"]]..nvim_prog..
- [[" -u NONE -i NONE --cmd "set noruler" -D')]])
+ local id = funcs.termopen({
+ nvim_prog,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'set noruler',
+ '-D'
+ }, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
screen:expect([[
^ |
|
@@ -80,15 +88,12 @@ describe('startup', function()
> |
|
]])
- command([[call chansend(g:id, "cont\n")]])
+ funcs.chansend(id, 'cont\n')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[No Name] |
- |
- |
+ |*2
]])
end)
end)
@@ -285,10 +290,17 @@ describe('startup', function()
command([[set shellcmdflag=/s\ /c shellxquote=\"]])
end
-- Running in :terminal
- command([[exe printf("terminal %s -u NONE -i NONE --cmd \"]]
- ..nvim_set..[[\"]]
- ..[[ -c \"echo has('ttyin') has('ttyout')\""]]
- ..[[, shellescape(v:progpath))]])
+ funcs.termopen({
+ nvim_prog,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', nvim_set,
+ '-c', 'echo has("ttyin") has("ttyout")',
+ }, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
screen:expect([[
^ |
~ |
@@ -306,11 +318,13 @@ describe('startup', function()
os.remove('Xtest_startup_ttyout')
end)
-- Running in :terminal
- command([[exe printf("terminal %s -u NONE -i NONE --cmd \"]]
- ..nvim_set..[[\"]]
- ..[[ -c \"call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')\"]]
- ..[[ -c q | cat -v"]] -- Output to a pipe.
- ..[[, shellescape(v:progpath))]])
+ funcs.termopen(([["%s" -u NONE -i NONE --cmd "%s"]]
+ ..[[ -c "call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')"]]
+ ..[[ -c q | cat -v]]):format(nvim_prog, nvim_set), {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
retry(nil, 3000, function()
sleep(1)
eq('1\n0\n', -- stdin is a TTY, stdout is a pipe
@@ -327,12 +341,14 @@ describe('startup', function()
os.remove('Xtest_startup_ttyout')
end)
-- Running in :terminal
- command([[exe printf("terminal echo foo | ]] -- Input from a pipe.
- ..[[%s -u NONE -i NONE --cmd \"]]
- ..nvim_set..[[\"]]
- ..[[ -c \"call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')\"]]
- ..[[ -c q -- -"]]
- ..[[, shellescape(v:progpath))]])
+ funcs.termopen(([[echo foo | ]] -- Input from a pipe.
+ ..[["%s" -u NONE -i NONE --cmd "%s"]]
+ ..[[ -c "call writefile([has('ttyin'), has('ttyout')], 'Xtest_startup_ttyout')"]]
+ ..[[ -c q -- -]]):format(nvim_prog, nvim_set), {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
retry(nil, 3000, function()
sleep(1)
eq('0\n1\n', -- stdin is a pipe, stdout is a TTY
@@ -347,11 +363,13 @@ describe('startup', function()
command([[set shellcmdflag=/s\ /c shellxquote=\"]])
end
-- Running in :terminal
- command([[exe printf("terminal echo foo | ]] -- Input from a pipe.
- ..[[%s -u NONE -i NONE --cmd \"]]
- ..nvim_set..[[\"]]
- ..[[ -c \"echo has('ttyin') has('ttyout')\""]]
- ..[[, shellescape(v:progpath))]])
+ funcs.termopen(([[echo foo | ]]
+ .. [["%s" -u NONE -i NONE --cmd "%s"]]
+ .. [[ -c "echo has('ttyin') has('ttyout')"]]):format(nvim_prog, nvim_set), {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
screen:expect([[
^foo |
~ |
@@ -453,8 +471,17 @@ describe('startup', function()
local screen
screen = Screen.new(60, 6)
screen:attach()
- command([[let g:id = termopen('"]]..nvim_prog..
- [[" -u NONE -i NONE --cmd "set noruler" --cmd "let g:foo = g:bar"')]])
+ local id = funcs.termopen({
+ nvim_prog,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'set noruler',
+ '--cmd', 'let g:foo = g:bar',
+ }, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
screen:expect([[
^ |
|
@@ -463,14 +490,12 @@ describe('startup', function()
Press ENTER or type command to continue |
|
]])
- command([[call chansend(g:id, "\n")]])
+ funcs.chansend(id, '\n')
screen:expect([[
^ |
- ~ |
- ~ |
+ ~ |*2
[No Name] |
- |
- |
+ |*2
]])
end)
@@ -866,16 +891,17 @@ describe('user config init', function()
local screen = Screen.new(50, 8)
screen:attach()
- funcs.termopen({nvim_prog})
+ funcs.termopen({nvim_prog}, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
screen:expect({ any = pesc('[i]gnore, (v)iew, (d)eny, (a)llow:') })
-- `i` to enter Terminal mode, `a` to allow
feed('ia')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
[No Name] 0,0-1 All|
|
-- TERMINAL -- |
@@ -883,10 +909,7 @@ describe('user config init', function()
feed(':echo g:exrc_file<CR>')
screen:expect(string.format([[
|
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
[No Name] 0,0-1 All|
%s%s|
-- TERMINAL -- |
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua
index 84af90a298..504943e3cc 100644
--- a/test/functional/editor/completion_spec.lua
+++ b/test/functional/editor/completion_spec.lua
@@ -41,22 +41,14 @@ describe('completion', function()
screen:expect([[
foo |
foo^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- Keyword Local completion (^N^P) The only match} |
]])
feed('<C-e>')
screen:expect([[
foo |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
feed('<ESC>')
@@ -112,10 +104,7 @@ describe('completion', function()
foo^ |
{2:bar foobaz baz }{0: }|
{1:abbr kind menu }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- Omni completion (^O^N^P) }{4:match 1 of 2} |
]])
eq({word = 'foo', abbr = 'bar', menu = 'baz',
@@ -140,11 +129,7 @@ describe('completion', function()
screen:expect([[
foo |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
feed('<C-x>')
@@ -152,11 +137,7 @@ describe('completion', function()
screen:expect([[
foo |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)} |
]])
feed('<C-n>')
@@ -164,10 +145,7 @@ describe('completion', function()
foo |
foo^ |
{2:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- Keyword Local completion (^N^P) The only match} |
]])
feed('bar<ESC>')
@@ -178,9 +156,7 @@ describe('completion', function()
foobar |
foo^ |
{2:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- INSERT --} |
]])
eq('foo', eval('getline(3)'))
@@ -192,34 +168,24 @@ describe('completion', function()
foo |
^ |
{2:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- Keyword Local completion (^N^P) The only match} |
]])
feed('<C-y>')
screen:expect([[
foo |
foo^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
feed('<ESC>')
eq('foo', eval('getline(2)'))
feed('o<C-r>=TestComplete()<CR>')
screen:expect([[
- foo |
- foo |
+ foo |*2
^ |
{2:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- INSERT --} |
]])
feed('<C-y><ESC>')
@@ -232,21 +198,14 @@ describe('completion', function()
foo |
^ |
{1:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- Keyword Local completion (^N^P) }{5:Back at original} |
]])
feed('b')
screen:expect([[
foo |
b^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- Keyword Local completion (^N^P) }{5:Back at original} |
]])
feed('ar<ESC>')
@@ -257,9 +216,7 @@ describe('completion', function()
bar |
^ |
{1:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- INSERT --} |
]])
feed('bar<ESC>')
@@ -272,21 +229,14 @@ describe('completion', function()
foo |
^ |
{1:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- Keyword Local completion (^N^P) }{5:Back at original} |
]])
feed('<ESC>')
screen:expect([[
foo |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
eq('', eval('getline(2)'))
@@ -296,9 +246,7 @@ describe('completion', function()
|
^ |
{1:foo }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- INSERT --} |
]])
feed('<ESC>')
@@ -306,10 +254,7 @@ describe('completion', function()
foo |
|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
eq('', eval('getline(3)'))
@@ -438,33 +383,20 @@ describe('completion', function()
screen:expect([[
ug^ |
{1:August }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- User defined completion (^U^N^P) }{5:Back at original} |
]])
feed('<Down>')
screen:expect([[
ug^ |
{2:August }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- User defined completion (^U^N^P) The only match} |
]])
feed('<C-y>')
screen:expect([[
August^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{3:-- INSERT --} |
]])
expect('August')
@@ -476,10 +408,7 @@ describe('completion', function()
|
Ja^ |
{1:January }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- User defined completion (^U^N^P) }{5:Back at original} |
]])
feed('<BS>')
@@ -489,8 +418,7 @@ describe('completion', function()
{1:January }{0: }|
{1:June }{0: }|
{1:July }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- User defined completion (^U^N^P) }{5:Back at original} |
]])
feed('<C-n>')
@@ -500,8 +428,7 @@ describe('completion', function()
{2:January }{0: }|
{1:June }{0: }|
{1:July }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- User defined completion (^U^N^P) }{4:match 1 of 3} |
]])
feed('<C-n>')
@@ -511,19 +438,14 @@ describe('completion', function()
{1:January }{0: }|
{2:June }{0: }|
{1:July }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- User defined completion (^U^N^P) }{4:match 2 of 3} |
]])
feed('<Esc>')
screen:expect([[
|
Jun^e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
feed('.')
@@ -531,10 +453,7 @@ describe('completion', function()
|
June |
Jun^e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
expect([[
@@ -705,12 +624,7 @@ describe('completion', function()
feed('<cr>')
screen:expect([[
96^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{3:-- INSERT --} |
]])
end)
@@ -748,10 +662,7 @@ describe('completion', function()
inc uninc indent unindent |
ind^ |
{2:indent }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- Keyword Local completion (^N^P) }{4:match 1 of 2} |
]])
@@ -760,11 +671,7 @@ describe('completion', function()
screen:expect([[
inc uninc indent unindent |
indent^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
-- Indents when completion is exited using ESC.
@@ -773,10 +680,7 @@ describe('completion', function()
inc uninc indent unindent |
indent |
in^d |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
-- Works for unindenting too.
@@ -789,8 +693,7 @@ describe('completion', function()
ind |
unind^ |
{0:~ }{2: unindent }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- Keyword Local completion (^N^P) }{4:match 1 of 2} |
]])
-- Works when going back and forth.
@@ -801,8 +704,7 @@ describe('completion', function()
ind |
uninc^ |
{0:~ }{2: uninc }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- Keyword Local completion (^N^P) }{4:match 1 of 2} |
]])
feed("<BS>d")
@@ -812,8 +714,7 @@ describe('completion', function()
ind |
unind^ |
{0:~ }{2: unindent }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- Keyword Local completion (^N^P) }{4:match 1 of 2} |
]])
feed("<C-N><C-N><C-Y><Esc>")
@@ -822,9 +723,7 @@ describe('completion', function()
indent |
ind |
uninden^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -835,22 +734,14 @@ describe('completion', function()
screen:expect([[
^foo |
bar |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
feed('A<C-x><C-l>')
screen:expect([[
foo^ |
bar |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- Whole line completion (^L^N^P) }{7:Pattern not found} |
]])
eq(-1, eval('foldclosed(1)'))
@@ -865,9 +756,7 @@ describe('completion', function()
fooegg^ |
{1:foobar }{0: }|
{2:fooegg }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- Keyword completion (^N^P) }{4:match 1 of 2} |
]])
@@ -878,9 +767,7 @@ describe('completion', function()
fooegg^ |
{1:foobar }{0: }|
{2:fooegg }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- Keyword completion (^N^P) }{4:match 1 of 2} |
]], unchanged=true}
@@ -891,9 +778,7 @@ describe('completion', function()
foobar^ |
{2:foobar }{0: }|
{1:fooegg }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- Keyword completion (^N^P) }{4:match 2 of 2} |
]])
end)
@@ -904,12 +789,7 @@ describe('completion', function()
feed(':lua CURRENT_TESTING_<TAB>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
:lua CURRENT_TESTING_VAR^ |
]]}
end)
@@ -920,11 +800,7 @@ describe('completion', function()
feed(':lua CURRENT_TESTING_<TAB>')
screen:expect{ grid = [[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{10:CURRENT_TESTING_BAR}{9: CURRENT_TESTING_FOO }|
:lua CURRENT_TESTING_BAR^ |
]], unchanged = true }
@@ -958,9 +834,7 @@ describe('completion', function()
|
{8:[No Name] }|
{0::}foo faa fee f^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{9:[Command Line] }|
{3:-- INSERT --} |
]] )
@@ -980,9 +854,7 @@ describe('completion', function()
|
{8:[No Name] }|
{0::}foo faa fee foo |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{9:[Command Line] }|
:foo faa fee foo^ |
]])
@@ -1015,11 +887,7 @@ describe('completion', function()
screen:expect([[
^ |
{1:1 3 2 }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
end)
@@ -1062,9 +930,7 @@ describe('completion', function()
bar |
foobar |
f^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- Keyword completion (^N^P) }{5:Back at original} |
]], popupmenu = {
anchor = { 1, 3, 0 },
@@ -1081,9 +947,7 @@ describe('completion', function()
bar |
foobar |
foob^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- Keyword completion (^N^P) }{5:Back at original} |
]], popupmenu = {
anchor = { 1, 3, 0 },
@@ -1175,12 +1039,7 @@ describe('completion', function()
{2:hello }{0: }|
{1:hullo }{0: }|
{1:heeee }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{3:-- }{4:match 1 of 3} |
]])
command([[call timer_start(100, { -> execute('stopinsert') })]])
@@ -1191,15 +1050,7 @@ describe('completion', function()
hullo |
heee^e |
hello |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
end)
@@ -1239,9 +1090,7 @@ describe('completion', function()
{1:bar }{0: }|
{1:foa }{0: }|
{1:.hidden }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- }{4:match 1 of 4} |
]]}
feed('<Esc>ccf<C-n>')
@@ -1249,11 +1098,7 @@ describe('completion', function()
foo^ |
{2:foo }{0: }|
{1:foa }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- }{4:match 1 of 2} |
]]}
end)
diff --git a/test/functional/editor/ctrl_c_spec.lua b/test/functional/editor/ctrl_c_spec.lua
index 4548e1aa34..c399a35462 100644
--- a/test/functional/editor/ctrl_c_spec.lua
+++ b/test/functional/editor/ctrl_c_spec.lua
@@ -64,10 +64,7 @@ describe("CTRL-C (mapped)", function()
feed('i')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
-- INSERT -- |
]])
end)
@@ -82,10 +79,7 @@ describe("CTRL-C (mapped)", function()
feed('i')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
-- INSERT -- |
]])
end)
diff --git a/test/functional/editor/mark_spec.lua b/test/functional/editor/mark_spec.lua
index e669d7f2bb..7f7d62a90a 100644
--- a/test/functional/editor/mark_spec.lua
+++ b/test/functional/editor/mark_spec.lua
@@ -419,9 +419,7 @@ describe('named marks view', function()
feed("<C-w>p'a")
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
[No Name] |
6 line |
^7 line |
@@ -454,10 +452,7 @@ describe('named marks view', function()
command('bwipe!')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
command('rshada!')
diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua
index 37651164f5..463a6fa9ca 100644
--- a/test/functional/editor/mode_insert_spec.lua
+++ b/test/functional/editor/mode_insert_spec.lua
@@ -65,19 +65,13 @@ describe('insert-mode', function()
feed('i<C-R>')
screen:expect([[
{1:^"} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- INSERT --} |
]])
feed('={}')
screen:expect([[
{1:"} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
={2:{}}^ |
]])
feed('<CR>')
@@ -92,10 +86,7 @@ describe('insert-mode', function()
feed('<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- INSERT --} |
]])
end)
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua
index a7f629a76b..263b753a16 100644
--- a/test/functional/editor/tabpage_spec.lua
+++ b/test/functional/editor/tabpage_spec.lua
@@ -116,10 +116,7 @@ describe('tabpage', function()
screen:expect([[
{4: [No Name] }{3: [No Name] }{2: }{4:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{1:[No Name] }|
"[No Name]" --No lines in buffer-- |
]])
@@ -127,10 +124,7 @@ describe('tabpage', function()
screen:expect([[
{4: [No Name] }{3: }{5:2}{3: [No Name] }{2: }{4:X}|
^ │ |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*4
{1:[No Name] }|
"[No Name]" --No lines in buffer-- |
]])
diff --git a/test/functional/ex_cmds/append_spec.lua b/test/functional/ex_cmds/append_spec.lua
index 4134eed87e..9f3aa2d315 100644
--- a/test/functional/ex_cmds/append_spec.lua
+++ b/test/functional/ex_cmds/append_spec.lua
@@ -78,11 +78,7 @@ describe('the first line is redrawn correctly after inserting text in an empty b
screen:expect([[
aaaaa |
^bbbbb |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end)
@@ -96,11 +92,7 @@ describe('the first line is redrawn correctly after inserting text in an empty b
screen:expect([[
aaaaa |
^bbbbb |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end)
diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua
index 2a2628350d..306cba85d5 100644
--- a/test/functional/ex_cmds/cmd_map_spec.lua
+++ b/test/functional/ex_cmds/cmd_map_spec.lua
@@ -69,11 +69,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
^some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{6:<F3>} {6:*} {6:<Cmd>}let m = mode(1){6:<CR>} |
]])
end)
@@ -85,11 +81,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
^some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:E1136: <Cmd> mapping must end with <CR> before second <Cmd>} |
]])
@@ -98,11 +90,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
^some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:E1255: <Cmd> mapping must end with <CR>} |
]])
eq(0, eval('x'))
@@ -114,11 +102,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
^of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -127,11 +111,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of ^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end)
@@ -247,11 +227,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
so{5:me short lines} |
{5:of }^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- VISUAL --} |
]])
feed('<esc>')
@@ -269,11 +245,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of alpha^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT --} |
]])
-- feedkeys were not executed immediately
@@ -285,11 +257,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of alphabet^atest text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
-- feedkeys(..., 'x') was executed immediately, but insert mode gets aborted
@@ -310,9 +278,7 @@ describe('mappings with <Cmd>', function()
aa |
xx |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:normal ,x |
]])
@@ -325,9 +291,7 @@ describe('mappings with <Cmd>', function()
aa |
xx |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:normal ,x |
]])
@@ -336,11 +300,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
^ |
0 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
--No lines in buffer-- |
]])
@@ -364,11 +324,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some short }^lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- VISUAL --} |
]])
eq('v', funcs.mode(1))
@@ -383,8 +339,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some }short lines |
of test text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7: }|
{2:Error detected while processing :} |
{2:E605: Exception not caught: very error} |
@@ -396,11 +351,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some }^short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- VISUAL --} |
]])
eq('v', funcs.mode(1))
@@ -408,11 +359,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
so{5:me short lines} |
{5:of }^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- VISUAL --} |
]])
eq('v', funcs.mode(1))
@@ -422,11 +369,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
so{5:me short lines} |
{5:of }^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- (insert) VISUAL --} |
]])
eq('v', eval('mode(1)'))
@@ -442,11 +385,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some short }^lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- SELECT --} |
]])
eq('s', funcs.mode(1))
@@ -466,8 +405,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some }short lines |
of test text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7: }|
{2:Error detected while processing :} |
{2:E605: Exception not caught: very error} |
@@ -479,11 +417,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some }^short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- VISUAL --} |
]])
-- quirk: restoration of select mode is not performed
@@ -494,8 +428,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some }short lines |
of test text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7: }|
{2:Error detected while processing :} |
{2:E605: Exception not caught: very error} |
@@ -507,11 +440,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
{5:some }^short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- SELECT --} |
]])
-- quirk: restoration of select mode is not performed
@@ -521,11 +450,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
so{5:me short lines} |
{5:of }^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- SELECT --} |
]])
eq('s', funcs.mode(1))
@@ -535,11 +460,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
so{5:me short lines} |
{5:of }^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- (insert) SELECT --} |
]])
eq('s', eval('mode(1)'))
@@ -568,8 +489,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of test text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7: }|
{2:Error detected while processing :} |
{2:E605: Exception not caught: very error} |
@@ -600,11 +520,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
indeed some short little ^lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT --} |
]])
@@ -612,8 +528,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
indeed some short little lines |
of test text |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7: }|
{2:Error detected while processing :} |
{2:E605: Exception not caught: very error} |
@@ -627,11 +542,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
indeed some short little ^lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT --} |
]])
eq('i', eval('mode(1)'))
@@ -643,11 +554,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
in{5:deed some short little lines} |
{5:of stuff }^test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT VISUAL --} |
]])
expect([[
@@ -661,11 +568,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
in^deed some short little lines |
of stuff test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT --} |
]])
eq('i', eval('mode(1)'))
@@ -675,11 +578,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
in bar ^deed some short little lines |
of stuff test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT --} |
]])
eq(17, eval('g:y'))
@@ -700,9 +599,7 @@ describe('mappings with <Cmd>', function()
some^ |
{8:some } |
{9:short }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:-- Keyword Local completion (^N^P) }{3:match 1 of 2} |
]])
@@ -717,9 +614,7 @@ describe('mappings with <Cmd>', function()
some^ |
{9:some } |
{9:short }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:-- Keyword Local completion (^N^P) }{10:Back at original} |
]])
end)
@@ -734,11 +629,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
^some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:E492: Not an editor command: text} |
]])
@@ -773,11 +664,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
^some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
eq('n', eval('mode(1)'))
@@ -786,11 +673,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:let g:x = 3^ |
]])
feed('+2<cr>')
@@ -798,11 +681,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short ^lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:let g:x = 3+2 |
]])
eq(5, eval('g:x'))
@@ -811,11 +690,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:let g:y = 7^ |
]])
eq('c', eval('mode(1)'))
@@ -824,11 +699,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short ^lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:-- INSERT --} |
]])
eq('i', eval('mode(1)'))
@@ -842,11 +713,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:bar^ |
]])
@@ -854,11 +721,7 @@ describe('mappings with <Cmd>', function()
screen:expect([[
some short lines |
of test text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:barx^ |
]])
end)
diff --git a/test/functional/ex_cmds/debug_spec.lua b/test/functional/ex_cmds/debug_spec.lua
index a4d381d3f1..5c20cb7324 100644
--- a/test/functional/ex_cmds/debug_spec.lua
+++ b/test/functional/ex_cmds/debug_spec.lua
@@ -20,14 +20,7 @@ describe(':debug', function()
feed(':echoerr bork<cr>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
{2: }|
{3:E121: Undefined variable: bork}|
|
@@ -38,11 +31,7 @@ describe(':debug', function()
feed(':debug echo "aa"| echo "bb"<cr>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2: }|
{3:E121: Undefined variable: bork}|
|
@@ -56,8 +45,7 @@ describe(':debug', function()
feed('step<cr>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2: }|
{3:E121: Undefined variable: bork}|
|
@@ -92,18 +80,7 @@ describe(':debug', function()
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*12
|
]])
end)
diff --git a/test/functional/ex_cmds/drop_spec.lua b/test/functional/ex_cmds/drop_spec.lua
index 2537ab9cdc..41f0ada567 100644
--- a/test/functional/ex_cmds/drop_spec.lua
+++ b/test/functional/ex_cmds/drop_spec.lua
@@ -23,13 +23,7 @@ describe(":drop", function()
feed_command("drop tmp1.vim")
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
{1:tmp1.vim }|
"tmp1.vim" [New] |
]])
@@ -42,13 +36,7 @@ describe(":drop", function()
feed_command("drop tmp1")
screen:expect([[
│^ |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*7
{2:tmp2 }{1:tmp1 }|
:drop tmp1 |
]])
@@ -63,13 +51,10 @@ describe(":drop", function()
feed_command("drop tmp3")
screen:expect([[
^ │ |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*3
{1:tmp3 }│{0:~ }|
ABC │{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*2
{2:tmp2 [+] tmp1 }|
"tmp3" [New] |
]])
diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua
index a580e88b93..c8855337ef 100644
--- a/test/functional/ex_cmds/map_spec.lua
+++ b/test/functional/ex_cmds/map_spec.lua
@@ -105,25 +105,19 @@ describe('Screen', function()
command('map <expr> x input("> ")')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
feed('x')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
> ^ |
]])
feed('\n')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
> |
]])
end)
@@ -133,25 +127,19 @@ describe('Screen', function()
feed('i')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed('x')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
> ^ |
]])
feed('\n')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
end)
@@ -161,9 +149,7 @@ describe('Screen', function()
feed(':<F2>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:^ |
]])
end)
@@ -201,8 +187,7 @@ describe('Screen', function()
command('nmap <expr> <F2> execute("throw 42")')
feed('<F2>')
screen:expect([[
- |
- |
+ |*2
Error detected while processing : |
E605: Exception not caught: 42 |
Press ENTER or type command to continue^ |
@@ -210,9 +195,7 @@ describe('Screen', function()
feed('<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
end)
@@ -223,9 +206,7 @@ describe('Screen', function()
feed(':echo "foo')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:echo "foo^ |
]])
feed('<F2>')
@@ -261,9 +242,7 @@ describe('Screen', function()
feed(': nmap a<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
n a b |
]])
end)
diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua
index 7522d4a99c..7d9379b703 100644
--- a/test/functional/ex_cmds/mksession_spec.lua
+++ b/test/functional/ex_cmds/mksession_spec.lua
@@ -209,9 +209,7 @@ describe(':mksession', function()
^/ |
|
[Process exited 0] |
- |
- |
- |
+ |*3
]]
command('cd /')
diff --git a/test/functional/ex_cmds/quickfix_commands_spec.lua b/test/functional/ex_cmds/quickfix_commands_spec.lua
index 4d9d8eeb90..d866a862cf 100644
--- a/test/functional/ex_cmds/quickfix_commands_spec.lua
+++ b/test/functional/ex_cmds/quickfix_commands_spec.lua
@@ -137,10 +137,7 @@ it(':vimgrep can specify Unicode pattern without delimiters', function()
feed('i→<Esc>:vimgrep →')
screen:expect([[
{1:→} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
:vimgrep →^ |
]])
end)
diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
index 436873b464..5bcf44f1c1 100644
--- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
+++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
@@ -115,7 +115,9 @@ describe("preserve and (R)ecover with custom 'directory'", function()
local screen0 = Screen.new()
screen0:attach()
local child_server = new_pipename()
- funcs.termopen({nvim_prog, '-u', 'NONE', '-i', 'NONE', '--listen', child_server})
+ funcs.termopen({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--listen', child_server }, {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
screen0:expect({any = pesc('[No Name]')}) -- Wait for the child process to start.
local child_session = helpers.connect(child_server)
set_session(child_session)
@@ -264,22 +266,7 @@ describe('swapfile detection', function()
feed(':<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*16
: |
]])
nvim1:close()
@@ -301,22 +288,7 @@ describe('swapfile detection', function()
command([[echo 'hello']])
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*16
hello |
]])
nvim2:close()
@@ -452,7 +424,9 @@ describe('quitting swapfile dialog on startup stops TUI properly', function()
it('(Q)uit at first file argument', function()
local chan = funcs.termopen({nvim_prog, '-u', 'NONE', '-i', 'NONE',
'--cmd', init_dir, '--cmd', init_set,
- testfile})
+ testfile}, {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
retry(nil, nil, function()
eq('[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:',
eval("getline('$')->trim(' ', 2)"))
@@ -467,7 +441,9 @@ describe('quitting swapfile dialog on startup stops TUI properly', function()
it('(A)bort at second file argument with -p', function()
local chan = funcs.termopen({nvim_prog, '-u', 'NONE', '-i', 'NONE',
'--cmd', init_dir, '--cmd', init_set,
- '-p', otherfile, testfile})
+ '-p', otherfile, testfile}, {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
retry(nil, nil, function()
eq('[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:',
eval("getline('$')->trim(' ', 2)"))
@@ -487,7 +463,9 @@ describe('quitting swapfile dialog on startup stops TUI properly', function()
third %s /^ \zsthird$/]]):format(testfile, testfile, testfile))
local chan = funcs.termopen({nvim_prog, '-u', 'NONE', '-i', 'NONE',
'--cmd', init_dir, '--cmd', init_set,
- '--cmd', 'set tags='..otherfile, '-tsecond'})
+ '--cmd', 'set tags='..otherfile, '-tsecond'}, {
+ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ })
retry(nil, nil, function()
eq('[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:',
eval("getline('$')->trim(' ', 2)"))
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 2bff1d16f8..449c3ab9d8 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -28,7 +28,7 @@ module.nvim_prog = (
)
-- Default settings for the test session.
module.nvim_set = (
- 'set shortmess+=IS background=light noswapfile noautoindent startofline'
+ 'set shortmess+=IS background=light termguicolors noswapfile noautoindent startofline'
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
..' belloff= wildoptions-=pum joinspaces noshowcmd noruler nomore redrawdebug=invalid')
module.nvim_argv = {
@@ -36,8 +36,8 @@ module.nvim_argv = {
-- XXX: find treesitter parsers.
'--cmd', runtime_set,
'--cmd', module.nvim_set,
- '--cmd', 'mapclear',
- '--cmd', 'mapclear!',
+ -- Remove default mappings.
+ '--cmd', 'mapclear | mapclear!',
-- Make screentest work after changing to the new default color scheme
-- Source 'vim' color scheme without side effects
-- TODO: rewrite tests
@@ -438,7 +438,7 @@ function module.connect(file_or_address)
return Session.new(stream)
end
--- Starts a new global Nvim session.
+-- Starts (and returns) a new global Nvim session.
--
-- Parameters are interpreted as startup args, OR a map with these keys:
-- args: List: Args appended to the default `nvim_argv` set.
@@ -452,6 +452,7 @@ end
-- clear{args={'-e'}, args_rm={'-i'}, env={TERM=term}}
function module.clear(...)
module.set_session(module.spawn_argv(false, ...))
+ return module.get_session()
end
-- same params as clear, but does returns the session instead
@@ -943,7 +944,7 @@ function module.add_builddir_to_rtp()
module.command(string.format([[set rtp+=%s/runtime]], module.test_build_dir))
end
--- Kill process with given pid
+-- Kill (reap) a process by PID.
function module.os_kill(pid)
return os.execute((is_os('win')
and 'taskkill /f /t /pid '..pid..' > nul'
diff --git a/test/functional/legacy/063_match_and_matchadd_spec.lua b/test/functional/legacy/063_match_and_matchadd_spec.lua
index 235a826640..f17a32406f 100644
--- a/test/functional/legacy/063_match_and_matchadd_spec.lua
+++ b/test/functional/legacy/063_match_and_matchadd_spec.lua
@@ -26,9 +26,7 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
command("call matchaddpos('MyGroup1', [[1, 5], [1, 8, 3]], 10, 3)")
screen:expect([[
abcd{1:e}fg{1:hij}klmnop^q |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
@@ -37,9 +35,7 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
command("call matchaddpos('MyGroup1', [[1, 4, 2], [1, 9, 2]])")
screen:expect([[
abc{1:dΣ}ab{1:cd}e^f |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
diff --git a/test/functional/legacy/107_adjust_window_and_contents_spec.lua b/test/functional/legacy/107_adjust_window_and_contents_spec.lua
index 841eeef0af..5a8fdda32d 100644
--- a/test/functional/legacy/107_adjust_window_and_contents_spec.lua
+++ b/test/functional/legacy/107_adjust_window_and_contents_spec.lua
@@ -50,15 +50,7 @@ describe('107', function()
[1, '1 '] |
[50, '50 '] |
^[59, '59 '] |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*9
3 more lines |
]])
end)
diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua
index a15809907b..3e78d7ca5f 100644
--- a/test/functional/legacy/arglist_spec.lua
+++ b/test/functional/legacy/arglist_spec.lua
@@ -33,10 +33,7 @@ describe('argument list commands', function()
feed('N')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
feed(':confirm quit\n')
diff --git a/test/functional/legacy/breakindent_spec.lua b/test/functional/legacy/breakindent_spec.lua
index 3913ba935a..5e3ce27f91 100644
--- a/test/functional/legacy/breakindent_spec.lua
+++ b/test/functional/legacy/breakindent_spec.lua
@@ -30,9 +30,7 @@ describe('breakindent', function()
screen:expect([[
{1: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX|
{1: }^second line |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:-- INSERT --} |
]])
-- No line wraps, so changing 'showbreak' should lead to the same screen.
@@ -47,8 +45,7 @@ describe('breakindent', function()
{1: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX|
{1: } {0:+^$} |
{1: }second line{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- INSERT --} |
]]}
command('setlocal nobreakindent')
@@ -56,8 +53,7 @@ describe('breakindent', function()
{1: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX|
{1: }{0:+^$} |
{1: }second line{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- INSERT --} |
]]}
end)
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index 3cbff2a01b..54ca4205c3 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -40,13 +40,7 @@ describe('cmdline', function()
screen:expect{grid=[[
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*7
:tabnew |
]]}
@@ -54,14 +48,8 @@ describe('cmdline', function()
screen:expect{grid=[[
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- |
- |
- |
+ {4:~ }|*5
+ |*3
]]}
feed [[gt]]
@@ -82,14 +70,8 @@ describe('cmdline', function()
screen:expect([[
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- |
- |
- |
+ {4:~ }|*5
+ |*3
]])
end)
@@ -105,8 +87,7 @@ describe('cmdline', function()
feed_command('DoSomething')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
|
Executing: DoSomething |
Executing: echo 'hello' |set ts=4 |let v = '123' |echo v |
@@ -135,9 +116,7 @@ describe('cmdline', function()
screen:expect([[
{1:foo }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
:^ |
]])
end)
@@ -156,9 +135,7 @@ describe('cmdline', function()
feed(':for i in range(3)<CR>')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
:for i in range(3) |
: ^ |
]])
@@ -166,9 +143,7 @@ describe('cmdline', function()
-- Note: this may still be considered broken, ref #18140
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
: :let i =^ |
|
]])
@@ -194,22 +169,14 @@ describe('cmdline', function()
feed(':call EchoTwo()')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:[No Name] }|
:call EchoTwo()^ |
]])
feed('<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:[No Name] }|
|
]])
@@ -231,10 +198,7 @@ describe('cmdline', function()
screen:expect([[
{2: [No Name] }{3: }|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{1:[No Name] }|
|
]])
@@ -281,58 +245,27 @@ describe('cmdwin', function()
feed('q')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{2:[No Name] }|
{0::}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{1:[Command Line] }|
|
]])
feed([[aecho 'done']])
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{2:[No Name] }|
{0::}echo 'done'^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{1:[Command Line] }|
{4:-- INSERT --} |
]])
feed('<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*14
done |
]])
end)
diff --git a/test/functional/legacy/conceal_spec.lua b/test/functional/legacy/conceal_spec.lua
index 6aaa93f886..bcd7e0063b 100644
--- a/test/functional/legacy/conceal_spec.lua
+++ b/test/functional/legacy/conceal_spec.lua
@@ -416,10 +416,7 @@ describe('Conceal', function()
two two two two |hidden| ^here two two |
three three three three {1:t}hree |
{0: >>> }thre{2:e} three three three |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
/here |
]])
@@ -431,10 +428,7 @@ describe('Conceal', function()
two two two two |hidden| here two tw^o |
three three three three three |
{0: >>> }thre{2:e} three three three |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
/here |
]])
end)
@@ -455,21 +449,14 @@ describe('Conceal', function()
]])
screen:expect([[
one two three four five, the ^backticks should be concealed |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
screen:try_resize(75, 7)
screen:expect([[
one two three four five, the ^backticks should be concealed |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end)
@@ -501,8 +488,7 @@ describe('Conceal', function()
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{0:+ }bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
{0:+ }cccccc |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
diff --git a/test/functional/legacy/cpoptions_spec.lua b/test/functional/legacy/cpoptions_spec.lua
index d2f382ec12..288146199a 100644
--- a/test/functional/legacy/cpoptions_spec.lua
+++ b/test/functional/legacy/cpoptions_spec.lua
@@ -15,19 +15,13 @@ describe('cpoptions', function()
feed('c2w')
screen:expect([[
^one tw$ three |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
-- INSERT -- |
]])
feed('vim<Esc>')
screen:expect([[
vi^m three |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
end)
diff --git a/test/functional/legacy/debugger_spec.lua b/test/functional/legacy/debugger_spec.lua
index e6fb81719f..65f6bd7221 100644
--- a/test/functional/legacy/debugger_spec.lua
+++ b/test/functional/legacy/debugger_spec.lua
@@ -32,14 +32,7 @@ describe('debugger', function()
feed(':source %<CR>')
screen:expect{grid=[[
^let g:Xtest_var += 1{MATCH: *}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
+ {0:~{MATCH: *}}|*8
:source %{MATCH: *}|
]]}
feed(':source %<CR>')
@@ -58,14 +51,7 @@ describe('debugger', function()
feed('cont<CR>')
screen:expect{grid=[[
^let g:Xtest_var += 1{MATCH: *}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
- {0:~{MATCH: *}}|
+ {0:~{MATCH: *}}|*8
{MATCH: *}|
]]}
feed(':source %<CR>')
diff --git a/test/functional/legacy/digraph_spec.lua b/test/functional/legacy/digraph_spec.lua
index 7eeb83eb5f..a0399847bd 100644
--- a/test/functional/legacy/digraph_spec.lua
+++ b/test/functional/legacy/digraph_spec.lua
@@ -18,28 +18,19 @@ describe('digraph', function()
feed('i<C-K>')
screen:expect([[
{1:^?} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:-- INSERT --}|
]])
feed('1')
screen:expect([[
{1:^1} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:-- INSERT --}|
]])
feed('2')
screen:expect([[
½^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:-- INSERT --}|
]])
end)
diff --git a/test/functional/legacy/display_spec.lua b/test/functional/legacy/display_spec.lua
index 9c6f521882..ab6b1906c5 100644
--- a/test/functional/legacy/display_spec.lua
+++ b/test/functional/legacy/display_spec.lua
@@ -48,12 +48,7 @@ describe('display', function()
feed('VG7kk')
screen:expect([[
{3: }^f{2:oo} |
- {3: }foo |
- {3: }foo |
- {3: }foo |
- {3: }foo |
- {3: }foo |
- {3: }foo |
+ {3: }foo |*6
{1:-- VISUAL LINE --} |
]])
end)
@@ -80,12 +75,9 @@ describe('display', function()
end
screen:expect((([[
^a│aaa |
- a│bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- a│bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ a│bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*2
b│bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
- b│{1:~ }|
- b│{1:~ }|
- b│{1:~ }|
+ b│{1:~ }|*3
{1:@}│{1:~ }|
{2:< }{3:[No Name] [+] }|
|
@@ -97,12 +89,9 @@ describe('display', function()
command('100wincmd >')
screen:expect((([[
^aaa │a|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb│a|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb│a|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb│a|*2
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb │b|
- {1:~ }│b|
- {1:~ }│b|
- {1:~ }│b|
+ {1:~ }│b|*3
{1:~ }│{1:@}|
{2:[No Name] [+] }{3:<}|
|
@@ -119,8 +108,7 @@ describe('display', function()
{1:@@@ }|
{2:[No Name] [+] }|
aaa |
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*2
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
{3:[No Name] [+] }|
|
@@ -133,9 +121,7 @@ describe('display', function()
a │bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
bb│bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
bb│bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
- bb│{1:~ }|
- bb│{1:~ }|
- bb│{1:~ }|
+ bb│{1:~ }|*3
{1:@@}│{1:~ }|
{2:< }{3:[No Name] [+] }|
|
@@ -164,17 +150,7 @@ describe('display', function()
feed('736|')
screen:expect([[
<<<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*11
^aaaaaaaaaaaaaaa |
|
]])
@@ -182,16 +158,7 @@ describe('display', function()
feed('D')
screen:expect([[
<<<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*10
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^a|
bbbbb bbbbb bbbbb bbbbb bbbbb bb@@@|
|
@@ -205,29 +172,14 @@ describe('display', function()
bbbbb ccccc ccccc ccccc ccccc cccc|
c ccccc ccccc ddddd ddddd ddddd ddd|
dd ddddd ddddd ddddd |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*8
|
]])
-- "w_skipcol" is reset to bring the entire topline into view because
-- the line length is now smaller than the current skipcol + marker.
feed('x')
screen:expect([[
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*9
aa^a |
bbbbb bbbbb bbbbb bbbbb bbbbb bbbbb|
bbbbb ccccc ccccc ccccc ccccc cccc|
@@ -246,11 +198,7 @@ describe('display', function()
]])
screen:expect([[
<<<bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*5
b^b |
|
]])
@@ -260,12 +208,7 @@ describe('display', function()
feed('$0')
screen:expect([[
<<<b^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6
|
]])
-- Going to the start of the line with "b" did not set w_skipcol correctly with 'smoothscroll'.
@@ -273,24 +216,14 @@ describe('display', function()
feed('$b')
screen:expect([[
2 b ^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6
|
]])
-- Same for "ge".
feed('$ge')
screen:expect([[
2 ^b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6
|
]])
end)
diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua
index 939999e21b..0cf2ec006d 100644
--- a/test/functional/legacy/edit_spec.lua
+++ b/test/functional/legacy/edit_spec.lua
@@ -39,19 +39,13 @@ describe('edit', function()
feed('a<C-R>')
screen:expect([[
{1:^"} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:-- INSERT --}|
]])
feed('=')
screen:expect([[
{1:"} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
=^ |
]])
end)
@@ -73,19 +67,13 @@ describe('edit', function()
feed('i<C-R>')
screen:expect([[
{1:^"} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- INSERT --} |
]])
feed('={}')
screen:expect([[
{1:"} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
={2:{}}^ |
]])
-- trying to insert a dictionary produces an error
@@ -102,20 +90,14 @@ describe('edit', function()
feed(':')
screen:expect([[
:^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:-- INSERT --} |
]])
-- ending Insert mode should put the cursor back on the ':'
feed('<Esc>')
screen:expect([[
^: |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua
index f21c47e175..8f8d958530 100644
--- a/test/functional/legacy/ex_mode_spec.lua
+++ b/test/functional/legacy/ex_mode_spec.lua
@@ -118,8 +118,7 @@ describe('Ex mode', function()
{1: 1 }foo bar |
{1: 2 }foo foo |
{1: 3 }^foo foo |
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
|
]])
end)
@@ -166,10 +165,7 @@ describe('Ex mode', function()
feed('vi<CR>')
screen:expect([[
^foo |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
diff --git a/test/functional/legacy/excmd_spec.lua b/test/functional/legacy/excmd_spec.lua
index eb480a6689..41a478e793 100644
--- a/test/functional/legacy/excmd_spec.lua
+++ b/test/functional/legacy/excmd_spec.lua
@@ -74,21 +74,13 @@ describe(':confirm command dialog', function()
feed(':confirm qall\n')
screen:expect([[
bar2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{2:Xbar [+] }|
foo2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:Xfoo [+] }|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
:confirm qall |
{3:Save changes to "Xbar"?} |
@@ -112,21 +104,13 @@ describe(':confirm command dialog', function()
feed(':confirm qall\n')
screen:expect([[
bar3 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{2:Xbar [+] }|
foo3 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:Xfoo [+] }|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
:confirm qall |
{3:Save changes to "Xbar"?} |
@@ -150,21 +134,13 @@ describe(':confirm command dialog', function()
feed(':confirm qall\n')
screen:expect([[
bar4 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{2:Xbar [+] }|
foo4 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:Xfoo [+] }|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
:confirm qall |
{3:Save changes to "Xbar"?} |
@@ -173,17 +149,10 @@ describe(':confirm command dialog', function()
feed('N')
screen:expect([[
bar4 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{2:Xbar [+] }|
foo4 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:Xfoo [+] }|
|
{1: }|
@@ -215,9 +184,7 @@ describe(':confirm command dialog', function()
feed(':confirm close\n')
screen:expect([[
abc |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:[No Name] [+] }|
|
{1: }|
@@ -228,22 +195,17 @@ describe(':confirm command dialog', function()
feed('C')
screen:expect([[
^abc |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:[No Name] [+] }|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:[No Name] }|
|
]])
feed(':confirm close\n')
screen:expect([[
abc |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:[No Name] [+] }|
|
{1: }|
@@ -254,14 +216,7 @@ describe(':confirm command dialog', function()
feed('N')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
|
]])
end)
@@ -280,9 +235,7 @@ describe(':confirm command dialog', function()
feed(':confirm q\n')
screen:expect([[
foo |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1: }|
:confirm q |
{3:Save changes to "Untitled"?} |
@@ -291,12 +244,7 @@ describe(':confirm command dialog', function()
feed('C')
screen:expect([[
^abc |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]])
@@ -304,9 +252,7 @@ describe(':confirm command dialog', function()
feed(':confirm wq\n')
screen:expect([[
foo |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1: }|
"Xfoo" [noeol] 1L, 3B written |
{3:Save changes to "Untitled"?} |
@@ -315,12 +261,7 @@ describe(':confirm command dialog', function()
feed('C')
screen:expect([[
^abc |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
"Xfoo" [noeol] 1L, 3B written |
]])
@@ -343,8 +284,7 @@ describe(':confirm command dialog', function()
feed(':set ro | confirm w\n')
screen:expect([[
foobar |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
:set ro | confirm w |
{3:'readonly' option is set for "Xconfirm_write_ro".} |
@@ -354,11 +294,7 @@ describe(':confirm command dialog', function()
feed('N')
screen:expect([[
fooba^r |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
1,6 All |
]])
@@ -367,8 +303,7 @@ describe(':confirm command dialog', function()
feed(':confirm w\n')
screen:expect([[
foobar |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
:confirm w |
{3:'readonly' option is set for "Xconfirm_write_ro".} |
@@ -473,8 +408,7 @@ describe(':confirm command dialog', function()
b |
c |
d |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
1,1 All |
]])
diff --git a/test/functional/legacy/fold_spec.lua b/test/functional/legacy/fold_spec.lua
index 83513a3f94..96fad8520c 100644
--- a/test/functional/legacy/fold_spec.lua
+++ b/test/functional/legacy/fold_spec.lua
@@ -72,12 +72,10 @@ describe('folding', function()
dd {{{ |
ee {{{ }}} |
{{{ |
- ff }}} |
- ff }}} |
+ ff }}} |*2
^ |
line 2 foldlevel=2 |
- 1 |
- 1 |
+ 1 |*2
|
]])
@@ -227,22 +225,14 @@ describe('folding', function()
screen:expect([[
{3:+ }{4: 0 }{2:^+-- 2 lines: ·························}|
{3:+ }{4: 1 }{2:+-- 2 lines: ·························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
feed("j")
screen:expect([[
{3:+ }{4: 1 }{2:+-- 2 lines: ·························}|
{3:+ }{4: 0 }{2:^+-- 2 lines: ·························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end)
@@ -259,10 +249,7 @@ describe('folding', function()
^one |
{2:+-- 2 lines: two····························}|
four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
feed('2G')
@@ -271,9 +258,7 @@ describe('folding', function()
^two |
three |
four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
feed('4G')
@@ -281,10 +266,7 @@ describe('folding', function()
one |
{2:+-- 2 lines: two····························}|
^four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
feed('3G')
@@ -293,9 +275,7 @@ describe('folding', function()
two |
^three |
four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
feed('1G')
@@ -303,10 +283,7 @@ describe('folding', function()
^one |
{2:+-- 2 lines: two····························}|
four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
feed('2G')
@@ -315,9 +292,7 @@ describe('folding', function()
^two |
three |
four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
feed('k')
@@ -325,10 +300,7 @@ describe('folding', function()
^one |
{2:+-- 2 lines: two····························}|
four |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
diff --git a/test/functional/legacy/global_spec.lua b/test/functional/legacy/global_spec.lua
index ff02c41e6c..0619d5fb30 100644
--- a/test/functional/legacy/global_spec.lua
+++ b/test/functional/legacy/global_spec.lua
@@ -28,10 +28,7 @@ describe(':global', function()
feed('<C-C>')
screen:expect([[
^foo |
- foo |
- foo |
- foo |
- foo |
+ foo |*4
{1:Interrupted} |
]])
diff --git a/test/functional/legacy/highlight_spec.lua b/test/functional/legacy/highlight_spec.lua
index 0a130f1607..1e5017fcc1 100644
--- a/test/functional/legacy/highlight_spec.lua
+++ b/test/functional/legacy/highlight_spec.lua
@@ -112,10 +112,7 @@ describe('Visual selection highlight', function()
feed('v$')
screen:expect([[
{0:>}{1:n, no sea takimata sanctus est Lorem ipsum dolor sit amet.}^ |
- |
- |
- |
- |
+ |*4
{2:-- VISUAL --} |
]])
end)
diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua
index a9aa238d4e..c35d765eae 100644
--- a/test/functional/legacy/listchars_spec.lua
+++ b/test/functional/legacy/listchars_spec.lua
@@ -121,10 +121,7 @@ describe("'listchars'", function()
{4: } │{4: } │{4: } |
{4: }a │{4: }a │{4: }a |
{4: }aaaaaa │{4: }a{1:>}│{4: }aaaaaa |
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
+ {1:~ }│{1:~ }│{1:~ }|*4
{3:[No Name] [+] <[+] }{2:[No Name] [+] }|
|
]])
@@ -134,10 +131,7 @@ describe("'listchars'", function()
{4: } │{4: } │{4: } |
{4: }a │{4: }a│{4: }a |
{4: }aaaaaa │{4: }{1:>}│{4: }aaaaaa |
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
+ {1:~ }│{1:~ }│{1:~ }|*4
{3:[No Name] [+] <+] }{2:[No Name] [+] }|
|
]])
@@ -147,10 +141,7 @@ describe("'listchars'", function()
{4: } │{4: }│{4: } |
{4: }a │{4: }│{4: }a |
{4: }aaaaaa │{4: }│{4: }aaaaaa |
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
+ {1:~ }│{1:~ }│{1:~ }|*4
{3:[No Name] [+] <] }{2:[No Name] [+] }|
|
]])
@@ -160,10 +151,7 @@ describe("'listchars'", function()
{4: } │{4: }│{4: } |
{4: }a │{4: }│{4: }a |
{4: }aaaaaa │{4: }│{4: }aaaaaa |
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
+ {1:~ }│{1:~ }│{1:~ }|*4
{3:[No Name] [+] < }{2:[No Name] [+] }|
|
]])
@@ -173,10 +161,7 @@ describe("'listchars'", function()
{4: } │{4: }│{4: } |
{4: }a │{4: }│{4: }a |
{4: }aaaaaa │{4: }│{4: }aaaaaa |
- {1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~}│{1:~ }|*4
{3:[No Name] [+] < }{2:[No Name] [+] }|
|
]])
@@ -187,10 +172,7 @@ describe("'listchars'", function()
{4: } │{4: } │{4: } |
{4: }a │{4: }a │{4: }a |
{4: }aaaaaa │{4: }aaaaaa │{4: }aaaaaa |
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
+ {1:~ }│{1:~ }│{1:~ }|*4
{3:[No Name] [+] }{2:[No Name] [+] }{3:[No Name] [+] }|
:set nowrap foldcolumn=4 |
]])
@@ -200,10 +182,7 @@ describe("'listchars'", function()
{4: } │{4: }│{4: } |
{4: }a │{4: }│{4: }a |
{4: }aaaaaa │{4: ^ }│{4: }aaaaaa |
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
- {1:~ }│{1:~ }│{1:~ }|
+ {1:~ }│{1:~ }│{1:~ }|*4
{3:[No Name] [+] }{2:<[+] }{3:[No Name] [+] }|
:set nowrap foldcolumn=4 |
]])
@@ -213,10 +192,7 @@ describe("'listchars'", function()
{4: } │{4: }│{4: } |
{4: }a │{4: }│{4: }a |
{4: }aaaaaa │{4:^ }│{4: }aaaaaa |
- {1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~}│{1:~ }|*4
{3:[No Name] [+] }{2:< }{3:[No Name] [+] }|
:set nowrap foldcolumn=4 |
]])
diff --git a/test/functional/legacy/listlbr_spec.lua b/test/functional/legacy/listlbr_spec.lua
index d4f11a61c2..d8821417b9 100644
--- a/test/functional/legacy/listlbr_spec.lua
+++ b/test/functional/legacy/listlbr_spec.lua
@@ -217,18 +217,14 @@ describe('listlbr', function()
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb {1:c}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
2 |
]])
feed('zo')
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb ^c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} |
]])
@@ -236,18 +232,14 @@ describe('listlbr', function()
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb {1:c}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} 2 |
]])
feed('gq')
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb ^c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} |
]])
@@ -255,18 +247,14 @@ describe('listlbr', function()
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb {1:c}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} 1x2 |
]])
feed('I')
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb ^c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} |
]])
@@ -274,18 +262,14 @@ describe('listlbr', function()
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb {1:c}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} 2 |
]])
feed('s')
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
bbbbbbbbbb ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:E490: No fold found} |
]])
end)
diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua
index b6e45c396c..312490e643 100644
--- a/test/functional/legacy/match_spec.lua
+++ b/test/functional/legacy/match_spec.lua
@@ -55,13 +55,7 @@ describe('match highlighting', function()
screen:expect([[
^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{1:]} |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
|
]])
end)
@@ -112,14 +106,7 @@ describe('match highlighting', function()
]])
screen:expect([[
{1: ^ }ix |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
|
]])
end)
diff --git a/test/functional/legacy/matchparen_spec.lua b/test/functional/legacy/matchparen_spec.lua
index 22d9247698..f5f7fa55f8 100644
--- a/test/functional/legacy/matchparen_spec.lua
+++ b/test/functional/legacy/matchparen_spec.lua
@@ -47,16 +47,12 @@ describe('matchparen', function()
local screen1 = [[
{1:^()} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]
local screen2 = [[
^aa |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]
diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua
index 146b00acb0..d7781d4b44 100644
--- a/test/functional/legacy/messages_spec.lua
+++ b/test/functional/legacy/messages_spec.lua
@@ -34,18 +34,12 @@ describe('messages', function()
feed('u')
screen:expect({grid = [[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:W10: Warning: Changing a readonly file}^ |
]], timeout = 500})
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
Already at oldest change |
]])
end)
@@ -74,12 +68,7 @@ describe('messages', function()
^one |
NoSuchFile |
three |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
from DebugSilent normal |
]])
@@ -89,12 +78,7 @@ describe('messages', function()
^one |
NoSuchFile |
three |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
from DebugSilent visual |
]])
@@ -105,11 +89,7 @@ describe('messages', function()
one |
NoSuchFil^e |
three |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
from DebugSilent visual |
{1:E447: Can't find file "NoSuchFile" in path} |
]])
@@ -478,15 +458,8 @@ describe('messages', function()
command('mode') -- FIXME: bottom is invalid after scrolling
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- |
+ {0:~ }|*7
+ |*2
]])
feed([[:4 verbose echo system('foo')<CR>]])
screen:expect([[
@@ -555,14 +528,7 @@ describe('messages', function()
feed('q')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
|
]])
end)
@@ -591,18 +557,14 @@ describe('messages', function()
feed('i')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3: }|
{2:-- INSERT --} |
]])
feed('<C-C>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3: }|
|
]])
@@ -617,18 +579,14 @@ describe('messages', function()
feed('i')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3:[No Name] }|
{2:-- INSERT --} |
]])
feed('<Esc>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3:[No Name] }|
|
]])
@@ -639,19 +597,13 @@ describe('messages', function()
feed('i<C-O>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:-- (insert) --} |
]])
feed('<C-C>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
@@ -673,18 +625,14 @@ describe('messages', function()
screen:expect([[
1 |
2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:Backwards range given, OK to swap (y/n)?}^ |
]])
feed('n')
screen:expect([[
^1 |
2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:Backwards range given, OK to swap (y/n)?}n |
]])
@@ -692,18 +640,14 @@ describe('messages', function()
screen:expect([[
1 |
2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:Backwards range given, OK to swap (y/n)?}^ |
]])
feed('<Esc>')
screen:expect([[
^1 |
2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:Backwards range given, OK to swap (y/n)?}n |
]])
@@ -711,18 +655,14 @@ describe('messages', function()
screen:expect([[
1 |
2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:Backwards range given, OK to swap (y/n)?}^ |
]])
feed('y')
screen:expect([[
y1 |
^y2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:Backwards range given, OK to swap (y/n)?}y |
]])
end)
@@ -749,19 +689,15 @@ describe('messages', function()
screen:expect([[
{2: [No Name] }{1: [No Name] }{3: }{2:X}|
^ |
- {0:~ }|
- {0:~ }|
- |
- |
+ {0:~ }|*2
+ |*2
]])
feed(':tabprev | edit Xfileinfo.txt<CR>')
screen:expect([[
{1: Xfileinfo.txt }{2: [No Name] }{3: }{2:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
"Xfileinfo.txt" [New] |
]])
assert_alive()
@@ -793,10 +729,7 @@ describe('messages', function()
feed('0$')
screen:expect([[
^hi |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
'b' written |
]])
os.remove('b.txt')
diff --git a/test/functional/legacy/move_spec.lua b/test/functional/legacy/move_spec.lua
index 855996da8f..868f4a4644 100644
--- a/test/functional/legacy/move_spec.lua
+++ b/test/functional/legacy/move_spec.lua
@@ -22,11 +22,7 @@ describe(':move', function()
^First |
Third |
Fourth |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
:move +1 |
]])
@@ -38,11 +34,7 @@ describe(':move', function()
Second |
Third |
Fourth |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end)
diff --git a/test/functional/legacy/normal_spec.lua b/test/functional/legacy/normal_spec.lua
index ba875460f5..df96d64708 100644
--- a/test/functional/legacy/normal_spec.lua
+++ b/test/functional/legacy/normal_spec.lua
@@ -18,22 +18,13 @@ describe('normal', function()
]])
screen:expect([[
{1: 2 }222222222222222222222222222222222222|
- {1: }222222222222222222222222222222222222|
- {1: }222222222222222222222222222222222222|
- {1: }222222222222222222222222222222222222|
- {1: }222222222222222222222222222222222222|
+ {1: }222222222222222222222222222222222222|*4
{1: }22222222222222222222 |
{1: 3 }333333333333333333333333333333333333|
- {1: }333333333333333333333333333333333333|
- {1: }333333333333333333333333333333333333|
- {1: }333333333333333333333333333333333333|
- {1: }333333333333333333333333333333333333|
+ {1: }333333333333333333333333333333333333|*4
{1: }33333333333333333333 |
{1: 4 }^444444444444444444444444444444444444|
- {1: }444444444444444444444444444444444444|
- {1: }444444444444444444444444444444444444|
- {1: }444444444444444444444444444444444444|
- {1: }444444444444444444444444444444444444|
+ {1: }444444444444444444444444444444444444|*4
{1: }44444444444444444444 |
|
]])
diff --git a/test/functional/legacy/options_spec.lua b/test/functional/legacy/options_spec.lua
index ce46ea013d..46c3f804a5 100644
--- a/test/functional/legacy/options_spec.lua
+++ b/test/functional/legacy/options_spec.lua
@@ -66,17 +66,7 @@ describe('set', function()
command('verbose set scroll?')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*11
|
scroll=7 |
Last set from changed window size |
diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua
index 5c3f8a6f8c..ba594801cb 100644
--- a/test/functional/legacy/prompt_buffer_spec.lua
+++ b/test/functional/legacy/prompt_buffer_spec.lua
@@ -57,14 +57,10 @@ describe('prompt buffer', function()
]])
screen:expect([[
cmd: ^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
end
@@ -84,22 +80,13 @@ describe('prompt buffer', function()
cmd: ^ |
[Prompt] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed("exit\n")
screen:expect([[
^other buffer |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*8
|
]])
end)
@@ -110,66 +97,43 @@ describe('prompt buffer', function()
feed("hello<BS><BS>")
screen:expect([[
cmd: hel^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed("<Left><Left><Left><BS>-")
screen:expect([[
cmd: -^hel |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed("<C-O>lz")
screen:expect([[
cmd: -hz^el |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed("<End>x")
screen:expect([[
cmd: -hzelx^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed("<C-U>exit\n")
screen:expect([[
^other buffer |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*8
|
]])
end)
@@ -180,40 +144,28 @@ describe('prompt buffer', function()
feed("<C-O>:call SwitchWindows()<CR>")
screen:expect{grid=[[
cmd: |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
^other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]]}
feed("<C-O>:call SwitchWindows()<CR>")
screen:expect([[
cmd: ^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
-- INSERT -- |
]])
feed("<Esc>")
screen:expect([[
cmd:^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
[Prompt] [+] |
other buffer |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
end)
diff --git a/test/functional/legacy/put_spec.lua b/test/functional/legacy/put_spec.lua
index 4a42a1c8a3..e630604d60 100644
--- a/test/functional/legacy/put_spec.lua
+++ b/test/functional/legacy/put_spec.lua
@@ -64,8 +64,7 @@ describe('put', function()
three more text │ three more text |
^four more text │ four more text |
│ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*2
[No Name] [+] [No Name] [+] |
|
]])
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 91dbc120d8..9e62fb55c9 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -36,17 +36,14 @@ describe('smoothscroll', function()
:5
]])
local s1 = [[
- word word word word word word word word |
- word word word word word word word word |
+ word word word word word word word word |*2
word word word word |
line three |
long word long word long word long word |
long word long word long word |
^line |
- line |
- line |
- ~ |
- ~ |
+ line |*2
+ ~ |*2
|
]]
local s2 = [[
@@ -56,11 +53,8 @@ describe('smoothscroll', function()
long word long word long word long word |
long word long word long word |
^line |
- line |
- line |
- ~ |
- ~ |
- ~ |
+ line |*2
+ ~ |*3
|
]]
local s3 = [[
@@ -69,26 +63,17 @@ describe('smoothscroll', function()
long word long word long word long word |
long word long word long word |
^line |
- line |
- line |
- ~ |
- ~ |
- ~ |
- ~ |
+ line |*2
+ ~ |*4
|
]]
local s4 = [[
line three |
long word long word long word long word |
long word long word long word |
- line |
- line |
+ line |*2
^line |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
|
]]
local s5 = [[
@@ -96,13 +81,9 @@ describe('smoothscroll', function()
line three |
long word long word long word long word |
long word long word long word |
- line |
- line |
+ line |*2
^line |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]]
local s6 = [[
@@ -111,38 +92,30 @@ describe('smoothscroll', function()
line three |
long word long word long word long word |
long word long word long word |
- line |
- line |
+ line |*2
^line |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]]
local s7 = [[
- word word word word word word word word |
- word word word word word word word word |
+ word word word word word word word word |*2
word word word word |
line three |
long word long word long word long word |
long word long word long word |
- line |
- line |
+ line |*2
^line |
- ~ |
- ~ |
+ ~ |*2
|
]]
local s8 = [[
line one |
- word word word word word word word word |
- word word word word word word word word |
+ word word word word word word word word |*2
word word word word |
line three |
long word long word long word long word |
long word long word long word |
- line |
- line |
+ line |*2
^line |
~ |
|
@@ -187,8 +160,7 @@ describe('smoothscroll', function()
ϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛ^ϛϛϛϛϛ|
ϛϛϛϛϛ |
222222222222222222222222222222222222 |
- ~ |
- ~ |
+ ~ |*2
|
]])
end)
@@ -217,9 +189,7 @@ describe('smoothscroll', function()
3 ^line |
4 line |
5 line |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
feed('<C-E>')
@@ -231,10 +201,7 @@ describe('smoothscroll', function()
3 ^line |
4 line |
5 line |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
feed('<C-E>')
@@ -245,11 +212,7 @@ describe('smoothscroll', function()
3 ^line |
4 line |
5 line |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
|
]])
exec('set cpo-=n')
@@ -261,10 +224,7 @@ describe('smoothscroll', function()
3 ^line |
4 line |
5 line |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
feed('<C-Y>')
@@ -277,9 +237,7 @@ describe('smoothscroll', function()
3 ^line |
4 line |
5 line |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
feed('<C-Y>')
@@ -293,8 +251,7 @@ describe('smoothscroll', function()
3 ^line |
4 line |
5 line |
- ~ |
- ~ |
+ ~ |*2
|
]])
exec('botright split')
@@ -351,12 +308,7 @@ describe('smoothscroll', function()
y long text very long text very long|
text very long text very long text |
1 three |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*6
--No lines in buffer-- |
]])
end)
@@ -376,8 +328,7 @@ describe('smoothscroll', function()
very long text very long text very long |
text very long text- |
three |
- ~ |
- ~ |
+ ~ |*2
|
]])
exec('set listchars+=precedes:#')
@@ -387,8 +338,7 @@ describe('smoothscroll', function()
very long text very long text very long |
text very long text- |
three |
- ~ |
- ~ |
+ ~ |*2
|
]])
end)
@@ -408,8 +358,7 @@ describe('smoothscroll', function()
]])
screen:expect([[
- ^just some text here |
- ~ |
- ~ |
+ ~ |*2
[No Name] [+] |
- just some text here |
~ |
@@ -580,10 +529,7 @@ describe('smoothscroll', function()
feed('zt')
screen:expect([[
^four |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
feed('zz')
@@ -591,8 +537,7 @@ describe('smoothscroll', function()
<<<of text with lots of text with lots o|
f text with lots of text end |
^four |
- ~ |
- ~ |
+ ~ |*2
|
]])
feed('zb')
@@ -650,8 +595,7 @@ describe('smoothscroll', function()
<<<ts of text with lots of text with lot|
^s of text with lots of text with lots of|
text |
- ~ |
- ~ |
+ ~ |*2
|
]])
feed('0')
@@ -696,18 +640,13 @@ describe('smoothscroll', function()
screen:expect([[
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
口口口口口口口口口口 |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
feed('<C-E>')
screen:expect([[
<<< 口口口口口口口^口 |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
end)
@@ -795,14 +734,7 @@ describe('smoothscroll', function()
]])
-- does not scroll halfway when scrolling to end of buffer
screen:expect([[
- |
- |
- |
- |
- |
- |
- |
- |
+ |*8
^ |
|
]])
@@ -811,13 +743,7 @@ describe('smoothscroll', function()
-- cursor is not placed below window
screen:expect([[
<<<aaaaaaaaaaaaaaaaa |
- |
- |
- |
- |
- |
- |
- |
+ |*7
^ |
|
]])
@@ -907,8 +833,7 @@ describe('smoothscroll', function()
aaaaaaaaaa |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaaa |
- |
- |
+ |*2
bbb |
|
]])
@@ -917,25 +842,19 @@ describe('smoothscroll', function()
{0:<<<}{1:aaaaaa^a }|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaaa |
- |
- |
+ |*2
bbb |
ccc |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('2<C-E>')
screen:expect([[
{0:<<<}{1:aaaaaa^a }|
- |
- |
+ |*2
bbb |
ccc |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -962,21 +881,7 @@ describe('smoothscroll', function()
]])
screen:expect([[
{1: }│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
- {2:@}│ |
+ {2:@}│ |*15
{2:^@}│ |
{3:< }{4:[No Name] [+] }|
|
@@ -1001,8 +906,7 @@ describe('smoothscroll', function()
line3line3line3line3line3line3line3line3|
line3line3line3line3 |
line4 |
- ~ |
- ~ |
+ ~ |*2
[No Name] [+] |
|
]])
@@ -1105,11 +1009,7 @@ describe('smoothscroll', function()
feed('Go123456789<CR>')
screen:expect([[
<<<ery long line ...A very long line ...|
- A very long line ...A very long line ...|
- A very long line ...A very long line ...|
- A very long line ...A very long line ...|
- A very long line ...A very long line ...|
- A very long line ...A very long line ...|
+ A very long line ...A very long line ...|*5
123456789 |
^ |
-- INSERT -- |
diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua
index 25620f5262..9bf3c466b7 100644
--- a/test/functional/legacy/search_spec.lua
+++ b/test/functional/legacy/search_spec.lua
@@ -688,27 +688,18 @@ describe('search cmdline', function()
local s = [[
{tilde:<<<} 18 19 20 21 22 2|
^3 24 |
- |
- |
- |
- |
+ |*4
]]
screen:expect(s)
feed('/xx')
screen:expect([[
- |
- |
- |
- |
+ |*4
{inc:xx}x |
/xx^ |
]])
feed('x')
screen:expect([[
- |
- |
- |
- |
+ |*4
{inc:xxx} |
/xxx^ |
]])
@@ -737,11 +728,9 @@ describe('Search highlight', function()
]])
feed([[/\_.*<CR>]])
screen:expect([[
- {2:xxx } |
- {2:xxx } |
+ {2:xxx } |*2
{2:^xxx }{3: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
/\_.* |
]])
end)
@@ -769,8 +758,7 @@ describe('Search highlight', function()
xxx {4:y}{5:yy}{3: zzz} |
{3:xxx }{5:yyy}{3: zzz} |
{3:xxx }{5:y}{4:^yy} zzz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- VISUAL --} |
]])
end)
diff --git a/test/functional/legacy/search_stat_spec.lua b/test/functional/legacy/search_stat_spec.lua
index bd5ab68e5c..791ae64b8d 100644
--- a/test/functional/legacy/search_stat_spec.lua
+++ b/test/functional/legacy/search_stat_spec.lua
@@ -35,8 +35,7 @@ describe('search stat', function()
{2:^find this} |
fooooobar |
foba |
- foobar |
- foobar |
+ foobar |*2
foo |
fooooobar |
foba |
@@ -49,8 +48,7 @@ describe('search stat', function()
{2:^find this} |
fooooobar |
foba |
- foobar |
- foobar |
+ foobar |*2
foo |
fooooobar |
foba |
@@ -73,11 +71,7 @@ describe('search stat', function()
{3:^+-- 2 lines: foo·············}|
endif |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
/foo [1/2] |
]])
-- Note: there is an intermediate state where the search stat disappears.
@@ -99,12 +93,7 @@ describe('search stat', function()
int cat; |
int {2:^dog}; |
cat = {2:dog}; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
/dog [1/2] |
]])
feed('G0gD')
@@ -112,12 +101,7 @@ describe('search stat', function()
int {2:^cat}; |
int dog; |
{2:cat} = dog; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -148,11 +132,7 @@ describe('search stat', function()
{2:abc}--c |
--------{4:abc} |
--{2:abc} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
/abc^ |
]])
@@ -162,11 +142,7 @@ describe('search stat', function()
{2:abc}--c |
--------{2:abc} |
--{4:abc} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
/abc^ |
]])
@@ -176,11 +152,7 @@ describe('search stat', function()
{4:abc}--c |
--------{2:abc} |
--{2:abc} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
/abc^ |
]])
end)
@@ -197,13 +169,7 @@ describe('search stat', function()
screen:expect([[
{2:^test} |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
/\<test\> [1/1] |
]])
@@ -211,13 +177,7 @@ describe('search stat', function()
screen:expect([[
{2:^test} |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
?\<test\> [1/1] |
]])
@@ -227,13 +187,7 @@ describe('search stat', function()
screen:expect([[
{2:^test} |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
{5:search hit TOP, continuing at BOTTOM} |
]])
end)
diff --git a/test/functional/legacy/source_spec.lua b/test/functional/legacy/source_spec.lua
index f31521607d..4b7d2d361a 100644
--- a/test/functional/legacy/source_spec.lua
+++ b/test/functional/legacy/source_spec.lua
@@ -21,10 +21,7 @@ describe(':source!', function()
feed(':source! Xscript.vim\n')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{1:E22: Scripts nested too deep} |
]])
os.remove('Xscript.vim')
diff --git a/test/functional/legacy/statusline_spec.lua b/test/functional/legacy/statusline_spec.lua
index c5b17f8749..f5119f5e23 100644
--- a/test/functional/legacy/statusline_spec.lua
+++ b/test/functional/legacy/statusline_spec.lua
@@ -60,10 +60,7 @@ describe('statusline', function()
]])
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{3:<F}{2:GHI }|
|
]])
@@ -97,9 +94,7 @@ describe('statusline', function()
screen:expect([[
{5:+-- 2 lines: a···································}|
^c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:g }|
|
]])
@@ -110,8 +105,7 @@ describe('statusline', function()
^a |
b |
c |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3: }|
|
]])
@@ -121,8 +115,7 @@ describe('statusline', function()
{1:a} |
{1:b} |
{1:c}^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:3x2 }|
{2:-- VISUAL BLOCK --} |
]])
@@ -132,8 +125,7 @@ describe('statusline', function()
a |
b |
^c |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:1234 }|
|
]])
@@ -145,8 +137,7 @@ describe('statusline', function()
a |
b |
^c |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] [+] 1234 }|
: |
]])
diff --git a/test/functional/legacy/substitute_spec.lua b/test/functional/legacy/substitute_spec.lua
index f3ce343680..bba3df82d8 100644
--- a/test/functional/legacy/substitute_spec.lua
+++ b/test/functional/legacy/substitute_spec.lua
@@ -179,10 +179,7 @@ describe(':substitute', function()
{1:o}ne |
two |
three |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:replace with (y/n/a/q/l/^E/^Y)?}^ |
]])
end)
diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua
index 6b368d1857..f9e813255a 100644
--- a/test/functional/legacy/tabline_spec.lua
+++ b/test/functional/legacy/tabline_spec.lua
@@ -44,9 +44,7 @@ describe('tabline', function()
{3:g }|
{5:+-- 2 lines: a···································}|
^c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
@@ -57,8 +55,7 @@ describe('tabline', function()
^a |
b |
c |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -68,8 +65,7 @@ describe('tabline', function()
{1:a} |
{1:b} |
{1:c}^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- VISUAL BLOCK --} |
]])
@@ -79,8 +75,7 @@ describe('tabline', function()
a |
b |
^c |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -92,8 +87,7 @@ describe('tabline', function()
a |
b |
^c |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
: |
]])
end)
diff --git a/test/functional/legacy/visual_spec.lua b/test/functional/legacy/visual_spec.lua
index 629fab5eb5..4b1f44661f 100644
--- a/test/functional/legacy/visual_spec.lua
+++ b/test/functional/legacy/visual_spec.lua
@@ -33,8 +33,7 @@ describe('Visual highlight', function()
{2:aaaaaa}^ |
{2:bbbb } |
{2:cc } |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1:-- VISUAL BLOCK --} |
]])
@@ -43,8 +42,7 @@ describe('Visual highlight', function()
{2:aaaaaa } |
{2:bbbb } |
{2:cc}^ {2: } |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1:-- VISUAL BLOCK --} |
]])
end)
@@ -60,9 +58,7 @@ describe('Visual highlight', function()
screen:expect([[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^a|
{0:+}{2:aaaa}aaaaaa |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:-- VISUAL --} |
]])
end)
diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua
index 979b46ae47..14129b386b 100644
--- a/test/functional/legacy/window_cmd_spec.lua
+++ b/test/functional/legacy/window_cmd_spec.lua
@@ -296,10 +296,7 @@ describe('splitkeep', function()
a |
b |
c |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
[No Name] |
^a |
b |
@@ -328,8 +325,7 @@ describe('splitkeep', function()
<<<e line with lots of text in one line |
^with lots of text in one line with lots |
of text in one line |
- ~ |
- ~ |
+ ~ |*2
[No Name] [+] |
|
]])
diff --git a/test/functional/lua/api_spec.lua b/test/functional/lua/api_spec.lua
index d808693a9e..8c03eb60ec 100644
--- a/test/functional/lua/api_spec.lua
+++ b/test/functional/lua/api_spec.lua
@@ -245,4 +245,8 @@ describe('luaeval(vim.api.…)', function()
eq('', funcs.luaeval('vim.api.nvim_replace_termcodes("", 0, 1.5, "test")'))
eq('', funcs.luaeval('vim.api.nvim_replace_termcodes("", true, {}, {[vim.type_idx]=vim.types.array})'))
end)
+
+ it('serializes sparse arrays in Lua', function()
+ eq({ [1] = vim.NIL, [2] = 2 }, exec_lua [[ return { [2] = 2 } ]])
+ end)
end)
diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua
index fca619348d..d8a68219c1 100644
--- a/test/functional/lua/commands_spec.lua
+++ b/test/functional/lua/commands_spec.lua
@@ -117,14 +117,7 @@ describe(':lua command', function()
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]]}
eq('E5108: Error executing lua [string ":lua"]:1: fail\nmuch error\nsuch details', remove_trace(eval('v:errmsg')))
diff --git a/test/functional/lua/ffi_spec.lua b/test/functional/lua/ffi_spec.lua
index 3a37b18cd1..dc00eff9b5 100644
--- a/test/functional/lua/ffi_spec.lua
+++ b/test/functional/lua/ffi_spec.lua
@@ -38,7 +38,7 @@ describe('ffi.cdef', function()
char *out,
size_t outlen,
char *fmt,
- char *opt_name,
+ int opt_idx,
int opt_scope,
int fillchar,
int maxwidth,
@@ -53,7 +53,7 @@ describe('ffi.cdef', function()
ffi.new('char[1024]'),
1024,
ffi.cast('char*', 'StatusLineOfLength20'),
- nil,
+ -1,
0,
0,
0,
diff --git a/test/functional/lua/iter_spec.lua b/test/functional/lua/iter_spec.lua
index ffa28e7b11..2d28395c59 100644
--- a/test/functional/lua/iter_spec.lua
+++ b/test/functional/lua/iter_spec.lua
@@ -91,6 +91,11 @@ describe('vim.iter', function()
end
end)
+ it('join()', function()
+ eq('1, 2, 3', vim.iter({1, 2, 3}):join(', '))
+ eq('a|b|c|d', vim.iter(vim.gsplit('a|b|c|d', '|')):join('|'))
+ end)
+
it('next()', function()
local it = vim.iter({1, 2, 3}):map(function(v) return 2 * v end)
eq(2, it:next())
diff --git a/test/functional/lua/json_spec.lua b/test/functional/lua/json_spec.lua
index 25fdb48eea..705bfcf2f9 100644
--- a/test/functional/lua/json_spec.lua
+++ b/test/functional/lua/json_spec.lua
@@ -101,6 +101,8 @@ describe('vim.json.decode()', function()
eq({['1']=2}, exec_lua([[return vim.json.decode('{"1": 2}')]]))
eq({['1']=2, ['3']={{['4']={['5']={{}, 1}}}}},
exec_lua([[return vim.json.decode('{"1": 2, "3": [{"4": {"5": [ [], 1]}}]}')]]))
+ -- Empty string is a valid key. #20757
+ eq({['']=42}, exec_lua([[return vim.json.decode('{"": 42}')]]))
end)
it('parses strings properly', function()
@@ -161,6 +163,8 @@ describe('vim.json.encode()', function()
it('dumps dictionaries', function()
eq('{}', exec_lua([[return vim.json.encode(vim.empty_dict())]]))
eq('{"d":[]}', exec_lua([[return vim.json.encode({d={}})]]))
+ -- Empty string is a valid key. #20757
+ eq('{"":42}', exec_lua([[return vim.json.encode({['']=42})]]))
end)
it('dumps vim.NIL', function()
diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua
index c0924fa0c0..4f98fe0977 100644
--- a/test/functional/lua/loop_spec.lua
+++ b/test/functional/lua/loop_spec.lua
@@ -112,14 +112,7 @@ describe('vim.uv', function()
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
howdy |
]])
eq(true, eval("get(g:, 'valid', v:false)"))
@@ -137,14 +130,7 @@ describe('vim.uv', function()
]])
screen:expect([[
sneaky^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
{5:-- INSERT --} |
]])
eq({blocking=false, mode='n'}, exec_lua("return _G.mode"))
diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua
index dfbd2fb18b..3810d44538 100644
--- a/test/functional/lua/luaeval_spec.lua
+++ b/test/functional/lua/luaeval_spec.lua
@@ -521,9 +521,7 @@ describe('v:lua', function()
{1:~ }{2: stuff }{1: }|
{1:~ }{3: steam }{1: }|
{1:~ }{3: strange things }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:-- Omni completion (^O^N^P) }{5:match 1 of 3} |
]]}
meths.set_option_value('operatorfunc', 'v:lua.mymod.noisy', {})
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua
index c08f3d06a9..f3ea29b8a7 100644
--- a/test/functional/lua/overrides_spec.lua
+++ b/test/functional/lua/overrides_spec.lua
@@ -148,9 +148,7 @@ describe('print', function()
feed([[:lua print('\na')<CR>]])
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2: }|
|
a |
@@ -160,8 +158,7 @@ describe('print', function()
feed([[:lua print('b\n\nc')<CR>]])
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2: }|
b |
|
@@ -196,16 +193,7 @@ describe('debug.debug', function()
feed(':lua Test()\n')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
{1: }|
nil |
lua_debug> ^ |
@@ -213,14 +201,7 @@ describe('debug.debug', function()
feed('print("TEST")\n')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
{1: }|
nil |
lua_debug> print("TEST") |
@@ -230,8 +211,7 @@ describe('debug.debug', function()
feed('<C-c>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1: }|
nil |
lua_debug> print("TEST") |
@@ -247,16 +227,7 @@ describe('debug.debug', function()
feed('<C-l>:lua Test()\n')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
{1: }|
nil |
lua_debug> ^ |
@@ -264,10 +235,7 @@ describe('debug.debug', function()
feed('\n')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{1: }|
nil |
lua_debug> |
@@ -285,32 +253,14 @@ describe('debug.debug', function()
feed(':lua debug.debug() print("x")<cr>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
lua_debug> ^ |
]]}
feed("conttt<cr>") -- misspelled cont; invalid syntax
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
{1: }|
lua_debug> conttt |
{E:E5115: Error while loading debug string: (debug comma}|
@@ -321,12 +271,7 @@ describe('debug.debug', function()
feed("cont<cr>") -- exactly "cont", exit now
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{1: }|
lua_debug> conttt |
{E:E5115: Error while loading debug string: (debug comma}|
@@ -339,18 +284,7 @@ describe('debug.debug', function()
feed('<cr>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
|
]]}
end)
diff --git a/test/functional/lua/secure_spec.lua b/test/functional/lua/secure_spec.lua
index fc20a06390..c59d3f3cda 100644
--- a/test/functional/lua/secure_spec.lua
+++ b/test/functional/lua/secure_spec.lua
@@ -48,9 +48,7 @@ describe('vim.secure', function()
feed_command([[lua vim.secure.read('Xfile')]])
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2: }|
:lua vim.secure.read('Xfile') |
{3:]] .. cwd .. pathsep .. [[Xfile is not trusted.}{MATCH:%s+}|
@@ -59,12 +57,7 @@ describe('vim.secure', function()
feed('d')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
@@ -77,9 +70,7 @@ describe('vim.secure', function()
feed_command([[lua vim.secure.read('Xfile')]])
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2: }|
:lua vim.secure.read('Xfile') |
{3:]] .. cwd .. pathsep .. [[Xfile is not trusted.}{MATCH:%s+}|
@@ -88,12 +79,7 @@ describe('vim.secure', function()
feed('a')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
@@ -107,9 +93,7 @@ describe('vim.secure', function()
feed_command([[lua vim.secure.read('Xfile')]])
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2: }|
:lua vim.secure.read('Xfile') |
{3:]] .. cwd .. pathsep .. [[Xfile is not trusted.}{MATCH:%s+}|
@@ -118,12 +102,7 @@ describe('vim.secure', function()
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
@@ -134,9 +113,7 @@ describe('vim.secure', function()
feed_command([[lua vim.secure.read('Xfile')]])
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2: }|
:lua vim.secure.read('Xfile') |
{3:]] .. cwd .. pathsep .. [[Xfile is not trusted.}{MATCH:%s+}|
@@ -145,8 +122,7 @@ describe('vim.secure', function()
feed('v')
screen:expect{grid=[[
^let g:foobar = 42 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:]] .. funcs.fnamemodify(cwd, ':~') .. pathsep .. [[Xfile [RO]{MATCH:%s+}}|
|
{1:~ }|
diff --git a/test/functional/lua/thread_spec.lua b/test/functional/lua/thread_spec.lua
index e79d26a641..23c0c42f07 100644
--- a/test/functional/lua/thread_spec.lua
+++ b/test/functional/lua/thread_spec.lua
@@ -35,11 +35,7 @@ describe('thread', function()
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2: }|
{3:Error in luv thread:} |
{3:[string "<nvim>"]:2: Error in thread entry func} |
@@ -66,11 +62,7 @@ describe('thread', function()
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2: }|
{3:Error in luv callback, thread:} |
{3:[string "<nvim>"]:6: Error in thread callback} |
@@ -91,14 +83,7 @@ describe('thread', function()
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
print in thread |
]])
end)
@@ -113,14 +98,7 @@ describe('thread', function()
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
{ 1, 2 } |
]])
end)
@@ -294,11 +272,7 @@ describe('threadpool', function()
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2: }|
{3:Error in luv thread:} |
{3:Error: thread arg not support type 'table' at 1} |
diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua
index 373d45da61..04ffeddc87 100644
--- a/test/functional/lua/ui_event_spec.lua
+++ b/test/functional/lua/ui_event_spec.lua
@@ -46,18 +46,14 @@ describe('vim.ui_attach', function()
feed('ifo')
screen:expect{grid=[[
fo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]]}
funcs.complete(1, {'food', 'foobar', 'foo'})
screen:expect{grid=[[
food^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]]}
expect_events {
@@ -67,9 +63,7 @@ describe('vim.ui_attach', function()
feed '<c-n>'
screen:expect{grid=[[
foobar^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]]}
expect_events {
@@ -101,7 +95,7 @@ describe('vim.ui_attach', function()
end)
it('does not crash on exit', function()
- helpers.funcs.system({
+ funcs.system({
helpers.nvim_prog,
'-u', 'NONE',
'-i', 'NONE',
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index ebe5fc254e..1ef214d611 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -271,9 +271,7 @@ describe('lua stdlib', function()
screen:attach()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -2798,25 +2796,19 @@ describe('lua stdlib', function()
screen:attach()
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]}
exec_lua [[vim.notify_once("I'll only tell you this once...", vim.log.levels.WARN)]]
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{1:I'll only tell you this once...} |
]]}
feed('<C-l>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]}
exec_lua [[vim.notify_once("I'll only tell you this once...")]]
diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua
index a082204980..9800a21e60 100644
--- a/test/functional/options/chars_spec.lua
+++ b/test/functional/options/chars_spec.lua
@@ -27,36 +27,27 @@ describe("'fillchars'", function()
eq('', eval('&fillchars'))
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
end)
it('supports whitespace', function()
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
command('set fillchars=eob:\\ ')
screen:expect([[
^ |
- |
- |
- |
- |
+ |*4
]])
end)
it('supports multibyte char', function()
command('set fillchars=eob:ñ')
screen:expect([[
^ |
- ñ |
- ñ |
- ñ |
+ ñ |*3
|
]])
end)
@@ -77,9 +68,7 @@ describe("'fillchars'", function()
command('set fillchars=fold:x')
screen:expect([[
^+-- 2 lines: fooxxxxxxxx│+-- 2 lines: fooxxxxxxx|
- ~ │~ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*3
|
]])
end)
@@ -92,9 +81,7 @@ describe("'fillchars'", function()
command('setl fillchars=fold:x')
screen:expect([[
^+-- 2 lines: fooxxxxxxxx│+-- 2 lines: foo·······|
- ~ │~ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*3
|
]])
end)
@@ -108,9 +95,7 @@ describe("'fillchars'", function()
command('set fillchars&')
screen:expect([[
^+-- 2 lines: foo········│+-- 2 lines: fooxxxxxxx|
- ~ │~ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*3
|
]])
end)
@@ -132,9 +117,7 @@ describe("'listchars'", function()
command('set listchars=tab:<->')
screen:expect([[
<------><------>^<------> │<------><------><------>|
- ~ │~ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*3
|
]])
end)
@@ -146,9 +129,7 @@ describe("'listchars'", function()
command('setl listchars<')
screen:expect([[
> > ^> │<------><------><------>|
- ~ │~ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*3
|
]])
end)
@@ -160,9 +141,7 @@ describe("'listchars'", function()
command('set listchars=tab:>-,eol:$')
screen:expect([[
>------->-------^>-------$│<------><------><------>|
- ~ │~ |
- ~ │~ |
- ~ │~ |
+ ~ │~ |*3
|
]])
end)
diff --git a/test/functional/options/cursorbind_spec.lua b/test/functional/options/cursorbind_spec.lua
index 498206936a..0dfac100ee 100644
--- a/test/functional/options/cursorbind_spec.lua
+++ b/test/functional/options/cursorbind_spec.lua
@@ -32,10 +32,7 @@ describe("'cursorbind'", function()
feed('20l')
screen:expect([[
a bb cc dd ee ff gg │aa bb cc dd ee ff gg^ hh ii jj kk ll mm |
- {4: }│ {4: } |
- {4: }│ {4: } |
- {4: }│ {4: } |
- {4: }│ {4: } |
+ {4: }│ {4: } |*4
{1:~ }│{1:~ }|
{3:[No Name] [+] }{2:[No Name] [+] }|
|
@@ -43,10 +40,7 @@ describe("'cursorbind'", function()
feed('10l')
screen:expect([[
hh ii jj kk ll mm n│aa bb cc dd ee ff gg hh ii jj ^kk ll mm |
- {4: } │ {4: } |
- {4: } │ {4: } |
- {4: } │ {4: } |
- {4: } │ {4: } |
+ {4: } │ {4: } |*4
{1:~ }│{1:~ }|
{3:[No Name] [+] }{2:[No Name] [+] }|
|
@@ -56,10 +50,7 @@ describe("'cursorbind'", function()
feed('20l')
screen:expect([[
{4:a bb cc dd ee ff gg }│{4:aa bb cc dd ee ff gg^ hh ii jj kk ll mm }|
- {4: }│ {4: } |
- {4: }│ {4: } |
- {4: }│ {4: } |
- {4: }│ {4: } |
+ {4: }│ {4: } |*4
{1:~ }│{1:~ }|
{3:[No Name] [+] }{2:[No Name] [+] }|
|
@@ -67,10 +58,7 @@ describe("'cursorbind'", function()
feed('10l')
screen:expect([[
{4: hh ii jj kk ll mm n}│{4:aa bb cc dd ee ff gg hh ii jj ^kk ll mm }|
- {4: } │ {4: } |
- {4: } │ {4: } |
- {4: } │ {4: } |
- {4: } │ {4: } |
+ {4: } │ {4: } |*4
{1:~ }│{1:~ }|
{3:[No Name] [+] }{2:[No Name] [+] }|
|
@@ -80,10 +68,7 @@ describe("'cursorbind'", function()
feed('40l')
screen:expect([[
kk ll mm nn oo pp qq│ bb cc dd ee ff gg hh ii jj kk ll mm n^n|
- │ |
- │ |
- │ |
- │ |
+ │ |*4
{1:~ }│{1:~ }|
{3:[No Name] [+] }{2:[No Name] [+] }|
|
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index 7858b626de..4a0aa7d023 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -32,8 +32,7 @@ describe('startup defaults', function()
command('filetype')
screen:expect([[
^ |
- ~ |
- ~ |
+ ~ |*2
]]..expected
)
end
diff --git a/test/functional/options/shortmess_spec.lua b/test/functional/options/shortmess_spec.lua
index a56e9c09b4..6bc00ca1c5 100644
--- a/test/functional/options/shortmess_spec.lua
+++ b/test/functional/options/shortmess_spec.lua
@@ -22,9 +22,7 @@ describe("'shortmess'", function()
feed(':edit foo<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
"foo" [New] |
]])
eq(1, eval('bufnr("%")'))
@@ -33,9 +31,7 @@ describe("'shortmess'", function()
feed(':edit bar<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
:edit bar |
]])
eq(2, eval('bufnr("%")'))
@@ -47,27 +43,21 @@ describe("'shortmess'", function()
feed(':edit foo<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
"foo" [New] |
]])
eq(1, eval('bufnr("%")'))
feed(':edit bar<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
"bar" [New] |
]])
eq(2, eval('bufnr("%")'))
feed(':bprevious<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
"foo" [New] --No lines in buffer-- |
]])
eq(1, eval('bufnr("%")'))
@@ -76,18 +66,14 @@ describe("'shortmess'", function()
feed(':bnext<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
:bnext |
]])
eq(2, eval('bufnr("%")'))
feed(':bprevious<CR>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
:bprevious |
]])
eq(1, eval('bufnr("%")'))
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua
index b7ac53f270..b95d435c2b 100644
--- a/test/functional/plugin/lsp/semantic_tokens_spec.lua
+++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua
@@ -125,9 +125,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -164,9 +162,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -199,9 +195,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -234,9 +228,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -257,9 +249,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -286,9 +276,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -309,9 +297,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], unchanged = true }
@@ -365,9 +351,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
feed_command('%s/int x/int x()/')
@@ -383,11 +367,8 @@ describe('semantic token highlighting', function()
{6:#else} |
{6: printf("%d\n", x);} |
{6:#endif} |
- } |
- } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ } |*2
+ {1:~ }|*3
:noh |
]] }
end)
@@ -447,9 +428,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -474,9 +453,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], unchanged = true }
end)
@@ -520,9 +497,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -565,9 +540,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
feed_command('%s/int x/int x()/')
@@ -587,11 +560,8 @@ describe('semantic token highlighting', function()
{6:#else} |
{6: printf("%d\n", x);} |
{6:#endif} |
- } |
- } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ } |*2
+ {1:~ }|*3
:noh |
]] }
local messages = exec_lua('return server2.messages')
@@ -633,20 +603,7 @@ describe('semantic token highlighting', function()
expected_screen = function()
screen:expect{grid=[[
char* {7:foo} = "\n"^; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
@@ -774,11 +731,7 @@ int main()
{6: comment} |
{6: #endif} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
end,
@@ -828,18 +781,7 @@ b = "as"]],
{6:-- comment} |
local {7:a} = 1 |
{2:b} = "as^" |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*12
|
]]}
end,
@@ -960,16 +902,7 @@ b = "as"]],
//{6:/ what?} |
} |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
|
]]}
end,
@@ -1055,20 +988,7 @@ b = "as"]],
expected_screen1 = function()
screen:expect{grid=[[
char* {7:foo} = "\n"^; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
@@ -1076,19 +996,7 @@ b = "as"]],
screen:expect{grid=[[
^ |
char* {7:foo} = "\n"; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
|
]]}
end,
@@ -1304,10 +1212,7 @@ int main()
{6: printf("%d\n", x);} |
{6:#endif} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end,
@@ -1325,9 +1230,7 @@ int main()
{6: printf("%d\n", x);} |
{6:^#endif} |
} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end,
@@ -1363,40 +1266,14 @@ int main()
expected_screen1 = function()
screen:expect{grid=[[
{7:string} = "test^" |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
expected_screen2 = function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua
index 815ddbc523..f16fca51f9 100644
--- a/test/functional/plugin/man_spec.lua
+++ b/test/functional/plugin/man_spec.lua
@@ -71,8 +71,7 @@ describe(':Man', function()
screen:expect{grid=[[
this i{c:^H}is{c:^H}s a{c:^H}a test |
with _{c:^H}o_{c:^H}v_{c:^H}e_{c:^H}r_{c:^H}s_{c:^H}t_{c:^H}r_{c:^H}u_{c:^H}c_{c:^H}k tex^t |
- {eob:~ }|
- {eob:~ }|
+ {eob:~ }|*2
|
]]}
@@ -81,8 +80,7 @@ describe(':Man', function()
screen:expect([[
^this {b:is} {b:a} test |
with {i:overstruck} text |
- {eob:~ }|
- {eob:~ }|
+ {eob:~ }|*2
|
]])
end)
@@ -95,8 +93,7 @@ describe(':Man', function()
screen:expect{grid=[=[
this {c:^[}[1mis {c:^[}[3ma {c:^[}[4mtest{c:^[}[0m |
{c:^[}[4mwith{c:^[}[24m {c:^[}[4mescaped{c:^[}[24m {c:^[}[4mtext{c:^[}[24^m |
- {eob:~ }|
- {eob:~ }|
+ {eob:~ }|*2
|
]=]}
@@ -105,8 +102,7 @@ describe(':Man', function()
screen:expect([[
^this {b:is }{bi:a }{biu:test} |
{u:with} {u:escaped} {u:text} |
- {eob:~ }|
- {eob:~ }|
+ {eob:~ }|*2
|
]])
end)
@@ -120,8 +116,7 @@ describe(':Man', function()
screen:expect([[
^this {b:is} {b:あ} test |
with {i:överstrũck} te{i:xt¶} |
- {eob:~ }|
- {eob:~ }|
+ {eob:~ }|*2
|
]])
end)
diff --git a/test/functional/provider/clipboard_spec.lua b/test/functional/provider/clipboard_spec.lua
index 0099183302..3c2e358745 100644
--- a/test/functional/provider/clipboard_spec.lua
+++ b/test/functional/provider/clipboard_spec.lua
@@ -112,15 +112,13 @@ describe('clipboard', function()
feed('"+yl')
screen:expect([[
^a |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
feed('"+p')
screen:expect([[
a^a |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
end)
@@ -132,22 +130,19 @@ describe('clipboard', function()
feed('yl')
screen:expect([[
^a |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
feed(':<CR>')
screen:expect([[
^a |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
: |
]])
feed('p')
screen:expect([[
a^a |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
: |
]])
end)
@@ -157,8 +152,7 @@ describe('clipboard', function()
feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
end)
@@ -184,8 +178,7 @@ describe('clipboard', function()
feed_command('let @+="foo"')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
end)
@@ -336,8 +329,7 @@ describe('clipboard (with fake clipboard.vim)', function()
feed_command('redir @+> | bogus_cmd | redir END')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1:E492: Not an editor command: bogus_cmd | redir END} |
]])
end)
@@ -663,8 +655,7 @@ describe('clipboard (with fake clipboard.vim)', function()
feed_command("registers")
screen:expect([[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{4: }|
:registers |
{1:Type Name Content} |
@@ -728,8 +719,7 @@ describe('clipboard (with fake clipboard.vim)', function()
screen:expect([[
the ^source |
a target |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
diff --git a/test/functional/terminal/altscreen_spec.lua b/test/functional/terminal/altscreen_spec.lua
index cbe5e06005..21edd522c0 100644
--- a/test/functional/terminal/altscreen_spec.lua
+++ b/test/functional/terminal/altscreen_spec.lua
@@ -27,11 +27,7 @@ describe(':terminal altscreen', function()
]])
enter_altscreen()
screen:expect([[
- |
- |
- |
- |
- |
+ |*5
{1: } |
{3:-- TERMINAL --} |
]])
@@ -45,9 +41,7 @@ describe(':terminal altscreen', function()
line1 |
line2 |
line3 |
- |
- |
- |
+ |*3
]])
end)
@@ -114,8 +108,7 @@ describe(':terminal altscreen', function()
local function wait_removal()
screen:try_resize(screen._width, screen._height - 2)
screen:expect([[
- |
- |
+ |*2
rows: 4, cols: 50 |
{1: } |
{3:-- TERMINAL --} |
@@ -127,8 +120,7 @@ describe(':terminal altscreen', function()
feed('<c-\\><c-n>4k')
screen:expect([[
^ |
- |
- |
+ |*2
rows: 4, cols: 50 |
|
]])
diff --git a/test/functional/terminal/api_spec.lua b/test/functional/terminal/api_spec.lua
index c278b2ad0e..aa46ccc8a8 100644
--- a/test/functional/terminal/api_spec.lua
+++ b/test/functional/terminal/api_spec.lua
@@ -11,8 +11,12 @@ describe('api', function()
before_each(function()
helpers.clear()
os.remove(socket_name)
- screen = child_session.screen_setup(0, '["'..helpers.nvim_prog
- ..'", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "'..helpers.nvim_set..'"]')
+ screen = child_session.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', helpers.nvim_set .. ' notermguicolors',
+ })
end)
after_each(function()
os.remove(socket_name)
@@ -21,10 +25,7 @@ describe('api', function()
it("qa! RPC request during insert-mode", function()
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
|
{3:-- TERMINAL --} |
]]}
@@ -35,10 +36,7 @@ describe('api', function()
-- Wait for socket creation.
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
]]..socket_name..[[ |
{3:-- TERMINAL --} |
]])
@@ -50,10 +48,7 @@ describe('api', function()
-- Wait for stdin to be processed.
screen:expect([[
[tui] insert-mode{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
{3:-- INSERT --} |
{3:-- TERMINAL --} |
]])
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 423e7bdf21..02958a69e0 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -1,8 +1,10 @@
local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
local thelpers = require('test.functional.terminal.helpers')
local assert_alive = helpers.assert_alive
local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim
local poke_eventloop = helpers.poke_eventloop
+local nvim_prog = helpers.nvim_prog
local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.source
local pcall_err = helpers.pcall_err
local eq, neq = helpers.eq, helpers.neq
@@ -17,7 +19,6 @@ local sleep = helpers.sleep
local funcs = helpers.funcs
local is_os = helpers.is_os
local skip = helpers.skip
-local nvim_prog = helpers.nvim_prog
describe(':terminal buffer', function()
local screen
@@ -59,11 +60,7 @@ describe(':terminal buffer', function()
feed('<c-\\><c-n>:set bufhidden=wipe<cr>:enew<cr>')
screen:expect([[
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*5
:enew |
]])
end)
@@ -72,11 +69,7 @@ describe(':terminal buffer', function()
feed(':bnext:l<esc>')
screen:expect([[
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*5
|
]])
end)
@@ -88,11 +81,7 @@ describe(':terminal buffer', function()
screen:expect([[
tty ready |
{2:^ } |
- |
- |
- |
- |
- |
+ |*5
]])
end)
@@ -112,10 +101,7 @@ describe(':terminal buffer', function()
screen:expect([[
tty ready |
{2:^ } |
- |
- |
- |
- |
+ |*4
{8:E21: Cannot make changes, 'modifiable' is off} |
]])
end)
@@ -126,22 +112,16 @@ describe(':terminal buffer', function()
feed('"ap"ap')
screen:expect([[
^tty ready |
- appended tty ready |
- appended tty ready |
+ appended tty ready |*2
{2: } |
- |
- |
+ |*2
:let @a = "appended " . @a |
]])
-- operator count is also taken into consideration
feed('3"ap')
screen:expect([[
^tty ready |
- appended tty ready |
- appended tty ready |
- appended tty ready |
- appended tty ready |
- appended tty ready |
+ appended tty ready |*5
:let @a = "appended " . @a |
]])
end)
@@ -154,17 +134,14 @@ describe(':terminal buffer', function()
^tty ready |
appended tty ready |
{2: } |
- |
- |
- |
+ |*3
:put a |
]])
-- line argument is only used to move the cursor
feed_command('6put a')
screen:expect([[
tty ready |
- appended tty ready |
- appended tty ready |
+ appended tty ready |*2
{2: } |
|
^ |
@@ -176,21 +153,13 @@ describe(':terminal buffer', function()
feed('<c-\\><c-n>:bd!<cr>')
screen:expect([[
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*5
:bd! |
]])
feed_command('bnext')
screen:expect([[
^ |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*5
:bnext |
]])
end)
@@ -267,10 +236,7 @@ describe(':terminal buffer', function()
screen:expect([[
ydaer ytt|
{1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]])
command('bdelete!')
@@ -308,10 +274,7 @@ describe(':terminal buffer', function()
screen:expect{grid=[[
tty ready |
{2:^ } |
- |
- |
- |
- |
+ |*4
{3:-- (terminal) --} |
]]}
eq('ntT', funcs.mode(1))
@@ -320,10 +283,7 @@ describe(':terminal buffer', function()
screen:expect{grid=[[
tty ready |
{2: } |
- |
- |
- |
- |
+ |*4
:let g:x = 17^ |
]]}
@@ -331,10 +291,7 @@ describe(':terminal buffer', function()
screen:expect{grid=[[
tty ready |
{1: } |
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]]}
eq('t', funcs.mode(1))
@@ -446,15 +403,16 @@ end)
describe('terminal input', function()
it('sends various special keys with modifiers', function()
clear()
- local screen = thelpers.screen_setup(
- 0,
- string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--cmd", 'colorscheme vim', "--cmd", "startinsert"]]=], nvim_prog)
- )
+ local screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'set notermguicolors',
+ '--cmd', 'startinsert',
+ })
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,1 All}|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -485,7 +443,7 @@ if is_os('win') then
clear()
feed_command('set modifiable swapfile undolevels=20')
poke_eventloop()
- local cmd = '["cmd.exe","/K","PROMPT=$g$s"]'
+ local cmd = { "cmd.exe", "/K", "PROMPT=$g$s" }
screen = thelpers.screen_setup(nil, cmd)
end)
@@ -557,4 +515,51 @@ describe('termopen()', function()
eq("Vim:E11: Invalid in command-line window; <CR> executes, CTRL-C quits",
pcall_err(funcs.termopen, "bar"))
end)
+
+ describe('$COLORTERM value', function()
+ if skip(is_os('win'), 'Not applicable for Windows') then return end
+
+ before_each(function()
+ -- Outer value should never be propagated to :terminal
+ funcs.setenv('COLORTERM', 'wrongvalue')
+ end)
+
+ local function test_term_colorterm(expected, opts)
+ local screen = Screen.new(50, 4)
+ screen:attach()
+ funcs.termopen({
+ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless',
+ '-c', 'echo $COLORTERM | quit',
+ }, opts)
+ screen:expect(([[
+ ^%s{MATCH:%%s+}|
+ [Process exited 0] |
+ |*2
+ ]]):format(expected))
+ end
+
+ describe("with 'notermguicolors'", function()
+ before_each(function()
+ command('set notermguicolors')
+ end)
+ it('is empty by default', function()
+ test_term_colorterm('')
+ end)
+ it('can be overridden', function()
+ test_term_colorterm('expectedvalue', { env = { COLORTERM = 'expectedvalue' } })
+ end)
+ end)
+
+ describe("with 'termguicolors'", function()
+ before_each(function()
+ command('set termguicolors')
+ end)
+ it('is "truecolor" by default', function()
+ test_term_colorterm('truecolor')
+ end)
+ it('can be overridden', function()
+ test_term_colorterm('expectedvalue', { env = { COLORTERM = 'expectedvalue' } })
+ end)
+ end)
+ end)
end)
diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua
index 8510df5347..6fb1a21561 100644
--- a/test/functional/terminal/channel_spec.lua
+++ b/test/functional/terminal/channel_spec.lua
@@ -140,8 +140,7 @@ describe('no crash when TermOpen autocommand', function()
async_meths.command('terminal foobar')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
^ |
]]}
feed('<CR>')
@@ -154,8 +153,7 @@ describe('no crash when TermOpen autocommand', function()
feed('i<CR>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
assert_alive()
@@ -166,15 +164,13 @@ describe('no crash when TermOpen autocommand', function()
async_meths.command('terminal foobar')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
^ |
]]}
feed('<CR>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
assert_alive()
@@ -185,15 +181,13 @@ describe('no crash when TermOpen autocommand', function()
async_meths.open_term(0, {})
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
^ |
]]}
feed('<CR>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
assert_alive()
diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua
index 95081b7189..95d601e3f0 100644
--- a/test/functional/terminal/cursor_spec.lua
+++ b/test/functional/terminal/cursor_spec.lua
@@ -3,7 +3,6 @@ local Screen = require('test.functional.ui.screen')
local thelpers = require('test.functional.terminal.helpers')
local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim
local testprg, command = helpers.testprg, helpers.command
-local nvim_prog = helpers.nvim_prog
local eq, eval = helpers.eq, helpers.eval
local matches = helpers.matches
local poke_eventloop = helpers.poke_eventloop
@@ -26,10 +25,7 @@ describe(':terminal cursor', function()
screen:expect([[
tty ready |
testing cursor{1: } |
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]])
end)
@@ -39,11 +35,7 @@ describe(':terminal cursor', function()
screen:expect([[
tty ready |
{2:^ } |
- |
- |
- |
- |
- |
+ |*5
]])
end)
@@ -94,21 +86,14 @@ describe(':terminal cursor', function()
hide_cursor()
screen:expect([[
tty ready |
- |
- |
- |
- |
- |
+ |*5
{3:-- TERMINAL --} |
]])
show_cursor()
screen:expect([[
tty ready |
{1: } |
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]])
-- same for when the terminal is unfocused
@@ -117,21 +102,13 @@ describe(':terminal cursor', function()
screen:expect([[
tty ready |
^ |
- |
- |
- |
- |
- |
+ |*5
]])
show_cursor()
screen:expect([[
tty ready |
{2:^ } |
- |
- |
- |
- |
- |
+ |*5
]])
end)
end)
@@ -161,21 +138,14 @@ describe('cursor with customized highlighting', function()
screen:expect([[
tty ready |
{1: } |
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]])
feed('<c-\\><c-n>')
screen:expect([[
tty ready |
{2:^ } |
- |
- |
- |
- |
- |
+ |*5
]])
end)
end)
@@ -184,10 +154,18 @@ describe('buffer cursor position is correct in terminal without number column',
local screen
local function setup_ex_register(str)
- screen = thelpers.screen_setup(0, '["'..nvim_prog
- ..[[", "-u", "NONE", "-i", "NONE", "-E", "--cmd", "let @r = ']]..str..[['", ]]
+ screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '-E',
+ '--cmd', string.format('let @r = "%s"', str),
-- <Left> and <Right> don't always work
- ..[["--cmd", "cnoremap <C-X> <Left>", "--cmd", "cnoremap <C-O> <Right>"]]..']', 70)
+ '--cmd', 'cnoremap <C-X> <Left>',
+ '--cmd', 'cnoremap <C-O> <Right>',
+ '--cmd', 'set notermguicolors',
+ }, {
+ cols = 70,
+ })
screen:set_default_attr_ids({
[1] = {foreground = 253, background = 11};
[3] = {bold = true},
@@ -198,10 +176,7 @@ describe('buffer cursor position is correct in terminal without number column',
screen._handle_busy_start = function() end
screen._handle_busy_stop = function() end
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::}{17:^ }{16: }|
{3:-- TERMINAL --} |
@@ -218,10 +193,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('at the end', function()
feed('<C-R>r')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::aaaaaaaa}{17:^ }{16: }|
{3:-- TERMINAL --} |
@@ -229,10 +201,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 9}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::aaaaaaa^a}{1: }{16: }|
|
@@ -243,10 +212,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the end', function()
feed('<C-R>r<C-X><C-X>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::aaaaaa}{17:^a}{16:a }|
{3:-- TERMINAL --} |
@@ -254,10 +220,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 7}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::aaaaa^a}{1:a}{16:a }|
|
@@ -268,10 +231,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the start', function()
feed('<C-R>r<C-B><C-O>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::a}{17:^a}{16:aaaaaa }|
{3:-- TERMINAL --} |
@@ -279,10 +239,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 2}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::^a}{1:a}{16:aaaaaa }|
|
@@ -299,10 +256,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('at the end', function()
feed('<C-R>r')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µµµµµµµµ}{17:^ }{16: }|
{3:-- TERMINAL --} |
@@ -310,10 +264,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 17}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µµµµµµµ^µ}{1: }{16: }|
|
@@ -324,10 +275,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the end', function()
feed('<C-R>r<C-X><C-X>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µµµµµµ}{17:^µ}{16:µ }|
{3:-- TERMINAL --} |
@@ -335,10 +283,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 13}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µµµµµ^µ}{1:µ}{16:µ }|
|
@@ -349,10 +294,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the start', function()
feed('<C-R>r<C-B><C-O>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µ}{17:^µ}{16:µµµµµµ }|
{3:-- TERMINAL --} |
@@ -360,10 +302,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 3}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::^µ}{1:µ}{16:µµµµµµ }|
|
@@ -382,10 +321,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('at the end', function()
feed('<C-R>r')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳}{17:^ }{16: }|
{3:-- TERMINAL --} |
@@ -393,10 +329,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 33}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳}{1: }{16: }|
|
@@ -407,10 +340,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the end', function()
feed('<C-R>r<C-X><C-X>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µ̳µ̳µ̳µ̳µ̳µ̳}{17:^µ̳}{16:µ̳ }|
{3:-- TERMINAL --} |
@@ -418,10 +348,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 25}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µ̳µ̳µ̳µ̳µ̳^µ̳}{1:µ̳}{16:µ̳ }|
|
@@ -432,10 +359,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the start', function()
feed('<C-R>r<C-B><C-O>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::µ̳}{17:^µ̳}{16:µ̳µ̳µ̳µ̳µ̳µ̳ }|
{3:-- TERMINAL --} |
@@ -443,10 +367,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 5}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::^µ̳}{1:µ̳}{16:µ̳µ̳µ̳µ̳µ̳µ̳ }|
|
@@ -465,10 +386,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('at the end', function()
feed('<C-R>r')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::哦哦哦哦哦哦哦哦}{17:^ }{16: }|
{3:-- TERMINAL --} |
@@ -476,10 +394,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 25}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::哦哦哦哦哦哦哦^哦}{1: }{16: }|
|
@@ -490,10 +405,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the end', function()
feed('<C-R>r<C-X><C-X>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::哦哦哦哦哦哦}{17:^哦}{16:哦 }|
{3:-- TERMINAL --} |
@@ -501,10 +413,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 19}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::哦哦哦哦哦^哦}{1:哦}{16:哦 }|
|
@@ -515,10 +424,7 @@ describe('buffer cursor position is correct in terminal without number column',
it('near the start', function()
feed('<C-R>r<C-B><C-O>')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::哦}{17:^哦}{16:哦哦哦哦哦哦 }|
{3:-- TERMINAL --} |
@@ -526,10 +432,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 4}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::^哦}{1:哦}{16:哦哦哦哦哦哦 }|
|
@@ -542,10 +445,7 @@ describe('buffer cursor position is correct in terminal without number column',
setup_ex_register('aaaaaaaa ')
feed('<C-R>r')
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::aaaaaaaa }{17:^ }{16: }|
{3:-- TERMINAL --} |
@@ -554,10 +454,7 @@ describe('buffer cursor position is correct in terminal without number column',
eq({6, 13}, eval('nvim_win_get_cursor(0)'))
feed([[<C-\><C-N>]])
screen:expect([[
- {16: }|
- {16: }|
- {16: }|
- {16: }|
+ {16: }|*4
{16:Entering Ex mode. Type "visual" to go to Normal mode. }|
{16::aaaaaaaa ^ }{1: }{16: }|
|
@@ -570,10 +467,18 @@ describe('buffer cursor position is correct in terminal with number column', fun
local screen
local function setup_ex_register(str)
- screen = thelpers.screen_setup(0, '["'..nvim_prog
- ..[[", "-u", "NONE", "-i", "NONE", "-E", "--cmd", "let @r = ']]..str..[['", ]]
+ screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '-E',
+ '--cmd', string.format('let @r = "%s"', str),
-- <Left> and <Right> don't always work
- ..[["--cmd", "cnoremap <C-X> <Left>", "--cmd", "cnoremap <C-O> <Right>"]]..']', 70)
+ '--cmd', 'cnoremap <C-X> <Left>',
+ '--cmd', 'cnoremap <C-O> <Right>',
+ '--cmd', 'set notermguicolors',
+ }, {
+ cols = 70,
+ })
screen:set_default_attr_ids({
[1] = {foreground = 253, background = 11};
[3] = {bold = true},
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 77fe57dd94..927c021a23 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -177,8 +177,7 @@ local function test_terminal_with_fake_shell(backslash)
feed_command('terminal')
screen:expect([[
^ |
- ~ |
- ~ |
+ ~ |*2
E91: 'shell' option is empty |
]])
end)
@@ -188,8 +187,7 @@ local function test_terminal_with_fake_shell(backslash)
feed_command('terminal')
screen:expect([[
^interact $ |
- |
- |
+ |*2
:terminal |
]])
end)
diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua
index 62d3dd67a3..9566079389 100644
--- a/test/functional/terminal/helpers.lua
+++ b/test/functional/terminal/helpers.lua
@@ -6,6 +6,7 @@ local Screen = require('test.functional.ui.screen')
local testprg = helpers.testprg
local exec_lua = helpers.exec_lua
local nvim = helpers.nvim
+local nvim_prog = helpers.nvim_prog
local function feed_data(data)
if type(data) == 'table' then
@@ -51,9 +52,9 @@ local function clear_attrs() feed_termcode('[0;10m') end
local function enable_mouse() feed_termcode('[?1002h') end
local function disable_mouse() feed_termcode('[?1002l') end
-local default_command = '["'..testprg('tty-test')..'"]'
+local default_command = { testprg('tty-test') }
-local function screen_setup(extra_rows, command, cols, opts)
+local function screen_setup(extra_rows, command, cols, env, screen_opts)
extra_rows = extra_rows and extra_rows or 0
command = command and command or default_command
cols = cols and cols or 50
@@ -80,9 +81,10 @@ local function screen_setup(extra_rows, command, cols, opts)
[15] = {underline = true, foreground = 12},
})
- screen:attach(opts or {rgb=false})
+ screen:attach(screen_opts or {rgb=false})
- nvim('command', 'enew | call termopen('..command..')')
+ nvim('command', 'enew')
+ nvim('call_function', 'termopen', {command, env and {env = env} or nil})
nvim('input', '<CR>')
local vim_errmsg = nvim('eval', 'v:errmsg')
if vim_errmsg and "" ~= vim_errmsg then
@@ -95,7 +97,7 @@ local function screen_setup(extra_rows, command, cols, opts)
-- tty-test puts the terminal into raw mode and echoes input. Tests work by
-- feeding termcodes to control the display and asserting by screen:expect.
- if command == default_command and opts == nil then
+ if command == default_command and screen_opts == nil then
-- Wait for "tty ready" to be printed before each test or the terminal may
-- still be in canonical mode (will echo characters for example).
local empty_line = (' '):rep(cols)
@@ -122,6 +124,18 @@ local function screen_setup(extra_rows, command, cols, opts)
return screen
end
+local function setup_child_nvim(args, opts)
+ opts = opts or {}
+ local argv = { nvim_prog, unpack(args) }
+
+ local env = opts.env or {}
+ if not env.VIMRUNTIME then
+ env.VIMRUNTIME = os.getenv('VIMRUNTIME')
+ end
+
+ return screen_setup(0, argv, opts.cols, env)
+end
+
return {
feed_data = feed_data,
feed_termcode = feed_termcode,
@@ -141,5 +155,6 @@ return {
clear_attrs = clear_attrs,
enable_mouse = enable_mouse,
disable_mouse = disable_mouse,
- screen_setup = screen_setup
+ screen_setup = screen_setup,
+ setup_child_nvim = setup_child_nvim,
}
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua
index 2ac45771d4..7abf12c886 100644
--- a/test/functional/terminal/highlight_spec.lua
+++ b/test/functional/terminal/highlight_spec.lua
@@ -37,10 +37,7 @@ describe(':terminal highlight', function()
screen:expect([[
tty ready |
{10: } |
- |
- |
- |
- |
+ |*4
{5:-- TERMINAL --} |
]])
end)
@@ -64,10 +61,7 @@ describe(':terminal highlight', function()
screen:expect(sub([[
tty ready |
{NUM:text}text{10: } |
- |
- |
- |
- |
+ |*4
{5:-- TERMINAL --} |
]]))
end
@@ -143,10 +137,14 @@ it(':terminal highlight has lower precedence than editor #9964', function()
screen:attach({rgb=true})
-- Child nvim process in :terminal (with cterm colors).
funcs.termopen({
- nvim_prog_abs(), '-n', '-u', 'NORC', '-i', 'NONE', '--cmd', nvim_set,
+ nvim_prog_abs(), '-n', '-u', 'NORC', '-i', 'NONE', '--cmd', nvim_set .. ' notermguicolors',
'+hi Normal ctermfg=Blue ctermbg=Yellow',
'+norm! ichild nvim',
'+norm! oline 2',
+ }, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
})
screen:expect([[
{N_child:^child nvim }|
@@ -190,10 +188,7 @@ describe(':terminal highlight forwarding', function()
screen:expect([[
tty ready |
{1: } |
- |
- |
- |
- |
+ |*4
{2:-- TERMINAL --} |
]])
end)
@@ -209,10 +204,7 @@ describe(':terminal highlight forwarding', function()
screen:expect{grid=[[
tty ready |
{3:text}{4:color}text{1: } |
- |
- |
- |
- |
+ |*4
{2:-- TERMINAL --} |
]]}
end)
@@ -242,10 +234,7 @@ describe(':terminal highlight with custom palette', function()
screen:expect([[
tty ready |
{7: } |
- |
- |
- |
- |
+ |*4
{9:-- TERMINAL --} |
]])
end)
@@ -259,10 +248,7 @@ describe(':terminal highlight with custom palette', function()
screen:expect([[
tty ready |
{1:text}text{7: } |
- |
- |
- |
- |
+ |*4
{9:-- TERMINAL --} |
]])
end)
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua
index d687dff230..d2c636b03f 100644
--- a/test/functional/terminal/scrollback_spec.lua
+++ b/test/functional/terminal/scrollback_spec.lua
@@ -362,11 +362,7 @@ describe(':terminal prints more lines than the screen height and exits', functio
-- closes the buffer correctly after pressing a key
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
|
]])
end)
@@ -392,9 +388,9 @@ describe("'scrollback' option", function()
it('set to 0 behaves as 1', function()
local screen
if is_os('win') then
- screen = thelpers.screen_setup(nil, "['cmd.exe']", 30)
+ screen = thelpers.screen_setup(nil, { 'cmd.exe' }, 30)
else
- screen = thelpers.screen_setup(nil, "['sh']", 30)
+ screen = thelpers.screen_setup(nil, { 'sh' }, 30)
end
meths.set_option_value('scrollback', 0, {})
@@ -407,10 +403,10 @@ describe("'scrollback' option", function()
local screen
if is_os('win') then
command([[let $PROMPT='$$']])
- screen = thelpers.screen_setup(nil, "['cmd.exe']", 30)
+ screen = thelpers.screen_setup(nil, { 'cmd.exe' }, 30)
else
command('let $PS1 = "$"')
- screen = thelpers.screen_setup(nil, "['sh']", 30)
+ screen = thelpers.screen_setup(nil, { 'sh' }, 30)
end
meths.set_option_value('scrollback', 200, {})
@@ -614,10 +610,7 @@ describe("pending scrollback line handling", function()
or {'printf', ('hi\n'):rep(12)}
)
screen:expect [[
- hi |
- hi |
- hi |
- hi |
+ hi |*4
|
[Process exited 0]{2: } |
{3:-- TERMINAL --} |
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index e0216a22a7..a4e3c1d199 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -24,6 +24,7 @@ local funcs = helpers.funcs
local meths = helpers.meths
local is_ci = helpers.is_ci
local is_os = helpers.is_os
+local is_arch = helpers.is_arch
local new_pipename = helpers.new_pipename
local spawn_argv = helpers.spawn_argv
local set_session = helpers.set_session
@@ -39,18 +40,16 @@ describe('TUI', function()
before_each(function()
clear()
local child_server = new_pipename()
- screen = thelpers.screen_setup(0,
- string.format(
- [=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark", "--cmd", "colorscheme vim"]]=],
- nvim_prog,
- child_server,
- nvim_set
- ))
+ screen = thelpers.setup_child_nvim({
+ '--listen', child_server,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', nvim_set .. ' notermguicolors laststatus=2 background=dark',
+ '--cmd', 'colorscheme vim'
+ })
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -138,8 +137,7 @@ describe('TUI', function()
{8:FAIL 0} |
{8:FAIL 1} |
{8:FAIL 2} |
- |
- |
+ |*2
{10:-- More --}{1: } |
{3:-- TERMINAL --} |
]]}
@@ -204,12 +202,7 @@ describe('TUI', function()
feed_data('\003')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*6
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -272,9 +265,7 @@ describe('TUI', function()
feed_data('i\022\027j')
screen:expect([[
<M-j>{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -290,9 +281,7 @@ describe('TUI', function()
feed_data('\027[27u;')
screen:expect([[
ESCsemicolo{1:n} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -306,9 +295,7 @@ describe('TUI', function()
feed_data('i\022\027\000')
screen:expect([[
<M-C-Space>{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -324,9 +311,7 @@ describe('TUI', function()
attrs[11] = {foreground = 81}
screen:expect([[
{11:^G^V^M}{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -653,9 +638,7 @@ describe('TUI', function()
end
screen:expect([[
{1:p}opup menu test |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
:let g:menustr = 'bar' |
{3:-- TERMINAL --} |
@@ -673,8 +656,7 @@ describe('TUI', function()
end
screen:expect([[
{1:p}opup menu test |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{4:~ }{13: foo }{4: }|
{5:[No Name] [+] }{13: bar }{5: }|
:let g:menustr = 'bar' {13: baz } |
@@ -687,8 +669,7 @@ describe('TUI', function()
end
screen:expect([[
{1:p}opup menu test |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{4:~ }{13: foo }{4: }|
{5:[No Name] [+] }{13: bar }{5: }|
:let g:menustr = 'bar' {14: baz } |
@@ -701,9 +682,7 @@ describe('TUI', function()
end
screen:expect([[
{1:p}opup menu test |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
:let g:menustr = 'baz' |
{3:-- TERMINAL --} |
@@ -742,8 +721,7 @@ describe('TUI', function()
screen:expect([[
0123456789./*-+ |
={1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -752,8 +730,7 @@ describe('TUI', function()
screen:expect([[
0123456789./*-+ |
{1:=} |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -762,8 +739,7 @@ describe('TUI', function()
screen:expect([[
0123456789./*-+ |
={1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -772,8 +748,7 @@ describe('TUI', function()
screen:expect([[
0{1:1}23456789./*-+ |
= |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -782,8 +757,7 @@ describe('TUI', function()
screen:expect([[
0123456789./*-+ |
={1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -792,8 +766,7 @@ describe('TUI', function()
screen:expect([[
0123456789./*-+ |
={1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- REPLACE --} |
{3:-- TERMINAL --} |
@@ -802,8 +775,7 @@ describe('TUI', function()
screen:expect([[
0123456789./*-+ |
{1:=} |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -812,8 +784,7 @@ describe('TUI', function()
screen:expect([[
{1:0}123456789./*-+ |
= |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -822,8 +793,7 @@ describe('TUI', function()
screen:expect([[
0123456789{1:.}/*-+ |
= |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -832,8 +802,7 @@ describe('TUI', function()
screen:expect([[
0123456789{1:/}*-+ |
= |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -842,8 +811,7 @@ describe('TUI', function()
screen:expect([[
{1:0}123456789/*-+ |
= |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -852,8 +820,7 @@ describe('TUI', function()
screen:expect([[
0123456789/*-{1:+} |
= |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -866,8 +833,7 @@ describe('TUI', function()
screen:expect([[
{12: + [No Name] + [No Name] }{3: [No Name] }{1: }{12:X}|
{1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -886,8 +852,7 @@ describe('TUI', function()
screen:expect([[
{12: + [No Name] + [No Name] }{3: [No Name] }{1: }{12:X}|
{1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -908,8 +873,7 @@ describe('TUI', function()
screen:expect([[
<D-j><T-k><T-D-CR><M-T-C-S-D-BS> |
<D-F13><T-F14><T-D-F15><M-T-C-S-D-F16>{1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -921,9 +885,7 @@ describe('TUI', function()
feed_data('i""\027i\027[200~')
screen:expect([[
"{1:"} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -932,9 +894,7 @@ describe('TUI', function()
expect_child_buf_lines({'"pasted from terminal"'})
screen:expect([[
"pasted from terminal{1:"} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -944,9 +904,7 @@ describe('TUI', function()
wait_for_mode('n')
screen:expect([[
"pasted from termina{1:l}" |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -957,8 +915,7 @@ describe('TUI', function()
screen:expect([[
"pasted from terminapasted from terminalpasted fro|
m termina{1:l}l" |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -993,8 +950,7 @@ describe('TUI', function()
screen:expect{grid=[[
thisjust paste it{1:™}3 is here |
|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -1025,11 +981,9 @@ describe('TUI', function()
screen:expect{grid=[[
tty ready |
{1: } |
- |
- |
+ |*2
{5:^^^^^^^ }|
- {3:-- TERMINAL --} |
- {3:-- TERMINAL --} |
+ {3:-- TERMINAL --} |*2
]]}
feed_data('\027[200~')
feed_data('hallo')
@@ -1037,11 +991,9 @@ describe('TUI', function()
screen:expect{grid=[[
tty ready |
hallo{1: } |
- |
- |
+ |*2
{5:^^^^^^^ }|
- {3:-- TERMINAL --} |
- {3:-- TERMINAL --} |
+ {3:-- TERMINAL --} |*2
]]}
end)
@@ -1111,8 +1063,7 @@ describe('TUI', function()
screen:expect{grid=[[
foo |
|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
:"line 1{1:"} |
{3:-- TERMINAL --} |
@@ -1122,8 +1073,7 @@ describe('TUI', function()
wait_for_mode('n')
feed_data('.')
screen:expect{grid=[[
- foo |
- foo |
+ foo |*2
{1: } |
{4:~ }|
{5:[No Name] [+] }|
@@ -1169,8 +1119,7 @@ describe('TUI', function()
screen:expect{grid=[[
foo |
{1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -1197,8 +1146,7 @@ describe('TUI', function()
--Dot-repeat/redo is not modified by failed paste.
feed_data('.')
screen:expect{grid=[[
- foo |
- foo |
+ foo |*2
{1: } |
{4:~ }|
{5:[No Name] [+] }|
@@ -1208,8 +1156,7 @@ describe('TUI', function()
-- Editor should still work after failed/drained paste.
feed_data('ityped input...\027[27u')
screen:expect{grid=[[
- foo |
- foo |
+ foo |*2
typed input..{1:.} |
{4:~ }|
{5:[No Name] [+] }|
@@ -1286,8 +1233,7 @@ describe('TUI', function()
screen:expect([[
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz|
zzzzzzzzzzzzzz end{1: } |
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1303,9 +1249,7 @@ describe('TUI', function()
feed_data('\027[200~'..expected..'\027[201~')
screen:expect{grid=[[
|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
:<{1: } |
{3:-- TERMINAL --} |
@@ -1387,9 +1331,7 @@ describe('TUI', function()
feed_data('\027[201~')
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1400,9 +1342,7 @@ describe('TUI', function()
feed_data('i')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1412,9 +1352,7 @@ describe('TUI', function()
feed_data('00~pasted from terminal\027[201~')
screen:expect([[
pasted from terminal{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1425,9 +1363,7 @@ describe('TUI', function()
feed_data('i')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1437,9 +1373,7 @@ describe('TUI', function()
feed_data('1~')
screen:expect([[
pasted from terminal{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1459,9 +1393,7 @@ describe('TUI', function()
feed_data('i')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1469,9 +1401,7 @@ describe('TUI', function()
feed_data('\027[200~pasted') -- phase 1
screen:expect([[
pasted{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1479,9 +1409,7 @@ describe('TUI', function()
feed_data(' from terminal') -- phase 2
screen:expect([[
pasted from terminal{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1515,9 +1443,7 @@ describe('TUI', function()
feed_data(':set termguicolors?\n')
screen:expect([[
{5:^}{6:G} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
{3:[No Name] [+] }|
notermguicolors |
{4:-- TERMINAL --} |
@@ -1526,9 +1452,7 @@ describe('TUI', function()
feed_data(':set termguicolors\n')
screen:expect([[
{7:^}{8:G} |
- {9:~}{10: }|
- {9:~}{10: }|
- {9:~}{10: }|
+ {9:~}{10: }|*3
{3:[No Name] [+] }|
:set termguicolors |
{4:-- TERMINAL --} |
@@ -1537,9 +1461,7 @@ describe('TUI', function()
feed_data(':set notermguicolors\n')
screen:expect([[
{5:^}{6:G} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
{3:[No Name] [+] }|
:set notermguicolors |
{4:-- TERMINAL --} |
@@ -1564,9 +1486,7 @@ describe('TUI', function()
child_exec_lua('vim.cmd.terminal(...)', testprg('tty-test'))
screen:expect{grid=[[
{1:t}ty ready |
- |
- |
- |
+ |*3
{2:^^^^^^^ }|
|
{3:-- TERMINAL --} |
@@ -1575,8 +1495,7 @@ describe('TUI', function()
screen:expect{grid=[[
{1:t}ty ready |
{4:text}{5:color}text |
- |
- |
+ |*2
{2:^^^^^^^ }|
|
{3:-- TERMINAL --} |
@@ -1586,8 +1505,7 @@ describe('TUI', function()
screen:expect{grid=[[
{1:t}ty ready |
{4:text}colortext |
- |
- |
+ |*2
{2:^^^^^^^ }|
:set notermguicolors |
{3:-- TERMINAL --} |
@@ -1672,9 +1590,9 @@ describe('TUI', function()
screen:expect({any = 'Nvim'})
-- Going to top-left corner needs 3 bytes.
-- Setting underline attribute needs 9 bytes.
- -- The whole line needs 3 + 9 + 65515 + 3 = 65530 bytes.
+ -- The whole line needs 3 + 9 + 65513 + 3 = 65528 bytes.
-- The cursor_address that comes after will overflow the 65535-byte buffer.
- local line = ('a'):rep(65515) .. '℃'
+ local line = ('a'):rep(65513) .. '℃'
child_session:notify('nvim_exec_lua', [[
vim.api.nvim_buf_set_lines(0, 0, -1, true, {...})
vim.o.cursorline = true
@@ -1684,7 +1602,7 @@ describe('TUI', function()
screen:expect(
'{13:a}{12:' .. ('a'):rep(76) .. '}|\n'
.. ('{12:' .. ('a'):rep(77) .. '}|\n'):rep(849)
- .. '{12:' .. ('a'):rep(65) .. '℃' .. (' '):rep(11) .. '}|\n' .. dedent([[
+ .. '{12:' .. ('a'):rep(63) .. '℃' .. (' '):rep(13) .. '}|\n' .. dedent([[
b |
{5:[No Name] [+] }|
|
@@ -1695,9 +1613,7 @@ describe('TUI', function()
feed_data ':set visualbell\n'
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
:set visualbell |
{3:-- TERMINAL --} |
@@ -1709,9 +1625,7 @@ describe('TUI', function()
feed_data 'i'
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -1722,11 +1636,9 @@ describe('TUI', function()
exec_lua([[vim.uv.kill(vim.fn.jobpid(vim.bo.channel), 'sigterm')]])
screen:expect{grid=[[
Vim: Caught deadly signal 'SIGTERM' |
- |
- |
+ |*2
[Process exited 1]{1: } |
- |
- |
+ |*2
{3:-- TERMINAL --} |
]]}
end)
@@ -1748,9 +1660,7 @@ describe('TUI', function()
})
screen:expect([[
{1: } |
- {2:~}{3: }|
- {2:~}{3: }|
- {2:~}{3: }|
+ {2:~}{3: }|*3
{4:[No Name] }|
|
{5:-- TERMINAL --} |
@@ -1758,9 +1668,7 @@ describe('TUI', function()
feed_data('i')
screen:expect([[
{1: } |
- {2:~}{3: }|
- {2:~}{3: }|
- {2:~}{3: }|
+ {2:~}{3: }|*3
{4:[No Name] }|
{5:-- INSERT --} |
{5:-- TERMINAL --} |
@@ -1771,9 +1679,7 @@ describe('TUI', function()
child_session:request('nvim_echo', {{'foo'}}, false, {})
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
foo |
{3:-- TERMINAL --} |
@@ -1781,9 +1687,7 @@ describe('TUI', function()
exec_lua([[vim.uv.kill(vim.fn.jobpid(vim.bo.channel), 'sigwinch')]])
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -1796,9 +1700,7 @@ describe('TUI', function()
feed_data(':call jobwait([g:id])\n')
screen:expect([[
|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
:call jobwait([g:id]) |
{3:-- TERMINAL --} |
@@ -1806,14 +1708,42 @@ describe('TUI', function()
feed_data('\003')
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
Type :qa and press <Enter> to exit Nvim |
{3:-- TERMINAL --} |
]])
end)
+
+ it('cursor is not hidden on incsearch with no match', function()
+ feed_data('ifoo\027')
+ feed_data('/foo')
+ screen:expect([[
+ {1:foo} |
+ {4:~ }|*3
+ {5:[No Name] [+] }|
+ /foo{1: } |
+ {3:-- TERMINAL --} |
+ ]])
+ screen:sleep(10)
+ feed_data('b')
+ screen:expect([[
+ foo |
+ {4:~ }|*3
+ {5:[No Name] [+] }|
+ /foob{1: } |
+ {3:-- TERMINAL --} |
+ ]])
+ screen:sleep(10)
+ feed_data('a')
+ screen:expect([[
+ foo |
+ {4:~ }|*3
+ {5:[No Name] [+] }|
+ /fooba{1: } |
+ {3:-- TERMINAL --} |
+ ]])
+ end)
end)
describe('TUI', function()
@@ -1829,18 +1759,24 @@ describe('TUI', function()
[5] = {bold = true, reverse = true},
})
screen:attach()
+ funcs.termopen({
+ nvim_prog,
+ '--clean',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'set notermguicolors',
+ '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile',
+ }, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
exec([[
- call termopen([v:progpath, '--clean', '--cmd', 'colorscheme vim', '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile'])
sleep 500m
vs new
]])
screen:expect([[
^ │ |
- {2:~ }│{4:~ }|
- {2:~ }│{4:~ }|
- {2:~ }│{4:~ }|
- {2:~ }│{4:~ }|
- {2:~ }│{4:~ }|
+ {2:~ }│{4:~ }|*5
{2:~ }│{5:[No Name] 0,0-1 All}|
{2:~ }│ |
{5:new }{1:{MATCH:<.*[/\]nvim }}|
@@ -1849,6 +1785,9 @@ describe('TUI', function()
end)
it('argv[0] can be overridden #23953', function()
+ if is_arch('aarch64') then
+ pending('execl does not work on aarch64')
+ end
if not exec_lua('return pcall(require, "ffi")') then
pending('missing LuaJIT FFI')
end
@@ -1856,30 +1795,27 @@ describe('TUI', function()
write_file(script_file, [=[
local ffi = require('ffi')
ffi.cdef([[int execl(const char *, const char *, ...);]])
- ffi.C.execl(vim.v.progpath, 'Xargv0nvim', '--clean', '--cmd', 'colorscheme vim')
+ ffi.C.execl(vim.v.progpath, 'Xargv0nvim', '--clean')
]=])
finally(function()
os.remove(script_file)
end)
- local screen = thelpers.screen_setup(0, string.format([=[["%s", "--clean", "-l", "%s"]]=],
- nvim_prog, script_file))
+ local screen = thelpers.setup_child_nvim({'--clean', '-l', script_file})
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {5:[No Name] 0,0-1 All}|
+ ~ |*3
+ [No Name] 0,0-1 All|
|
{3:-- TERMINAL --} |
]]}
feed_data(':put =v:argv + [v:progname]\n')
screen:expect{grid=[[
+ Xargv0nvim |
+ --embed |
--clean |
- --cmd |
- colorscheme vim |
{1:X}argv0nvim |
- {5:[No Name] [+] 7,1 Bot}|
- 6 more lines |
+ [No Name] [+] 5,1 Bot|
+ 4 more lines |
{3:-- TERMINAL --} |
]]}
end)
@@ -1888,8 +1824,9 @@ describe('TUI', function()
finally(function()
os.remove('testF')
end)
- local screen = thelpers.screen_setup(0, '"'..nvim_prog
- ..' -u NONE -i NONE --cmd \'set noswapfile noshowcmd noruler\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"')
+ local screen = thelpers.screen_setup(0,
+ ('"%s" -u NONE -i NONE --cmd "set noswapfile noshowcmd noruler" --cmd "normal iabc" > /dev/null 2>&1 && cat testF && rm testF'):format(nvim_prog),
+ nil, { VIMRUNTIME = os.getenv('VIMRUNTIME') })
feed_data(':w testF\n:q\n')
screen:expect([[
:w testF |
@@ -1903,16 +1840,16 @@ describe('TUI', function()
end)
it('<C-h> #10134', function()
- local screen = thelpers.screen_setup(
- 0,
- '["'..nvim_prog..[[", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", ]]
- ..[["--cmd", "set noruler", "--cmd", ':nnoremap <C-h> :echomsg "\<C-h\>"<CR>']]..']'
- )
+ local screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'set noruler notermguicolors',
+ '--cmd', ':nnoremap <C-h> :echomsg "\\<C-h\\>"<CR>',
+ })
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -1921,9 +1858,7 @@ describe('TUI', function()
command([[call chansend(b:terminal_job_id, "\<C-h>")]])
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
<C-h> |
{3:-- TERMINAL --} |
@@ -1931,16 +1866,16 @@ describe('TUI', function()
end)
it('draws line with many trailing spaces correctly #24955', function()
- local screen = thelpers.screen_setup(
- 0,
- '["'..nvim_prog..[[", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim"]]
- ..[[, "--cmd", "call setline(1, ['1st line' .. repeat(' ', 153), '2nd line'])"]]..']',
- 80
- )
+ local screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'set notermguicolors',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'call setline(1, ["1st line" .. repeat(" ", 153), "2nd line"])',
+ }, { cols = 80 })
screen:expect{grid=[[
{1:1}st line |
- |
- |
+ |*2
2nd line |
{5:[No Name] [+] 1,1 All}|
|
@@ -1962,21 +1897,19 @@ end)
describe('TUI UIEnter/UILeave', function()
it('fires exactly once, after VimEnter', function()
clear()
- local screen = thelpers.screen_setup(0,
- '["'..nvim_prog..'", "-u", "NONE", "-i", "NONE"'
- ..[[, "--cmd", "colorscheme vim"]]
- ..[[, "--cmd", "set noswapfile noshowcmd noruler"]]
- ..[[, "--cmd", "let g:evs = []"]]
- ..[[, "--cmd", "autocmd UIEnter * :call add(g:evs, 'UIEnter')"]]
- ..[[, "--cmd", "autocmd UILeave * :call add(g:evs, 'UILeave')"]]
- ..[[, "--cmd", "autocmd VimEnter * :call add(g:evs, 'VimEnter')"]]
- ..']'
- )
+ local screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'set noswapfile noshowcmd noruler notermguicolors',
+ '--cmd', 'let g:evs = []',
+ '--cmd', 'autocmd UIEnter * :call add(g:evs, "UIEnter")',
+ '--cmd', 'autocmd UILeave * :call add(g:evs, "UILeave")',
+ '--cmd', 'autocmd VimEnter * :call add(g:evs, "VimEnter")',
+ })
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -1984,9 +1917,7 @@ describe('TUI UIEnter/UILeave', function()
feed_data(":echo g:evs\n")
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
['VimEnter', 'UIEnter'] |
{3:-- TERMINAL --} |
@@ -2001,16 +1932,17 @@ describe('TUI FocusGained/FocusLost', function()
before_each(function()
clear()
local child_server = new_pipename()
- screen = thelpers.screen_setup(0,
- string.format(
- '["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", '
- ..'"--cmd", "set noswapfile noshowcmd noruler"]',
- nvim_prog, child_server))
+ screen = thelpers.setup_child_nvim({
+ '--listen', child_server,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', 'set noswapfile noshowcmd noruler notermguicolors',
+ })
+
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -2028,9 +1960,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('\027[I')
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
gained |
{3:-- TERMINAL --} |
@@ -2039,9 +1969,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('\027[O')
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
lost |
{3:-- TERMINAL --} |
@@ -2054,9 +1982,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('i')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
:set noshowmode |
{3:-- TERMINAL --} |
@@ -2065,9 +1991,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('\027[I')
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
gained |
{3:-- TERMINAL --} |
@@ -2075,9 +1999,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('\027[O')
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
lost |
{3:-- TERMINAL --} |
@@ -2092,9 +2014,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('\027[I')
screen:expect([[
|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
:{1: } |
{3:-- TERMINAL --} |
@@ -2102,9 +2022,7 @@ describe('TUI FocusGained/FocusLost', function()
feed_data('\027[O')
screen:expect{grid=[[
|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
:{1: } |
{3:-- TERMINAL --} |
@@ -2145,8 +2063,7 @@ describe('TUI FocusGained/FocusLost', function()
{1:r}eady $ zia |
|
[Process exited 0] |
- |
- |
+ |*2
:terminal zia |
{3:-- TERMINAL --} |
]]}
@@ -2156,8 +2073,7 @@ describe('TUI FocusGained/FocusLost', function()
{1:r}eady $ zia |
|
[Process exited 0] |
- |
- |
+ |*2
gained |
{3:-- TERMINAL --} |
]], timeout=(4 * screen.timeout)}
@@ -2167,8 +2083,7 @@ describe('TUI FocusGained/FocusLost', function()
{1:r}eady $ zia |
|
[Process exited 0] |
- |
- |
+ |*2
lost |
{3:-- TERMINAL --} |
]])
@@ -2208,14 +2123,18 @@ describe("TUI 't_Co' (terminal colors)", function()
local function assert_term_colors(term, colorterm, maxcolors)
clear({env={TERM=term}, args={}})
- -- This is ugly because :term/termopen() forces TERM=xterm-256color.
- -- TODO: Revisit this after jobstart/termopen accept `env` dict.
- screen = thelpers.screen_setup(0, string.format(
- [=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "colorscheme vim" --cmd "%s"']]=],
- term or "",
- (colorterm ~= nil and "COLORTERM="..colorterm or ""),
- nvim_prog,
- nvim_set))
+ screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', nvim_set .. ' notermguicolors',
+ }, {
+ env = {
+ LANG = 'C',
+ TERM = term or '',
+ COLORTERM = colorterm or '',
+ },
+ })
local tline
if maxcolors == 8 then
@@ -2228,24 +2147,18 @@ describe("TUI 't_Co' (terminal colors)", function()
screen:expect(string.format([[
{1: } |
- %s|
- %s|
- %s|
- %s|
+ %s|*4
|
{3:-- TERMINAL --} |
- ]], tline, tline, tline, tline))
+ ]], tline))
feed_data(":echo &t_Co\n")
screen:expect(string.format([[
{1: } |
- %s|
- %s|
- %s|
- %s|
+ %s|*4
%-3s |
{3:-- TERMINAL --} |
- ]], tline, tline, tline, tline, tostring(maxcolors and maxcolors or "")))
+ ]], tline, tostring(maxcolors and maxcolors or "")))
end
-- ansi and no terminal type at all:
@@ -2483,14 +2396,16 @@ describe("TUI 'term' option", function()
local function assert_term(term_envvar, term_expected)
clear()
- -- This is ugly because :term/termopen() forces TERM=xterm-256color.
- -- TODO: Revisit this after jobstart/termopen accept `env` dict.
- local cmd = string.format(
- [=[['sh', '-c', 'LANG=C TERM=%s %s -u NONE -i NONE --cmd "%s"']]=],
- term_envvar or "",
- nvim_prog,
- nvim_set)
- screen = thelpers.screen_setup(0, cmd)
+ screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', nvim_set .. ' notermguicolors',
+ }, {
+ env = {
+ LANG = 'C',
+ TERM = term_envvar or '',
+ },
+ })
local full_timeout = screen.timeout
screen.timeout = 250 -- We want screen:expect() to fail quickly.
@@ -2540,14 +2455,17 @@ describe("TUI", function()
-- Runs (child) `nvim` in a TTY (:terminal), to start the builtin TUI.
local function nvim_tui(extra_args)
clear()
- -- This is ugly because :term/termopen() forces TERM=xterm-256color.
- -- TODO: Revisit this after jobstart/termopen accept `env` dict.
- local cmd = string.format(
- [=[['sh', '-c', 'LANG=C %s -u NONE -i NONE %s --cmd "colorscheme vim" --cmd "%s"']]=],
- nvim_prog,
- extra_args or "",
- nvim_set)
- screen = thelpers.screen_setup(0, cmd)
+ screen = thelpers.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', nvim_set .. ' notermguicolors',
+ extra_args,
+ }, {
+ env = {
+ LANG = 'C',
+ },
+ })
end
it('-V3log logs terminfo values', function()
@@ -2557,10 +2475,7 @@ describe("TUI", function()
feed_data('Gitext')
screen:expect([[
text{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
{3:-- INSERT --} |
{3:-- TERMINAL --} |
]])
@@ -2577,10 +2492,7 @@ describe("TUI", function()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
|
{3:-- TERMINAL --} |
]])
@@ -2589,25 +2501,30 @@ describe("TUI", function()
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
|
{3:-- TERMINAL --} |
]], unchanged=true}
end)
end)
--- See test/unit/tui_spec.lua for unit tests.
describe('TUI bg color', function()
local screen
local function setup_bg_test()
clear()
- screen = thelpers.screen_setup(0, '["'..nvim_prog
- ..'", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "set noswapfile", '
- ..'"-c", "autocmd OptionSet background echo \\"did OptionSet, yay!\\""]')
+ screen = thelpers.setup_child_nvim({
+ '-u',
+ 'NONE',
+ '-i',
+ 'NONE',
+ '--cmd',
+ 'colorscheme vim',
+ '--cmd',
+ 'set noswapfile notermguicolors',
+ '-c',
+ 'autocmd OptionSet background echo "did OptionSet, yay!"',
+ })
end
before_each(setup_bg_test)
@@ -2615,9 +2532,7 @@ describe('TUI bg color', function()
it('triggers OptionSet event on unsplit terminal-response', function()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,0-1 All}|
|
{3:-- TERMINAL --} |
@@ -2631,9 +2546,7 @@ describe('TUI bg color', function()
setup_bg_test()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,0-1 All}|
|
{3:-- TERMINAL --} |
@@ -2648,9 +2561,7 @@ describe('TUI bg color', function()
it('triggers OptionSet event with split terminal-response', function()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,0-1 All}|
|
{3:-- TERMINAL --} |
@@ -2666,9 +2577,7 @@ describe('TUI bg color', function()
setup_bg_test()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,0-1 All}|
|
{3:-- TERMINAL --} |
@@ -2685,9 +2594,7 @@ describe('TUI bg color', function()
it('not triggers OptionSet event with invalid terminal-response', function()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,0-1 All}|
|
{3:-- TERMINAL --} |
@@ -2701,9 +2608,7 @@ describe('TUI bg color', function()
setup_bg_test()
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] 0,0-1 All}|
|
{3:-- TERMINAL --} |
@@ -2726,21 +2631,18 @@ describe("TUI as a client", function()
set_session(server_super)
local server_pipe = new_pipename()
- local screen_server = thelpers.screen_setup(0,
- string.format(
- '["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", '
- ..'"--cmd", "%s laststatus=2 background=dark"]',
- nvim_prog,
- server_pipe,
- nvim_set
- ))
+ local screen_server = thelpers.setup_child_nvim({
+ '--listen', server_pipe,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', nvim_set .. ' notermguicolors laststatus=2 background=dark',
+ })
feed_data("iHello, World")
screen_server:expect{grid=[[
Hello, World{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -2748,24 +2650,21 @@ describe("TUI as a client", function()
feed_data("\027")
screen_server:expect{grid=[[
Hello, Worl{1:d} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
]]}
set_session(client_super)
- local screen_client = thelpers.screen_setup(0,
- string.format([=[["%s", "--server", "%s", "--remote-ui"]]=],
- nvim_prog, server_pipe))
+ local screen_client = thelpers.setup_child_nvim({
+ '--server', server_pipe,
+ '--remote-ui',
+ })
screen_client:expect{grid=[[
Hello, Worl{1:d} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -2777,10 +2676,7 @@ describe("TUI as a client", function()
screen_server:expect{grid=[[
{1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{5:[No Name] [+] }|
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]]}
@@ -2797,18 +2693,17 @@ describe("TUI as a client", function()
set_session(server)
local server_pipe = meths.get_vvar('servername')
server:request('nvim_input', 'iHalloj!<Esc>')
+ server:request('nvim_command', 'set notermguicolors')
set_session(client_super)
- local screen_client = thelpers.screen_setup(0,
- string.format([=[["%s", "--server", "%s", "--remote-ui"]]=],
- nvim_prog, server_pipe))
+ local screen_client = thelpers.setup_child_nvim({
+ '--server', server_pipe,
+ '--remote-ui',
+ })
screen_client:expect{grid=[[
Halloj{1:!} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
|
{3:-- TERMINAL --} |
]]}
@@ -2818,11 +2713,9 @@ describe("TUI as a client", function()
exec_lua([[vim.uv.kill(vim.fn.jobpid(vim.bo.channel), 'sigterm')]])
screen_client:expect{grid=[[
Vim: Caught deadly signal 'SIGTERM' |
- |
- |
+ |*2
[Process exited 1]{1: } |
- |
- |
+ |*2
{3:-- TERMINAL --} |
]]}
@@ -2837,17 +2730,16 @@ describe("TUI as a client", function()
it("throws error when no server exists", function()
clear()
- local screen = thelpers.screen_setup(0,
- string.format([=[["%s", "--server", "127.0.0.1:2436546", "--remote-ui"]]=],
- nvim_prog), 60)
+ local screen = thelpers.setup_child_nvim({
+ '--server', '127.0.0.1:2436546',
+ '--remote-ui',
+ }, { cols = 60 })
screen:expect([[
Remote ui failed to start: {MATCH:.*}|
|
[Process exited 1]{1: } |
- |
- |
- |
+ |*3
{3:-- TERMINAL --} |
]])
end)
@@ -2858,19 +2750,16 @@ describe("TUI as a client", function()
set_session(server_super)
local server_pipe = new_pipename()
- local screen_server = thelpers.screen_setup(0,
- string.format(
- '["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", '
- ..'"--cmd", "%s laststatus=2 background=dark"]',
- nvim_prog,
- server_pipe,
- nvim_set
- ))
+ local screen_server = thelpers.setup_child_nvim({
+ '--listen', server_pipe,
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', nvim_set .. ' notermguicolors laststatus=2 background=dark',
+ })
screen_server:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -2879,9 +2768,7 @@ describe("TUI as a client", function()
feed_data("iHello, World")
screen_server:expect{grid=[[
Hello, World{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
@@ -2889,24 +2776,21 @@ describe("TUI as a client", function()
feed_data("\027")
screen_server:expect{grid=[[
Hello, Worl{1:d} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
]]}
set_session(client_super)
- local screen_client = thelpers.screen_setup(0,
- string.format([=[["%s", "--server", "%s", "--remote-ui"]]=],
- nvim_prog, server_pipe))
+ local screen_client = thelpers.setup_child_nvim({
+ '--server', server_pipe,
+ '--remote-ui',
+ })
screen_client:expect{grid=[[
Hello, Worl{1:d} |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |
@@ -2919,20 +2803,14 @@ describe("TUI as a client", function()
screen_server:expect{grid=[[
|
[Process exited ]] .. status .. [[]{1: }{MATCH:%s+}|
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]]}
-- assert that client has exited
screen_client:expect{grid=[[
|
[Process exited ]] .. status .. [[]{1: }{MATCH:%s+}|
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]]}
diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua
index 39fc2c2562..1686160680 100644
--- a/test/functional/terminal/window_spec.lua
+++ b/test/functional/terminal/window_spec.lua
@@ -121,11 +121,7 @@ describe(':terminal window', function()
screen:expect([[
tty ready |
{2:^ } |
- |
- |
- |
- |
- |
+ |*5
]])
feed(':set colorcolumn=20<CR>i')
end)
@@ -134,10 +130,7 @@ describe(':terminal window', function()
screen:expect([[
tty ready |
{1: } |
- |
- |
- |
- |
+ |*4
{3:-- TERMINAL --} |
]])
end)
@@ -179,26 +172,18 @@ describe(':terminal with multigrid', function()
before_each(function()
clear()
- screen = thelpers.screen_setup(0,nil,50,{ext_multigrid=true})
+ screen = thelpers.screen_setup(0, nil, 50, nil, {ext_multigrid=true})
end)
it('resizes to requested size', function()
screen:expect([[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*6
[3:--------------------------------------------------]|
## grid 2
tty ready |
{1: } |
- |
- |
- |
- |
+ |*4
## grid 3
{3:-- TERMINAL --} |
]])
@@ -209,24 +194,13 @@ describe(':terminal with multigrid', function()
else
screen:expect([[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*6
[3:--------------------------------------------------]|
## grid 2
tty ready |
rows: 10, cols: 20 |
{1: } |
- |
- |
- |
- |
- |
- |
- |
+ |*7
## grid 3
{3:-- TERMINAL --} |
]])
@@ -238,12 +212,7 @@ describe(':terminal with multigrid', function()
else
screen:expect([[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*6
[3:--------------------------------------------------]|
## grid 2
rows: 10, cols: 20 |
@@ -260,12 +229,7 @@ describe(':terminal with multigrid', function()
else
screen:expect([[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*6
[3:--------------------------------------------------]|
## grid 2
tty ready |
diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua
index da14531fa2..f160dc6864 100644
--- a/test/functional/terminal/window_split_tab_spec.lua
+++ b/test/functional/terminal/window_split_tab_spec.lua
@@ -50,8 +50,7 @@ describe(':terminal', function()
tty ready |
rows: 5, cols: 50 |
{2: } |
- |
- |
+ |*2
========== |
:2split |
]])
@@ -63,8 +62,7 @@ describe(':terminal', function()
^tty ready |
rows: 5, cols: 50 |
{2: } |
- |
- |
+ |*2
========== |
:wincmd p |
]])
@@ -80,14 +78,7 @@ describe(':terminal', function()
screen:expect([[
tty ready |
^foo{2: } |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*8
]])
end)
@@ -112,9 +103,7 @@ describe(':terminal', function()
tty ready |
rows: 7, cols: 47 |
{2: } |
- |
- |
- |
+ |*3
^ |
|
]])
diff --git a/test/functional/treesitter/fold_spec.lua b/test/functional/treesitter/fold_spec.lua
index a8abbc002b..462661e97f 100644
--- a/test/functional/treesitter/fold_spec.lua
+++ b/test/functional/treesitter/fold_spec.lua
@@ -5,6 +5,7 @@ local insert = helpers.insert
local exec_lua = helpers.exec_lua
local command = helpers.command
local feed = helpers.feed
+local poke_eventloop = helpers.poke_eventloop
local Screen = require('test.functional.ui.screen')
before_each(clear)
@@ -12,6 +13,11 @@ before_each(clear)
describe('treesitter foldexpr', function()
clear()
+ before_each(function()
+ -- open folds to avoid deleting entire folded region
+ exec_lua([[vim.opt.foldlevel = 9]])
+ end)
+
local test_text = [[
void ui_refresh(void)
{
@@ -33,6 +39,10 @@ void ui_refresh(void)
}
}]]
+ local function parse(lang)
+ exec_lua(([[vim.treesitter.get_parser(0, %s):parse()]]):format(lang and '"' .. lang .. '"' or 'nil'))
+ end
+
local function get_fold_levels()
return exec_lua([[
local res = {}
@@ -46,7 +56,7 @@ void ui_refresh(void)
it("can compute fold levels", function()
insert(test_text)
- exec_lua([[vim.treesitter.get_parser(0, "c")]])
+ parse('c')
eq({
[1] = '>1',
@@ -67,16 +77,18 @@ void ui_refresh(void)
[16] = '3',
[17] = '3',
[18] = '2',
- [19] = '1' }, get_fold_levels())
+ [19] = '1',
+ }, get_fold_levels())
end)
it("recomputes fold levels after lines are added/removed", function()
insert(test_text)
- exec_lua([[vim.treesitter.get_parser(0, "c")]])
+ parse('c')
command('1,2d')
+ poke_eventloop()
eq({
[1] = '0',
@@ -95,9 +107,11 @@ void ui_refresh(void)
[14] = '2',
[15] = '2',
[16] = '1',
- [17] = '0' }, get_fold_levels())
+ [17] = '0',
+ }, get_fold_levels())
command('1put!')
+ poke_eventloop()
eq({
[1] = '>1',
@@ -118,7 +132,274 @@ void ui_refresh(void)
[16] = '3',
[17] = '3',
[18] = '2',
- [19] = '1' }, get_fold_levels())
+ [19] = '1',
+ }, get_fold_levels())
+ end)
+
+ it("handles changes close to start/end of folds", function()
+ insert([[
+# h1
+t1
+# h2
+t2]])
+
+ exec_lua([[vim.treesitter.query.set('markdown', 'folds', '(section) @fold')]])
+ parse('markdown')
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>1',
+ [4] = '1',
+ }, get_fold_levels())
+
+ feed('2ggo<Esc>')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '1',
+ [4] = '>1',
+ [5] = '1',
+ }, get_fold_levels())
+
+ feed('dd')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>1',
+ [4] = '1',
+ }, get_fold_levels())
+
+ feed('2ggdd')
+ poke_eventloop()
+
+ eq({
+ [1] = '0',
+ [2] = '>1',
+ [3] = '1',
+ }, get_fold_levels())
+
+ feed('u')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>1',
+ [4] = '1',
+ }, get_fold_levels())
+
+ feed('3ggdd')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '1',
+ }, get_fold_levels())
+
+ feed('u')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>1',
+ [4] = '1',
+ }, get_fold_levels())
+
+ feed('3ggI#<Esc>')
+ parse()
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>2',
+ [4] = '2',
+ }, get_fold_levels())
+
+ feed('x')
+ parse()
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>1',
+ [4] = '1',
+ }, get_fold_levels())
+
+ end)
+
+ it("handles changes that trigger multiple on_bytes", function()
+ insert([[
+function f()
+ asdf()
+ asdf()
+end
+-- comment]])
+
+ exec_lua([[vim.treesitter.query.set('lua', 'folds', '[(function_declaration) (parameters) (arguments)] @fold')]])
+ parse('lua')
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '1',
+ [4] = '1',
+ [5] = '0',
+ }, get_fold_levels())
+
+ command('1,4join')
+ poke_eventloop()
+
+ eq({
+ [1] = '0',
+ [2] = '0',
+ }, get_fold_levels())
+
+ feed('u')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '1',
+ [4] = '1',
+ [5] = '0',
+ }, get_fold_levels())
+
+ end)
+
+ it("handles multiple folds that overlap at the end and start", function()
+ insert([[
+function f()
+ g(
+ function()
+ asdf()
+ end, function()
+ end
+ )
+end]])
+
+ exec_lua([[vim.treesitter.query.set('lua', 'folds', '[(function_declaration) (function_definition) (parameters) (arguments)] @fold')]])
+ parse('lua')
+
+ -- If fold1.stop = fold2.start, then move fold1's stop up so that fold2.start gets proper level.
+ eq({
+ [1] = '>1',
+ [2] = '>2',
+ [3] = '>3',
+ [4] = '3',
+ [5] = '>3',
+ [6] = '3',
+ [7] = '2',
+ [8] = '1',
+ }, get_fold_levels())
+
+ command('1,8join')
+ feed('u')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '>2',
+ [3] = '>3',
+ [4] = '3',
+ [5] = '>3',
+ [6] = '3',
+ [7] = '2',
+ [8] = '1',
+ }, get_fold_levels())
+
+ end)
+
+ it("handles multiple folds that start at the same line", function()
+ insert([[
+function f(a)
+ if #(g({
+ k = v,
+ })) > 0 then
+ return
+ end
+end]])
+
+ exec_lua([[vim.treesitter.query.set('lua', 'folds', '[(if_statement) (function_declaration) (parameters) (arguments) (table_constructor)] @fold')]])
+ parse('lua')
+
+ eq({
+ [1] = '>1',
+ [2] = '>3',
+ [3] = '3',
+ [4] = '3',
+ [5] = '2',
+ [6] = '2',
+ [7] = '1',
+ }, get_fold_levels())
+
+ command('2,6join')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '1',
+ }, get_fold_levels())
+
+ feed('u')
+ poke_eventloop()
+
+ eq({
+ [1] = '>1',
+ [2] = '>3',
+ [3] = '3',
+ [4] = '3',
+ [5] = '2',
+ [6] = '2',
+ [7] = '1',
+ }, get_fold_levels())
+
+ end)
+
+ it("takes account of relevant options", function()
+ insert([[
+# h1
+t1
+## h2
+t2
+### h3
+t3]])
+
+ exec_lua([[vim.treesitter.query.set('markdown', 'folds', '(section) @fold')]])
+ parse('markdown')
+
+ command([[set foldminlines=2]])
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '>2',
+ [4] = '2',
+ [5] = '2',
+ [6] = '2',
+ }, get_fold_levels())
+
+ command([[set foldminlines=1 foldnestmax=1]])
+
+ eq({
+ [1] = '>1',
+ [2] = '1',
+ [3] = '1',
+ [4] = '1',
+ [5] = '1',
+ [6] = '1',
+ }, get_fold_levels())
+
end)
it("updates folds in all windows", function()
@@ -131,8 +412,8 @@ void ui_refresh(void)
[4] = {reverse = true};
})
- exec_lua([[vim.treesitter.get_parser(0, "c")]])
- command([[set foldmethod=expr foldexpr=v:lua.vim.treesitter.foldexpr() foldcolumn=1 foldlevel=9]])
+ parse("c")
+ command([[set foldmethod=expr foldexpr=v:lua.vim.treesitter.foldexpr() foldcolumn=1]])
command('split')
insert(test_text)
@@ -157,10 +438,7 @@ void ui_refresh(void)
{1:3} } |
{1:2} } |
{1:│}^} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*4
{3:[No Name] [+] }|
{1:-}void ui_refresh(void) |
{1:│}{ |
@@ -181,9 +459,7 @@ void ui_refresh(void)
{1:3} } |
{1:2} } |
{1:│}} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
{4:[No Name] [+] }|
|
]]}
@@ -208,12 +484,7 @@ void ui_refresh(void)
{1:2} } |
{1:│} } |
{1: }} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*6
{3:[No Name] [+] }|
{1: } int width = INT_MAX, height = INT_MAX; |
{1: } bool ext_widgets[kUIExtCount]; |
@@ -232,11 +503,7 @@ void ui_refresh(void)
{1:2} } |
{1:│} } |
{1: }} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
{4:[No Name] [+] }|
|
]]}
@@ -264,10 +531,7 @@ void ui_refresh(void)
{1:3} } |
{1:2} } |
{1:│}} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*4
{3:[No Name] [+] }|
{1:-}void ui_refresh(void) |
{1:│}{ |
@@ -288,9 +552,7 @@ void ui_refresh(void)
{1:3} } |
{1:2} } |
{1:│}} |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
{4:[No Name] [+] }|
|
]]}
@@ -301,7 +563,7 @@ void ui_refresh(void)
local screen = Screen.new(60, 36)
screen:attach()
- exec_lua([[vim.treesitter.get_parser(0, "c")]])
+ parse("c")
command([[set foldmethod=expr foldexpr=v:lua.vim.treesitter.foldexpr() foldcolumn=1 foldlevel=9]])
insert(test_text)
command('16d')
@@ -324,12 +586,7 @@ void ui_refresh(void)
{1: } } |
{1: } } |
{1: }} |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*6
{4:[No Name] [+] }|
{1:+ }{2:+-- 9 lines: void ui_refresh(void)·······················}|
{1: } for (size_t i = 0; i < ui_count; i++) { |
@@ -342,11 +599,7 @@ void ui_refresh(void)
{1: } ^} |
{1: } } |
{1: }} |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*5
{5:[No Name] [+] }|
|
]], attr_ids={
@@ -358,6 +611,58 @@ void ui_refresh(void)
}}
end)
+ it("doesn't open folds that are not touched", function()
+ local screen = Screen.new(40, 8)
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray};
+ [2] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray};
+ [3] = {foreground = Screen.colors.Blue1, bold = true};
+ [4] = {bold = true};
+ })
+ screen:attach()
+
+ insert([[
+# h1
+t1
+# h2
+t2]])
+ exec_lua([[vim.treesitter.query.set('markdown', 'folds', '(section) @fold')]])
+ parse('markdown')
+ command([[set foldmethod=expr foldexpr=v:lua.vim.treesitter.foldexpr() foldcolumn=1 foldlevel=0]])
+
+
+ feed('ggzojo')
+ poke_eventloop()
+
+ screen:expect{grid=[[
+ {1:-}# h1 |
+ {1:│}t1 |
+ {1:│}^ |
+ {1:+}{2:+-- 2 lines: # h2·····················}|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {4:-- INSERT --} |
+ ]]}
+
+ feed('<Esc>u')
+ -- TODO(tomtomjhj): `u` spuriously opens the fold (#26499).
+ feed('zMggzo')
+
+ feed('dd')
+ poke_eventloop()
+
+ screen:expect{grid=[[
+ {1:-}^t1 |
+ {1:-}# h2 |
+ {1:│}t2 |
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ 1 line less; before #2 {MATCH:.*}|
+ ]]}
+ end)
end)
describe('treesitter foldtext', function()
@@ -409,9 +714,7 @@ void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, con
feed('ggVGzf')
screen:expect{grid=[[
{2:^void}{1: }{3:qsort}{4:(}{2:void}{1: }{5:*}{3:base}{4:,}{1: }{2:size_t}{1: }{3:nel}{4:,}{1: }{2:size_t}{1: }{3:width}{4:,}{1: }{2:int}{1: }{4:(}{5:*}{3:compa}|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]}
end)
@@ -465,9 +768,7 @@ end]])
feed('ggVGzf')
screen:expect{grid=[[
{1:^+-- 19 lines: void qsort(void *base, size_t nel, size_t widt}|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]}
end)
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua
index e037c9e215..01f92de0d6 100644
--- a/test/functional/treesitter/highlight_spec.lua
+++ b/test/functional/treesitter/highlight_spec.lua
@@ -100,17 +100,7 @@ local injection_grid_c = [[
return 42; \ |
} |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
|
]]
@@ -121,17 +111,7 @@ local injection_grid_expected_c = [[
{4:return} {5:42}; \ |
} |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
|
]]
@@ -178,8 +158,7 @@ describe('treesitter highlighting (C)', function()
1, (void *)(ptrdiff_t)cb); |
return 0; |
^} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -204,8 +183,7 @@ describe('treesitter highlighting (C)', function()
{5:1}, ({3:void} *)({3:ptrdiff_t})cb); |
{4:return} {5:0}; |
^} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -227,8 +205,7 @@ describe('treesitter highlighting (C)', function()
{5:1}, ({3:void} *)({3:ptrdiff_t})cb); |
{4:return} {5:0}; |
} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -366,8 +343,7 @@ describe('treesitter highlighting (C)', function()
{4:for} ({3:UIExtension} i = {5:0}; ({3:int})i < kUIExtCount; i++) { |
{4:for} ({3:size_t} i = {5:0}; i < ui_count; i++) { |
{3:int} width = {5:INT_MAX}, height = {5:INT_MAX}; |
- } |
- } |
+ } |*2
{3:void} ui_refresh({3:void}) |
:sort |
]]}
@@ -517,17 +493,7 @@ describe('treesitter highlighting (C)', function()
{4:return} {5:42}; \ |
} |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
|
]]}
end)
@@ -556,8 +522,7 @@ describe('treesitter highlighting (C)', function()
{5:1}, ({3:void} *)({3:ptrdiff_t})cb); |
{4:return} {5:0}; |
^} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -580,8 +545,7 @@ describe('treesitter highlighting (C)', function()
{5:1}, ({3:void} *)({3:ptrdiff_t})cb); |
{4:return} {5:0}; |
^} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
screen:expect{ unchanged=true }
@@ -608,17 +572,7 @@ describe('treesitter highlighting (C)', function()
{8: }{12:return}{8: 42; \} |
{8: }} |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
|
]], attr_ids={
[1] = {bold = true, foreground = Screen.colors.Blue1};
@@ -641,21 +595,7 @@ describe('treesitter highlighting (C)', function()
screen:expect{grid=[[
char* x = "Will somebody ever read this?"; |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*15
|
]]}
@@ -672,21 +612,7 @@ describe('treesitter highlighting (C)', function()
screen:expect{grid=[[
{3:char}* x = {5:"Will somebody ever read this?"}; |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*15
|
]]}
@@ -695,21 +621,7 @@ describe('treesitter highlighting (C)', function()
screen:expect{grid=[[
{5:char}* x = {5:"Will somebody ever read this?"}; |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*15
|
]]}
end)
@@ -747,8 +659,7 @@ describe('treesitter highlighting (C)', function()
1, (void *)(ptrdiff_t)cb); |
return 0; |
^} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index 81e514c9aa..f7b8144ff9 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -51,11 +51,7 @@ describe('Buffer highlighting', function()
screen:expect([[
these are some lines |
with colorful tex^t |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -65,11 +61,7 @@ describe('Buffer highlighting', function()
screen:expect([[
these are {2:some} lines |
with {3:colorful tex^t} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -78,10 +70,7 @@ describe('Buffer highlighting', function()
these are {2:some} lines |
^ |
with {3:colorful text} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
@@ -90,10 +79,7 @@ describe('Buffer highlighting', function()
these are some lines |
^ |
with colorful text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
@@ -129,9 +115,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -143,9 +127,7 @@ describe('Buffer highlighting', function()
in {6:order} to de{4:monstr}ate |
combin{9:ing hi}ghlights |
{9:from diff}erent source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -157,9 +139,7 @@ describe('Buffer highlighting', function()
in {6:order} to de{4:monstr}ate |
combin{9:ing hi}ghlights |
{9:from diff}erent source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -171,9 +151,7 @@ describe('Buffer highlighting', function()
in order to {7:demonstrate} |
{7:combining} highlights |
from {7:different} source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -187,9 +165,7 @@ describe('Buffer highlighting', function()
in {6:order} to de{4:monstr}ate |
{7:combining} highlights |
from {7:different} source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -201,9 +177,7 @@ describe('Buffer highlighting', function()
^ |
in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
@@ -216,9 +190,7 @@ describe('Buffer highlighting', function()
|
{8:from different sources} |
{8:^in }{20:order}{8: to demonstrate} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
--screen:expect([[
@@ -226,9 +198,7 @@ describe('Buffer highlighting', function()
-- |
-- {9:from }{8:diff}{7:erent} sources |
-- ^in {6:order} to {7:de}{5:monstr}{7:ate} |
- -- {1:~ }|
- -- {1:~ }|
- -- {1:~ }|
+ -- {1:~ }|*3
-- |
--]])
@@ -238,9 +208,7 @@ describe('Buffer highlighting', function()
^ |
in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #4 {MATCH:.*}|
]]}
@@ -249,10 +217,7 @@ describe('Buffer highlighting', function()
^a {5:longer} example |
in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
1 line less; before #3 {MATCH:.*}|
]]}
@@ -262,9 +227,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:^combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 more line; before #2 {MATCH:.*}|
]]}
end)
@@ -276,9 +239,7 @@ describe('Buffer highlighting', function()
{7:combin}{8:ing}{9: hi}ghlights |
^in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -288,9 +249,7 @@ describe('Buffer highlighting', function()
{9:from }{8:diff}{7:erent} sources |
a {5:longer} example |
{7:^combin}{8:ing}{9: hi}ghlights |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -300,9 +259,7 @@ describe('Buffer highlighting', function()
{7:combin}{8:ing}{9: hi}ghlights |
^in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
2 changes; before #3 {MATCH:.*}|
]]}
@@ -312,9 +269,7 @@ describe('Buffer highlighting', function()
^in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #2 {MATCH:.*}|
]]}
end)
@@ -327,9 +282,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -339,9 +292,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #2 {MATCH:.*}|
]]}
@@ -352,9 +303,7 @@ describe('Buffer highlighting', function()
in {6:ordAAAA^r} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{7:-- INSERT --} |
]]}
@@ -364,9 +313,7 @@ describe('Buffer highlighting', function()
in {6:ordAAAAr} t^o |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -376,9 +323,7 @@ describe('Buffer highlighting', function()
in {6:ordAAAAr} to^ {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #4 {MATCH:.*}|
]]}
@@ -388,9 +333,7 @@ describe('Buffer highlighting', function()
in {6:ord^er} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #3 {MATCH:.*}|
]]}
end)
@@ -401,10 +344,7 @@ describe('Buffer highlighting', function()
a {5:longer} example in {6:order} to {7:de}{5:monstr}{7:ate}|
{7:combin}{8:ing}{9: hi}ghlights^ {9:from }{8:diff}{7:erent} sou|
rces |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
@@ -414,9 +354,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 more line; before #2 {MATCH:.*}|
]]}
end)
@@ -429,8 +367,7 @@ describe('Buffer highlighting', function()
^ to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- INSERT --} |
]]}
@@ -453,8 +390,7 @@ describe('Buffer highlighting', function()
to {7:de}{5:mo^nstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
1 line less; before #3 {MATCH:.*}|
]]}
@@ -464,9 +400,7 @@ describe('Buffer highlighting', function()
in {6:order}^ to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 line less; before #2 {MATCH:.*}|
]]}
end)
@@ -481,24 +415,14 @@ describe('Buffer highlighting', function()
screen:expect([[
{4:three ove}{6:rlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
clear_namespace(id, 0, 1)
screen:expect([[
three {6:overlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -512,24 +436,14 @@ describe('Buffer highlighting', function()
screen:expect{grid=[[
{4:three }{6:overlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
clear_namespace(id, 0, 1)
screen:expect{grid=[[
three {6:overlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
end)
@@ -554,24 +468,14 @@ describe('Buffer highlighting', function()
screen:expect [[
{3:fooba}{2:^r} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]
clear_namespace(id, 0, -1)
screen:expect{grid=[[
fooba^r |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
@@ -590,12 +494,7 @@ describe('Buffer highlighting', function()
screen:expect [[
{3:fooba}{2:^r} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]
end)
@@ -608,12 +507,7 @@ describe('Buffer highlighting', function()
screen:expect([[
Ta {6:båten} över {2:sjön}^! |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -624,24 +518,14 @@ describe('Buffer highlighting', function()
add_highlight(-1, "FancyLangItem", 0, 0, 5)
screen:expect([[
fancy code in a new fancy languag^e |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
command('hi FancyLangItem guifg=red')
screen:expect([[
{10:fancy} code in a new fancy languag^e |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -661,8 +545,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, |
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -680,8 +563,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -692,8 +574,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -706,8 +587,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -718,8 +598,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -732,9 +611,7 @@ describe('Buffer highlighting', function()
^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, {12:暗x事zz速野谷質結育}|
x = 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
--screen:expect([[
@@ -742,9 +619,7 @@ describe('Buffer highlighting', function()
-- ^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
-- , 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
-- x = 4 |
- -- {1:~ }|
- -- {1:~ }|
- -- {1:~ }|
+ -- {1:~ }|*3
-- |
--]])
end)
@@ -796,8 +671,7 @@ describe('Buffer highlighting', function()
{13:5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}|
{13:, 5, 5, 5, 5, 5, 5, } Lorem ipsum dolor s|
^x{13: = 4} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- VISUAL LINE --} |
]])
@@ -808,8 +682,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
^x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -821,8 +694,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -833,8 +705,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- VISUAL --} |
]])
@@ -845,8 +716,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- VISUAL --} |
]])
end)
@@ -860,8 +730,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5,{1:-$}Lorem ipsum dolor s|
x = 4{1:$} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -872,8 +741,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5,{1:-$} |
x = 4{1:$} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end)
@@ -887,8 +755,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -899,8 +766,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -912,8 +778,7 @@ describe('Buffer highlighting', function()
{14:^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}|
{14:, 5, 5, 5, 5, 5, 5, }Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
@@ -926,8 +791,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 {12:暗x事} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -938,8 +802,7 @@ describe('Buffer highlighting', function()
5, 5, 5,{18: }5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 {12:暗x事} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index e4766103c2..3fddc4700a 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -182,100 +182,55 @@ describe('Command-line coloring', function()
start_prompt()
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:^ |
]])
feed('e')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:e^ |
]])
feed('cho ')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo ^ |
]])
feed('(')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}^ |
]])
feed('(')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}{RBP2:(}^ |
]])
feed('42')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}{RBP2:(}42^ |
]])
feed('))')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}{RBP2:(}42{RBP2:)}{RBP1:)}^ |
]])
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}{RBP2:(}42{RBP2:)}^ |
]])
redraw_input()
screen:expect{grid=[[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}{RBP2:(}42{RBP2:)}^ |
]], reset=true}
end)
@@ -285,12 +240,7 @@ describe('Command-line coloring', function()
start_prompt('echo')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo^ |
]])
end)
@@ -301,8 +251,7 @@ describe('Command-line coloring', function()
start_prompt('echo "«')
screen:expect{grid=[[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:echo " |
{ERR:E5405: Chunk 0 start 7 splits multibyte }|
@@ -312,8 +261,7 @@ describe('Command-line coloring', function()
feed('»')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:echo " |
{ERR:E5405: Chunk 0 start 7 splits multibyte }|
@@ -327,8 +275,7 @@ describe('Command-line coloring', function()
start_prompt('echo "«')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:echo " |
{ERR:E5406: Chunk 0 end 7 splits multibyte ch}|
@@ -355,12 +302,7 @@ describe('Command-line coloring', function()
start_prompt('e')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:e^ |
]])
eq('', exec_capture('messages'))
@@ -370,12 +312,7 @@ describe('Command-line coloring', function()
start_prompt('e')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:e^ |
]])
eq('', exec_capture('messages'))
@@ -385,12 +322,7 @@ describe('Command-line coloring', function()
start_prompt('e')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:e^ |
]])
eq('', exec_capture('messages'))
@@ -414,8 +346,7 @@ describe('Command-line coloring', function()
start_prompt('let x = "«»«»«»«»«»"')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:let x = " |
{ERR:E5405: Chunk 0 start 10 splits multibyte}|
@@ -425,12 +356,7 @@ describe('Command-line coloring', function()
feed('\n')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
|
]])
feed('\n')
@@ -443,20 +369,14 @@ describe('Command-line coloring', function()
start_prompt('echo 42')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
|
]])
screen:sleep(500)
feed('<C-c>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
: |
{ERR:E5407: Callback has thrown an exception:}|
@@ -466,23 +386,13 @@ describe('Command-line coloring', function()
redraw_input()
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo 42^ |
]])
feed('\n')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo 42 |
]])
feed('\n')
@@ -490,12 +400,7 @@ describe('Command-line coloring', function()
feed('<C-c>')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
Type :qa and pre...nter> to exit Nvim |
]])
end)
@@ -504,12 +409,7 @@ describe('Command-line coloring', function()
start_prompt('echo ("<C-v><CR><C-v><Nul><C-v><NL>")')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}"{SK:^M^@^@}"{RBP1:)}^ |
]])
end)
@@ -519,9 +419,7 @@ describe('Command-line coloring', function()
start_prompt('#')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{MSEP: }|
: |
{ERR:E5400: Callback should return list} |
@@ -533,9 +431,7 @@ describe('Command-line coloring', function()
start_prompt('#')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{MSEP: }|
: |
{ERR:E5401: List item 1 is not a List} |
@@ -547,8 +443,7 @@ describe('Command-line coloring', function()
start_prompt('+')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:+ |
{ERR:E5402: List item 1 has incorrect length:}|
@@ -561,8 +456,7 @@ describe('Command-line coloring', function()
start_prompt('+')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:+ |
{ERR:E5403: Chunk 1 start 2 not in range [1, }|
@@ -575,9 +469,7 @@ describe('Command-line coloring', function()
start_prompt('+')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{MSEP: }|
:+ |
{ERR:E5404: Chunk 1 end 3 not in range (1, 2]}|
@@ -616,12 +508,7 @@ describe('Command-line coloring', function()
start_prompt('1')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP1:1}^ |
]])
@@ -629,12 +516,7 @@ describe('Command-line coloring', function()
start_prompt('2')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP2:2}^ |
]])
@@ -642,12 +524,7 @@ describe('Command-line coloring', function()
start_prompt('3')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP3:3}^ |
]])
@@ -655,57 +532,32 @@ describe('Command-line coloring', function()
start_prompt('4')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP4:4}^ |
]])
feed('<CR>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP3:3}4^ |
]])
feed('<CR>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP2:2}34^ |
]])
feed('<CR>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:{RBP1:1}234^ |
]])
feed('<CR><CR><C-l>')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
|
]])
eq('1234', meths.get_var('out'))
@@ -763,12 +615,7 @@ describe('Ex commands coloring', function()
feed(':echo (((1)))')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:echo {RBP1:(}{RBP2:(}{RBP3:(}1{RBP3:)}{RBP2:)}{RBP1:)}^ |
]])
end)
@@ -802,8 +649,7 @@ describe('Ex commands coloring', function()
feed(':debug execute "echo 1"\n')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
Entering Debug mode. Type "cont" to con|
tinue. |
@@ -824,12 +670,7 @@ describe('Ex commands coloring', function()
feed('\n')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
|
]])
end)
@@ -838,8 +679,7 @@ describe('Ex commands coloring', function()
feed(':#x')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*2
{MSEP: }|
:# |
{ERR:Error detected while processing :} |
@@ -885,12 +725,7 @@ describe('Expressions coloring support', function()
feed(':echo <C-r>=(((1)))')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
={NPAR:(((}{NUM:1}{NPAR:)))}^ |
]])
end)
@@ -902,12 +737,7 @@ describe('Expressions coloring support', function()
feed(':<C-r>=1')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
={NUM:1}^ |
]])
end)
@@ -921,34 +751,19 @@ describe('Expressions coloring support', function()
feed('i<C-r>="«»"«»')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
={SQ:"}{SB:«»}{SQ:"}{E:«»}^ |
]])
feed('<C-c>')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
{M:-- INSERT --} |
]])
feed('<Esc>')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
|
]])
feed(':<C-\\>e"<C-v><C-x>"<C-v><C-x>')
@@ -956,35 +771,20 @@ describe('Expressions coloring support', function()
-- highlighting.
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
={SQ:"}{SB:^X}{SQ:"}{ERR:^X}^ |
]])
feed('<C-c>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
:^ |
]])
funcs.setreg('a', {'\192'})
feed('<C-r>="<C-r><C-r>a"<C-r><C-r>a"foo"')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*6
={SQ:"}{SB:<c0>}{SQ:"}{E:<c0>"}{SB:foo}{E:"}^ |
]])
end)
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 188b9ee87b..cac070406d 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -41,9 +41,7 @@ local function test_cmdline(linegrid)
feed(':')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -54,9 +52,7 @@ local function test_cmdline(linegrid)
feed('sign')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -67,9 +63,7 @@ local function test_cmdline(linegrid)
feed('<Left>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -80,9 +74,7 @@ local function test_cmdline(linegrid)
feed('<bs>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -93,9 +85,7 @@ local function test_cmdline(linegrid)
feed('<Esc>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end)
@@ -104,9 +94,7 @@ local function test_cmdline(linegrid)
feed(':call input("input", "default")<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
prompt = "input",
@@ -117,9 +105,7 @@ local function test_cmdline(linegrid)
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end)
@@ -128,9 +114,7 @@ local function test_cmdline(linegrid)
feed(':xx<c-r>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -142,9 +126,7 @@ local function test_cmdline(linegrid)
feed('=')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -171,9 +153,7 @@ local function test_cmdline(linegrid)
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline=expectation}
@@ -181,9 +161,7 @@ local function test_cmdline(linegrid)
command("mode")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline=expectation, reset=true}
@@ -191,9 +169,7 @@ local function test_cmdline(linegrid)
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -204,9 +180,7 @@ local function test_cmdline(linegrid)
feed('<esc>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end)
@@ -215,9 +189,7 @@ local function test_cmdline(linegrid)
feed(':function Foo()<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
indent = 2,
@@ -231,9 +203,7 @@ local function test_cmdline(linegrid)
feed('line1<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
indent = 2,
@@ -248,9 +218,7 @@ local function test_cmdline(linegrid)
command("mode")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
indent = 2,
@@ -265,9 +233,7 @@ local function test_cmdline(linegrid)
feed('endfunction<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -275,9 +241,7 @@ local function test_cmdline(linegrid)
feed(':function Bar()<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
indent = 2,
@@ -291,9 +255,7 @@ local function test_cmdline(linegrid)
feed('endfunction<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -303,9 +265,7 @@ local function test_cmdline(linegrid)
feed(':make')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -374,9 +334,7 @@ local function test_cmdline(linegrid)
command("redraw!")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -389,9 +347,7 @@ local function test_cmdline(linegrid)
feed(":call inputsecret('secret:')<cr>abc123")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
prompt = "secret:",
@@ -434,9 +390,7 @@ local function test_cmdline(linegrid)
feed('<f5>(a(b)a)')
screen:expect{grid=[[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
|
]], cmdline={{
prompt = '>',
@@ -463,9 +417,7 @@ local function test_cmdline(linegrid)
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -476,9 +428,7 @@ local function test_cmdline(linegrid)
feed('<tab>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -489,9 +439,7 @@ local function test_cmdline(linegrid)
feed('<left><left>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -502,9 +450,7 @@ local function test_cmdline(linegrid)
feed('<right>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -515,9 +461,7 @@ local function test_cmdline(linegrid)
feed('a')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -543,9 +487,7 @@ local function test_cmdline(linegrid)
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -556,9 +498,7 @@ local function test_cmdline(linegrid)
feed('<tab>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -569,9 +509,7 @@ local function test_cmdline(linegrid)
feed('<left><left>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -582,9 +520,7 @@ local function test_cmdline(linegrid)
feed('<right>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -595,9 +531,7 @@ local function test_cmdline(linegrid)
feed('a')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -645,9 +579,7 @@ local function test_cmdline(linegrid)
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
firstc = ":",
@@ -663,9 +595,7 @@ local function test_cmdline(linegrid)
feed(':xa')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], cmdline={{
content = { { "x" } },
@@ -679,9 +609,7 @@ local function test_cmdline(linegrid)
feed('<esc>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -748,26 +676,20 @@ describe('cmdline redraw', function()
feed('q:iabc<Esc>vhh')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] }|
{1::}^a{8:bc} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[Command Line] }|
{9:-- VISUAL --} |
]])
feed('<C-C>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] }|
{1::}a{8:bc} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[Command Line] }|
:^abc |
]])
@@ -778,18 +700,14 @@ describe('cmdline redraw', function()
meths.buf_set_lines(0, 0, -1, true, {"let's rock!"})
screen:expect{grid=[[
!kcor s'te^l|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
|
]]}
feed '/'
screen:expect{grid=[[
!kcor s'tel|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
^ /|
]]}
@@ -798,9 +716,7 @@ describe('cmdline redraw', function()
-- when rendered as a block so it touches the end of the text
screen:expect{grid=[[
!kcor {2:s'tel}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
^ s'tel/|
]]}
@@ -808,45 +724,35 @@ describe('cmdline redraw', function()
feed "<space>"
screen:expect{grid=[[
!kcor{2: s'tel}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
^ s'tel/|
]]}
feed "rock"
screen:expect{grid=[[
!{2:kcor s'tel}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
^ kcor s'tel/|
]]}
feed "<right>"
screen:expect{grid=[[
!{2:kcor s'tel}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
^kcor s'tel/|
]]}
feed "<left>"
screen:expect{grid=[[
!{2:kcor s'tel}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
^ kcor s'tel/|
]]}
feed "<cr>"
screen:expect{grid=[[
!{10:kcor s'te^l}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
kcor s'tel/ |
]]}
end)
@@ -865,8 +771,7 @@ describe('statusline is redrawn on entering cmdline', function()
command('set statusline=%{mode()}')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:n }|
|
]]}
@@ -874,8 +779,7 @@ describe('statusline is redrawn on entering cmdline', function()
feed(':')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:c }|
:^ |
]]}
@@ -887,8 +791,7 @@ describe('statusline is redrawn on entering cmdline', function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:n }|
|
]]}
@@ -896,8 +799,7 @@ describe('statusline is redrawn on entering cmdline', function()
feed(';')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:c }|
:^ |
]]}
@@ -919,11 +821,7 @@ describe('statusline is redrawn on entering cmdline', function()
|
{3:c1 }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{3: }|
{4:E121: Undefined variable: doesnotex}|
{4:ist} |
@@ -936,8 +834,7 @@ describe('statusline is redrawn on entering cmdline', function()
|
{3:c2 }|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3: }|
{4:E121: Undefined variable: doesnotex}|
{4:ist} |
@@ -972,14 +869,7 @@ describe('statusline is redrawn on entering cmdline', function()
^ |
{3:n3 }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
{2:[No Name] }|
|
]]}
@@ -990,8 +880,7 @@ describe('statusline is redrawn on entering cmdline', function()
command('set statusline=')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[No Name] }|
|
]]}
@@ -1002,8 +891,7 @@ describe('statusline is redrawn on entering cmdline', function()
feed(':')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:command }|
:^ |
]]}
@@ -1014,8 +902,7 @@ describe('statusline is redrawn on entering cmdline', function()
feed(':')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:command }|
:^ |
]]}
@@ -1104,17 +991,12 @@ describe('cmdheight=0', function()
command("set redrawdebug=invalid cmdheight=0 noruler laststatus=0")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
feed(":resize -1<CR>")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
assert_alive()
@@ -1124,8 +1006,7 @@ describe('cmdheight=0', function()
command("set cmdheight=1 noruler laststatus=2")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
|
]]}
@@ -1135,9 +1016,7 @@ describe('cmdheight=0', function()
command("set cmdheight=0 noruler laststatus=2")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] }|
]]}
end)
@@ -1146,10 +1025,7 @@ describe('cmdheight=0', function()
command("set cmdheight=0 ruler laststatus=0")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -1158,10 +1034,7 @@ describe('cmdheight=0', function()
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={}}
feed('<Esc>')
eq(0, eval('&cmdheight'))
@@ -1172,10 +1045,7 @@ describe('cmdheight=0', function()
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={}}
feed('<Esc>')
eq(0, eval('&cmdheight'))
@@ -1186,9 +1056,7 @@ describe('cmdheight=0', function()
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3:-- INSERT --} |
]]}
feed('<Esc>')
@@ -1200,19 +1068,14 @@ describe('cmdheight=0', function()
feed(':')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:^ |
]]}
eq(0, eval('&cmdheight'))
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={}}
eq(0, eval('&cmdheight'))
end)
@@ -1231,10 +1094,7 @@ describe('cmdheight=0', function()
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={}}
eq(0, eval('&cmdheight'))
end)
@@ -1253,24 +1113,21 @@ describe('cmdheight=0', function()
screen:expect{grid=[[
{3:foo }|
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
]]}
feed(':')
screen:expect{grid=[[
{3:foo }|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
:^ |
]]}
feed('<Esc>')
screen:expect{grid=[[
{3:foo }|
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
]], showmode={}}
eq(0, eval('&cmdheight'))
@@ -1283,18 +1140,12 @@ describe('cmdheight=0', function()
feed('qq')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
feed('q')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], unchanged=true}
end)
@@ -1303,27 +1154,21 @@ describe('cmdheight=0', function()
feed('ifoo<ESC>')
screen:expect{grid=[[
fo^o |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] [+] }|
]]}
feed(':%s/foo/bar/gc<CR>')
screen:expect{grid=[[
{6:foo} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{5:replace wi...q/l/^E/^Y)?}^ |
]]}
feed('y')
screen:expect{grid=[[
^bar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] [+] }|
]]}
@@ -1342,19 +1187,13 @@ describe('cmdheight=0', function()
feed('iaabbaa<esc>/aa<cr>')
screen:expect{grid=[[
{7:^aa}bb{7:aa} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
feed('<f3>')
screen:expect{grid=[[
^aabbaa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -1364,10 +1203,7 @@ describe('cmdheight=0', function()
-- doesn't crash while not displaying silent! error message
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -1377,17 +1213,10 @@ describe('cmdheight=0', function()
meths.buf_set_lines(0, 0, -1, true, {'p'})
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*5
## grid 2
^p |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
@@ -1396,17 +1225,11 @@ describe('cmdheight=0', function()
feed '/p'
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*4
[3:-------------------------]|
## grid 2
{6:p} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
/p^ |
]], win_viewport={
@@ -1423,8 +1246,7 @@ describe('cmdheight=0', function()
screen:expect([[
{3:c :}|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
:^ |
]])
feed('echo')
@@ -1432,16 +1254,14 @@ describe('cmdheight=0', function()
screen:expect([[
{3:c :}|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
:echo^ |
]])
command('redrawstatus')
screen:expect([[
{3:c :echo}|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
:echo^ |
]])
end)
@@ -1452,28 +1272,17 @@ describe('cmdheight=0', function()
command('vsplit')
screen:expect([[
^ │ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*8
]])
feed(':')
command('split')
feed('<Esc>')
screen:expect([[
^ │ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
{2:[No Name] }│{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
]])
command('resize 2')
screen:expect([[
@@ -1481,25 +1290,17 @@ describe('cmdheight=0', function()
{1:~ }│{1:~ }|
{2:[No Name] }│{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*5
]])
feed(':')
command('wincmd =')
feed('<Esc>')
screen:expect([[
^ │ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
{2:[No Name] }│{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
]])
end)
@@ -1508,10 +1309,7 @@ describe('cmdheight=0', function()
feed('d')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]])
assert_alive()
end)
@@ -1521,33 +1319,27 @@ describe('cmdheight=0', function()
command('resize +1')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
|
]])
command('set cmdheight=0')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] }|
]]}
command('resize -1')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] }|
|
]]}
command('resize +1')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] }|
]])
end)
@@ -1559,9 +1351,7 @@ describe('cmdheight=0', function()
command('resize -1')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3:[No Name] }|
]])
meths.input_mouse('left', 'press', '', 0, 6, 10)
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index 7bec5eaac6..2b8dc0fe19 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -186,9 +186,7 @@ describe('ui/cursor', function()
command("echo 'test'")
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
test |
]], condition=function()
eq(nil, screen._mode_info)
@@ -255,9 +253,7 @@ describe('ui/cursor', function()
end
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
test |
]], condition=function()
eq(expected_mode_info, screen._mode_info)
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index e8fcfc46fc..f1290bbdca 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -212,9 +212,7 @@ describe('decorations providers', function()
{15:i} am not capitalized. |
I am a {16:speling} {16:mistakke}. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -227,9 +225,7 @@ describe('decorations providers', function()
{15:^i} am not capitalized. |
I am a {16:speling} {16:mistakke}. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -242,9 +238,7 @@ describe('decorations providers', function()
{15:i} am not capitalized. |
I am a {16:^speling} {16:mistakke}. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -257,9 +251,7 @@ describe('decorations providers', function()
i am not capitalized. |
I am a ^speling mistakke. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -269,9 +261,7 @@ describe('decorations providers', function()
i am not capitalized. |
I am a ^speling mistakke. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{17:search hit BOTTOM, continuing at TOP} |
]]}
command('echo ""')
@@ -284,9 +274,7 @@ describe('decorations providers', function()
{15:i} am not capitalized. |
I am a {16:^speling} {16:mistakke}. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -296,9 +284,7 @@ describe('decorations providers', function()
{15:i} am not capitalized. |
I am a {16:speling} {16:^mistakke}. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -787,8 +773,7 @@ describe('extmark decorations', function()
colpos = colpos+1 {25: } |
end {25: } |
end {25: } |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
meths.buf_set_extmark(0, ns, 4, 0, { virt_text={{''}}, virt_text_pos='eol'})
@@ -827,8 +812,7 @@ describe('extmark decorations', function()
{2:|} {1:|} cofoo{3:bar}{4:!!}olpos+1 |
end |
end |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -857,8 +841,7 @@ describe('extmark decorations', function()
s+1 |
end |
end |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -892,8 +875,7 @@ describe('extmark decorations', function()
s+1 |
end -- ???????{4:口 }|
end -- {4:口口} 古古{4:口口 }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -1125,8 +1107,7 @@ describe('extmark decorations', function()
colpos {5:=} colpos{5:+}{13:1} |
{5:end} |
{5:end} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -1152,8 +1133,7 @@ describe('extmark decorations', function()
colpos {5:=} colpos{5:+}{13:1} |
{5:end} |
{5:end} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -1171,8 +1151,7 @@ describe('extmark decorations', function()
colpos {5:=} colpos{5:+}{13:1} |
{5:end} |
{5:end} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{24:-- VISUAL LINE --} |
]]}
@@ -1190,8 +1169,7 @@ describe('extmark decorations', function()
colpos {5:=} colpos{5:+}{13:1} |
{5:end} |
{5:end} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{24:-- VISUAL LINE --} |
]]}
end)
@@ -1224,8 +1202,7 @@ describe('extmark decorations', function()
colpos = colpos+1 |
end |
end |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -1262,8 +1239,7 @@ describe('extmark decorations', function()
colpos = colpos+1 |
end |
end |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
: |
]]}
@@ -1465,8 +1441,7 @@ describe('extmark decorations', function()
screen:expect{grid=[[
^aaaaaaaaaaaaaaaaaaaaaaaaa│ |
aaaaaaaaaaaaaaaaaaaaaaaaa│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{41:[No Name] [+] }{40:[No Name] }|
|
]]}
@@ -1583,8 +1558,7 @@ describe('extmark decorations', function()
meths.buf_set_extmark(0, ns, 0, 0, { virt_lines = { vt, vt } })
screen:expect{grid=[[
{2:a}{3:b}{4:c}{5:d}{6:X}#^# {2:a}{3:b}{4:c}{5:d}{6:X} {2:a}{3:b}{4:c}{5:d}{6:X}|
- {2:a}{3:b}{4:c}{5:d}{6:X} |
- {2:a}{3:b}{4:c}{5:d}{6:X} |
+ {2:a}{3:b}{4:c}{5:d}{6:X} |*2
{1:~ }|
|
]]}
@@ -1597,19 +1571,7 @@ describe('extmark decorations', function()
]]
screen:expect{grid=[[
^ a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
|
]]}
@@ -1619,19 +1581,7 @@ describe('extmark decorations', function()
]]
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
|
]]}
assert_alive()
@@ -1645,8 +1595,7 @@ describe('extmark decorations', function()
screen:expect([[
{26:X} |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
command('set conceallevel=1')
@@ -1663,8 +1612,7 @@ describe('extmark decorations', function()
screen:expect([[
{26:ẍ̲} |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
command('set conceallevel=1')
@@ -1675,8 +1623,7 @@ describe('extmark decorations', function()
screen:expect{grid=[[
{26:x} |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
@@ -1690,16 +1637,14 @@ describe('extmark decorations', function()
screen:expect([[
{26:?}bar |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
command('let &conceallevel=2')
screen:expect([[
bar |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end)
@@ -1754,19 +1699,10 @@ describe('extmark decorations', function()
screen:expect{grid=[[
{27: } |
- XXX |
- XXX |
+ XXX |*2
^XXX HELLO |
- XXX |
- XXX |
- XXX |
- XXX |
- XXX |
- XXX |
- XXX |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ XXX |*7
+ {1:~ }|*3
|
]]}
@@ -1942,23 +1878,17 @@ describe('extmark decorations', function()
meths.buf_set_extmark(0, ns, 0, 0, {end_row = 5, end_col = 0, hl_group = 'Underlined'})
screen:expect([[
{28:^asdf} |
- {28: asdf} |
- {28: asdf} |
- {28: asdf} |
+ {28: asdf} |*3
{28:asdf} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
feed('<C-V>Gll')
screen:expect([[
{29:asd}{28:f} |
- {29: }{28: asdf} |
- {29: }{28: asdf} |
- {29: }{28: asdf} |
+ {29: }{28: asdf} |*3
{29:as}{28:^df} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{24:-- VISUAL BLOCK --} |
]])
end)
@@ -1984,8 +1914,7 @@ describe('extmark decorations', function()
colpos = colpos+1 |
end |
end |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed'5<c-e>'
@@ -1997,13 +1926,7 @@ describe('extmark decorations', function()
colpos = colpos+1 |
end |
end |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
|
]]}
@@ -2016,13 +1939,7 @@ describe('extmark decorations', function()
colpos = colpos+1 |
end |
end |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
|
]]}
end)
@@ -2504,8 +2421,7 @@ describe('decorations: inline virtual text', function()
{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:X} |
bbbbbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('j')
@@ -2515,8 +2431,7 @@ describe('decorations: inline virtual text', function()
{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:X} |
bbbbbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('j')
@@ -2526,8 +2441,7 @@ describe('decorations: inline virtual text', function()
{10:^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:X} |
bbbbbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('j')
@@ -2537,8 +2451,7 @@ describe('decorations: inline virtual text', function()
{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:X} |
bbbbb^b |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('0<C-V>2l2k')
@@ -2548,8 +2461,7 @@ describe('decorations: inline virtual text', function()
{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:X} |
{7:bbb}bbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{8:-- VISUAL BLOCK --} |
]]}
feed([[<Esc>/aaa\n\%V<CR>]])
@@ -2559,8 +2471,7 @@ describe('decorations: inline virtual text', function()
{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:X} |
bbbbbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{16:search hit BOTTOM, continuing at TOP} |
]]}
feed('3ggic')
@@ -2570,8 +2481,7 @@ describe('decorations: inline virtual text', function()
c{10:^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:XX} |
bbbbbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{8:-- INSERT --} |
]]}
feed([[<Esc>/aaa\nc\%V<CR>]])
@@ -2581,8 +2491,7 @@ describe('decorations: inline virtual text', function()
{12:c}{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{10:XX} |
bbbbbb |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{16:search hit BOTTOM, continuing at TOP} |
]]}
end)
@@ -3052,13 +2961,11 @@ describe('decorations: inline virtual text', function()
feed('gg0')
screen:expect{grid=[[
{9:^000 }│{5:9}{14:test}{9:000 }|
- {9:000 }│{9:000}{5:9}{9: }|
- {9:000 }│{9:000}{5:9}{9: }|
+ {9:000 }│{9:000}{5:9}{9: }|*2
{9:000 }│{5:9}{9:000 }|
{9:000 }│{9:000}{5:9}{9: }|
{9:aaabbb }│{14:!}{9:aaa}{5: }{9:bbb }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{15:[No Name] [+] }{13:[No Name] [+] }|
|
]]}
@@ -3066,13 +2973,11 @@ describe('decorations: inline virtual text', function()
feed('zl')
screen:expect{grid=[[
{9:000 }│{14:test}{9:000 }|
- {9:000 }│{9:00}{5:9}{9: }|
- {9:000 }│{9:00}{5:9}{9: }|
+ {9:000 }│{9:00}{5:9}{9: }|*2
{9:000 }│{9:000 }|
{9:000 }│{9:00}{5:9}{9: }|
{9:aaabbb }│{9:aaa}{5: }{9:bb^b }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
{13:[No Name] [+] }{15:[No Name] [+] }|
|
]]}
@@ -3141,16 +3046,14 @@ describe('decorations: inline virtual text', function()
screen:expect{grid=[[
{18:^+-- 2 lines: aaaaa·······························································}|
{17:+-- 2 lines: ccccc·······························································}|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('j')
screen:expect{grid=[[
{17:+-- 2 lines: aaaaa·······························································}|
{18:^+-- 2 lines: ccccc·······························································}|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
@@ -3161,24 +3064,19 @@ describe('decorations: inline virtual text', function()
screen:expect{grid=[[
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
b |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
command('set nowrap')
screen:expect{grid=[[
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
feed('82i0<Esc>0')
screen:expect{grid=[[
^0000000000000000000000000000000000000000000000000000000000000000000000000000000000|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
command('set wrap')
@@ -3416,26 +3314,20 @@ describe('decorations: inline virtual text', function()
{1:+}23123123123123123123123|
{1:+}12312312312312312312312|
{1:+}3^a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
: |
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}12312312312312312312312|
{1:+}3^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
: |
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}3^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
: |
]]}
feed('zbi')
@@ -3480,26 +3372,20 @@ describe('decorations: inline virtual text', function()
{1:+}31231231231231231231231|
{1:+}23123123123123123123123|
{1:+}^a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
: |
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}23123123123123123123123|
{1:+}^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
: |
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
: |
]]}
feed('023x$')
@@ -3516,26 +3402,20 @@ describe('decorations: inline virtual text', function()
{1:+}31231231231231231231231|
{1:+}23123123123123123123123|
{1:+}^a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
: |
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}23123123123123123123123|
{1:+}^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
: |
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
: |
]]}
feed('zbi')
@@ -3552,8 +3432,7 @@ describe('decorations: inline virtual text', function()
1 ^12312312312312312312312312|
{1:+}31231231231231231231231|
{1:+}23123123123123123123a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{8:-- INSERT --} |
]]}
feed('<Esc>')
@@ -3561,26 +3440,20 @@ describe('decorations: inline virtual text', function()
1 12312312312312312312312312|
{1:+}31231231231231231231231|
{1:+}23123123123123123123^a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}31231231231231231231231|
{1:+}23123123123123123123^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:+}23123123123123123123^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
feed('zbx')
@@ -3588,8 +3461,7 @@ describe('decorations: inline virtual text', function()
1 ^12312312312312312312312312|
{1:+}31231231231231231231231|
{1:+}23123123123123123123 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('26ia<Esc>a')
@@ -3645,26 +3517,20 @@ describe('decorations: inline virtual text', function()
{1:<<<}212121212121212121212121212|
1212121212121212121212121212{1:<-}|
{1:----->}^a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:<<<}2121212121212121212121212{1:<-}|
{1:----->}^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:<<<-->}^a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
feed('zbh')
@@ -3708,26 +3574,20 @@ describe('decorations: inline virtual text', function()
{1:<<<}212121212121212121212121212|
1212121212121212121212121212 |
^ a |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:<<<}2121212121212121212121212 |
^ a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
feed('<C-E>')
screen:expect{grid=[[
{1:<<<} ^ a |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end)
@@ -3744,8 +3604,7 @@ describe('decorations: inline virtual text', function()
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:+}bbbbbbbbbb |
{1:+}cccccccccccccccccccccccccccccccccccccccccccc^c |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
feed('05x$')
@@ -3753,8 +3612,7 @@ describe('decorations: inline virtual text', function()
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb|
{1:+}bbbbb |
{1:+}cccccccccccccccccccccccccccccccccccccccccccc^c |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
@@ -4158,9 +4016,7 @@ if (h->n_buckets < new_n_buckets) { // expand
^char *new_vals = krealloc( h->vals_buf, new_n_|
buckets * val_size); |
Grugg |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -4168,31 +4024,14 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
^ |
Grugg |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*9
--No lines in buffer-- |
]]}
meths.buf_del_extmark(0, ns, id)
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
--No lines in buffer-- |
]]}
end)
@@ -4205,15 +4044,7 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect([[
fo^o |
{6:bar} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*9
|
]])
end)
@@ -4325,8 +4156,7 @@ if (h->n_buckets < new_n_buckets) { // expand
they |
{7:hatin'} |
^hh |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -4335,9 +4165,7 @@ if (h->n_buckets < new_n_buckets) { // expand
they |
{7:hatin'} |
^hh |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -4345,21 +4173,14 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
{7:hatin'} |
^hh |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
feed '<c-e>'
screen:expect{grid=[[
^hh |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
end)
@@ -4560,9 +4381,7 @@ if (h->n_buckets < new_n_buckets) { // expand
line3 |
line4 |
line^5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -4576,10 +4395,7 @@ if (h->n_buckets < new_n_buckets) { // expand
line3 |
line4 |
line5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
@@ -4593,9 +4409,7 @@ if (h->n_buckets < new_n_buckets) { // expand
line3 |
line4 |
line5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end)
@@ -4639,12 +4453,9 @@ l5
{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
-
end)
it('can add a single sign (with end row)', function()
@@ -4660,12 +4471,9 @@ l5
{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
-
end)
it('can add a single sign and text highlight', function()
@@ -4680,9 +4488,7 @@ l5
{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
@@ -4702,12 +4508,9 @@ l5
{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
-
end)
it('can add multiple signs (multiple extmarks)', function()
@@ -4724,9 +4527,7 @@ l5
S2l4 |
S2l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
end)
@@ -4744,9 +4545,7 @@ l5
S1S2l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
end)
@@ -4766,9 +4565,7 @@ l5
S2{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
end)
@@ -4787,9 +4584,7 @@ l5
{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
end)
@@ -4813,9 +4608,7 @@ l5
{1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
end)
@@ -4840,9 +4633,7 @@ l5
S3{1: }l4 |
S3{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]}
end)
@@ -4860,14 +4651,9 @@ l5
X {1: }l4 |
{1: }l5 |
{1: } |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
|
]]}
-
end)
it('can add lots of signs', function()
@@ -4890,14 +4676,7 @@ l5
end
screen:expect{grid=[[
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |
+ W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |*8
W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:^h} |
|
]]}
@@ -4977,6 +4756,37 @@ l5
|
]]}
end)
+
+ it('correct width when removing multiple signs from sentinel line', function()
+ screen:try_resize(20, 4)
+ insert(example_test3)
+ meths.buf_set_extmark(0, ns, 0, -1, {sign_text='S1', end_row=3})
+ meths.buf_set_extmark(0, ns, 1, -1, {invalidate = true, sign_text='S2'})
+ meths.buf_set_extmark(0, ns, 1, -1, {invalidate = true, sign_text='S3'})
+ feed('2Gdd')
+
+ screen:expect{grid=[[
+ S1l1 |
+ S1^l3 |
+ S1l4 |
+ |
+ ]]}
+ end)
+
+ it('correct width with multiple overlapping signs', function()
+ screen:try_resize(20, 4)
+ insert(example_test3)
+ meths.buf_set_extmark(0, ns, 0, -1, {sign_text='S1', end_row=2})
+ meths.buf_set_extmark(0, ns, 1, -1, {sign_text='S2', end_row=2})
+ feed('gg')
+
+ screen:expect{grid=[[
+ S1{1: }^l1 |
+ S1S2l2 |
+ S1S2l3 |
+ |
+ ]]}
+ end)
end)
describe('decorations: virt_text', function()
@@ -5015,10 +4825,7 @@ describe('decorations: virt_text', function()
{1: 2 }hello {2:hello} |
{1: 1 }hello |
{1:5 }helloVIRTUA^L |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
|
]]}
@@ -5031,10 +4838,7 @@ describe('decorations: virt_text', function()
{1: 1 }hello {2:hello} |
{1:4 }hell^o |
{1: 1 }helloVIRTUAL |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
|
]]}
end)
@@ -5044,14 +4848,9 @@ describe('decorations: virt_text', function()
screen:expect{grid=[[
|
- hello |
- hello |
- hello |
- hello |
+ hello |*4
hell^o |
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
|
]]}
@@ -5062,16 +4861,10 @@ describe('decorations: virt_text', function()
screen:expect{grid=[[
|
- hello |
- hello |
- hello |
- hello |
+ hello |*4
hell^o world |
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
|
]]}
end)
-
end)
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index 92b7235885..71bbb2f003 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -11,6 +11,8 @@ local exec = helpers.exec
local eq = helpers.eq
local meths = helpers.meths
+before_each(clear)
+
describe('Diff mode screen', function()
local fname = 'Xtest-functional-diff-screen-1'
local fname_2 = fname .. '.2'
@@ -21,7 +23,6 @@ describe('Diff mode screen', function()
end
setup(function()
- clear()
os.remove(fname)
os.remove(fname_2)
end)
@@ -32,7 +33,6 @@ describe('Diff mode screen', function()
end)
before_each(function()
- clear()
feed(':e ' .. fname_2 .. '<cr>')
feed(':vnew ' .. fname .. '<cr>')
feed(':diffthis<cr>')
@@ -68,12 +68,7 @@ describe('Diff mode screen', function()
{1: }5 │{1: }5 |
{1: }6 │{1: }6 |
{1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -88,12 +83,7 @@ describe('Diff mode screen', function()
{1: }5 │{1: }5 |
{1: }6 │{1: }6 |
{1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -114,12 +104,7 @@ describe('Diff mode screen', function()
{1: }5 │{1: }5 |
{1: }6 │{1: }6 |
{1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -134,12 +119,7 @@ describe('Diff mode screen', function()
{1: }5 │{1: }5 |
{1: }6 │{1: }6 |
{1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -160,12 +140,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -180,12 +155,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -219,12 +189,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -239,12 +204,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -282,8 +242,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*2
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -302,8 +261,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*2
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -328,8 +286,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*2
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -348,8 +305,7 @@ describe('Diff mode screen', function()
{1: }9 │{1: }9 |
{1: }10 │{1: }10 |
{1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*2
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -578,11 +534,7 @@ int main(int argc, char **argv)
{1: }{2:------------------}│{1: }{4: values.each do }|
{1: } v.finalize │{1: } v.finalize |
{1: } end │{1: } end |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*5
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=internal,filler |
]])
@@ -601,11 +553,7 @@ int main(int argc, char **argv)
{1: } values.each do |│{1: } values.each do |
{1: } v.finalize │{1: } v.finalize |
{1: } end │{1: } end |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*5
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
|
]])
@@ -625,11 +573,7 @@ int main(int argc, char **argv)
{1: } values.each do |│{1: } values.each do |
{1: } v.finalize │{1: } v.finalize |
{1: } end │{1: } end |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*5
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
: |
]])
@@ -644,19 +588,7 @@ int main(int argc, char **argv)
feed(':set diffopt=filler<cr>')
screen:expect([[
{1:+ }{5:^+-- 10 lines: 1···}│{1:+ }{5:+-- 10 lines: 1··}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*13
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -664,19 +596,7 @@ int main(int argc, char **argv)
feed(':set diffopt+=internal<cr>')
screen:expect([[
{1:+ }{5:^+-- 10 lines: 1···}│{1:+ }{5:+-- 10 lines: 1··}|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*13
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -690,19 +610,7 @@ int main(int argc, char **argv)
feed(':set diffopt=filler<cr>')
screen:expect([[
{1:- }^ │{1:- } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*13
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
@@ -710,19 +618,7 @@ int main(int argc, char **argv)
feed(':set diffopt+=internal<cr>')
screen:expect([[
{1:- }^ │{1:- } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*13
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -738,17 +634,7 @@ int main(int argc, char **argv)
{1: }^a │{1: }A |
{1: }b │{1: }b |
{1: }{9:cd }│{1: }{9:cD}{8:e}{9: }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler,icase |
]])
@@ -758,17 +644,7 @@ int main(int argc, char **argv)
{1: }^a │{1: }A |
{1: }b │{1: }b |
{1: }{9:cd }│{1: }{9:cD}{8:e}{9: }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
@@ -795,12 +671,7 @@ int main(int argc, char **argv)
{1: } return 0; │{1: } return 0; |
{1: }{2:------------------}│{1: }{4: } }|
{1: }} │{1: }} |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler,iwhite |
]])
@@ -818,12 +689,7 @@ int main(int argc, char **argv)
{1: } return 0; │{1: } return 0; |
{1: }{2:------------------}│{1: }{4: } }|
{1: }} │{1: }} |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=filler,iwhite,internal |
]])
@@ -842,19 +708,12 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,iblank<cr>')
screen:expect([[
{1: }^a │{1: }a |
- {1: }{4: }│{1: }{2:-----------------}|
- {1: }{4: }│{1: }{2:-----------------}|
+ {1: }{4: }│{1: }{2:-----------------}|*2
{1: }cd │{1: }cd |
{1: }ef │{1: } |
{1: }{8:xxx}{9: }│{1: }ef |
{6:~ }│{1: }{8:yyy}{9: }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*7
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=internal,filler,iblank |
]])
@@ -871,14 +730,7 @@ int main(int argc, char **argv)
{1: }cd │{1: }ef |
{1: }ef │{1: }{8:yyy}{9: }|
{1: }{8:xxx}{9: }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*8
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
: |
]])
@@ -895,14 +747,7 @@ int main(int argc, char **argv)
{1: }cd │{1: }ef |
{1: }ef │{1: }{8:yyy}{9: }|
{1: }{8:xxx}{9: }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*8
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
: |
]])
@@ -919,14 +764,7 @@ int main(int argc, char **argv)
{1: }cd │{1: }ef |
{1: }ef │{1: }{8:yyy}{9: }|
{1: }{8:xxx}{9: }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*8
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
: |
]])
@@ -953,12 +791,7 @@ int main(int argc, char **argv)
{1: }foo │{1: }foo |
{1: }{2:------------------}│{1: }{4: }|
{1: }bar │{1: }bar |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
: |
]])
@@ -977,12 +810,7 @@ int main(int argc, char **argv)
{1: }foo │{1: }foo |
{1: }{2:------------------}│{1: }{4: }|
{1: }bar │{1: }bar |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
: |
]])
@@ -1116,9 +944,7 @@ int main(int argc, char **argv)
{1: } ui.setupUI(Mai│{1: } ui.setupUI(Ma|
{1: } MainWindow.sho│{1: } MainWindow.sh|
{1: } sys.exit(app.e│{1: } sys.exit(app.|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*3
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt=internal,filler |
]])
@@ -1137,9 +963,7 @@ int main(int argc, char **argv)
{1: } ui.setupUI(Mai│{1: } ui.setupUI(Ma|
{1: } MainWindow.sho│{1: } MainWindow.sh|
{1: } ^sys.exit(app.e│{1: } sys.exit(app.|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*3
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=linematch:20 |
]])
@@ -1163,17 +987,7 @@ ccca]]
{1: }^DDD │{1: }DDD |
{1: }{2:------------------}│{1: }{4:AAA }|
{1: }{8:_a}{9:a }│{1: }{8:ccc}{9:a }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
|
]])
@@ -1182,17 +996,7 @@ ccca]]
{1: }^DDD │{1: }DDD |
{1: }{8:_}{9:aa }│{1: }{8:A}{9:AA }|
{1: }{2:------------------}│{1: }{4:ccca }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=icase |
]])
@@ -1216,17 +1020,7 @@ AAAB]]
{1: }^BB │{1: }BB |
{1: }{9: AA}{8:A}{9: }│{1: }{9: AA}{8:B}{9: }|
{1: }{2:------------------}│{1: }{4:AAAB }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
|
]]}
@@ -1235,17 +1029,7 @@ AAAB]]
{1: }^BB │{1: }BB |
{1: }{2:------------------}│{1: }{4: AAB }|
{1: }{9: AAA }│{1: }{9:AAA}{8:B}{9: }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=iwhiteall |
]]}
@@ -1267,12 +1051,7 @@ AAAB]]
{6:~ }│{6:~ }|
{3:<onal-diff-screen-1 <l-diff-screen-1.2 }|
^ |
- {6:~ }|
- {6:~ }|
- {6:~ }|
- {6:~ }|
- {6:~ }|
- {6:~ }|
+ {6:~ }|*6
{7:[No Name] }|
:e |
]]}
@@ -1287,12 +1066,7 @@ AAAB]]
{6:~ }│{6:~ }|
{3:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
^ |
- {6:~ }|
- {6:~ }|
- {6:~ }|
- {6:~ }|
- {6:~ }|
- {6:~ }|
+ {6:~ }|*6
{7:[No Name] }|
:e |
]]}
@@ -1317,8 +1091,7 @@ AAAB]]
ccc |
|
xx |
- {6:~ }|
- {6:~ }|
+ {6:~ }|*2
{7:Xtest-functional-diff-screen-1 }|
:e |
]]}
@@ -1337,8 +1110,7 @@ AAAB]]
ccc |
|
xx |
- {6:~ }|
- {6:~ }|
+ {6:~ }|*2
{7:Xtest-functional-diff-screen-1 [+] }|
:e |
]]}
@@ -1347,7 +1119,6 @@ end)
it('win_update redraws lines properly', function()
local screen
- clear()
screen = Screen.new(50, 10)
screen:attach()
screen:set_default_attr_ids({
@@ -1388,8 +1159,7 @@ it('win_update redraws lines properly', function()
command("windo 1")
screen:expect{grid=[[
{13: }{16:-----------------------}│{13: }{15:^1 }|
- {13: }{16:-----------------------}│{13: }{15: }|
- {13: }{16:-----------------------}│{13: }{15: }|
+ {13: }{16:-----------------------}│{13: }{15: }|*2
{13: }2 │{13: }2 |
{13: }{17:2}{18:a }│{13: }{17:1}{18:a }|
{13: }{15:2b }│{13: }{16:----------------------}|
@@ -1419,7 +1189,6 @@ end)
-- oldtest: Test_diff_rnu()
it('diff updates line numbers below filler lines', function()
- clear()
local screen = Screen.new(40, 14)
screen:attach()
screen:set_default_attr_ids({
@@ -1447,8 +1216,7 @@ it('diff updates line numbers below filler lines', function()
{1: }a │{11: 1 }a |
{1: }a │{11: 2 }a |
{1: }{8:x}{9: }│{11: 3 }{8:y}{9: }|
- {1: }{4:x }│{11: }{2:----------------}|
- {1: }{4:x }│{11: }{2:----------------}|
+ {1: }{4:x }│{11: }{2:----------------}|*2
{1: }b │{11: 4 }b |
{1: }b │{11: 5 }b |
{1: }b │{11: 6 }b |
@@ -1464,8 +1232,7 @@ it('diff updates line numbers below filler lines', function()
{1: }a │{10:2 }^a |
{1: }a │{11: 1 }a |
{1: }{8:x}{9: }│{11: 2 }{8:y}{9: }|
- {1: }{4:x }│{11: }{2:----------------}|
- {1: }{4:x }│{11: }{2:----------------}|
+ {1: }{4:x }│{11: }{2:----------------}|*2
{1: }b │{11: 3 }b |
{1: }b │{11: 4 }b |
{1: }b │{11: 5 }b |
@@ -1481,8 +1248,7 @@ it('diff updates line numbers below filler lines', function()
{1: }a │{11: 1 }a |
{1: }a │{10:3 }^a |
{1: }{8:x}{9: }│{11: 1 }{8:y}{9: }|
- {1: }{4:x }│{11: }{2:----------------}|
- {1: }{4:x }│{11: }{2:----------------}|
+ {1: }{4:x }│{11: }{2:----------------}|*2
{1: }b │{11: 2 }b |
{1: }b │{11: 3 }b |
{1: }b │{11: 4 }b |
@@ -1496,7 +1262,6 @@ end)
-- oldtest: Test_diff_with_scroll_and_change()
it('Align the filler lines when changing text in diff mode', function()
- clear()
local screen = Screen.new(40, 20)
screen:attach()
screen:set_default_attr_ids({
@@ -1528,14 +1293,7 @@ it('Align the filler lines when changing text in diff mode', function()
{1: }13 │{1: }13 |
{1: }14 │{1: }14 |
{1:- }1^5 │{1:- }15 |
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
+ {7:~ }│{7:~ }|*8
{8:[No Name] [+] }{3:[No Name] [+] }|
|
]]}
@@ -1551,14 +1309,7 @@ it('Align the filler lines when changing text in diff mode', function()
{1: }13 │{1: }13 |
{1: }14 │{1: }14 |
{1: }{5:15}{6:^x}{5: }│{1: }{5:15 }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
+ {7:~ }│{7:~ }|*8
{8:[No Name] [+] }{3:[No Name] [+] }|
|
]]}
@@ -1574,21 +1325,13 @@ it('Align the filler lines when changing text in diff mode', function()
{1: }13 │{1: }13 |
{1: }14 │{1: }14 |
{1: }{5:15}{6:x}{5: }│{1: }{5:15}{6:^y}{5: }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
+ {7:~ }│{7:~ }|*8
{3:[No Name] [+] }{8:[No Name] [+] }|
|
]]}
end)
it("diff mode doesn't restore invalid 'foldcolumn' value #21647", function()
- clear()
local screen = Screen.new(60, 6)
screen:set_default_attr_ids({
[0] = {foreground = Screen.colors.Blue, bold = true};
@@ -1598,10 +1341,7 @@ it("diff mode doesn't restore invalid 'foldcolumn' value #21647", function()
command('diffsplit | bd')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
eq('0', meths.get_option_value('foldcolumn', {}))
@@ -1609,7 +1349,6 @@ end)
-- oldtest: Test_diff_binary()
it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', function()
- clear()
local screen = Screen.new(40, 20)
screen:set_default_attr_ids({
[1] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray};
@@ -1641,17 +1380,7 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
{1: }{5:E}{4: }│{1: }{5:e}{4: }|
{1: }f │{1: }f |
{1: }g │{1: }g |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{8:[No Name] [+] }{2:[No Name] [+] }|
|
]])
@@ -1667,17 +1396,7 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
{1: }E │{1: }e |
{1: }f │{1: }f |
{1: }g │{1: }g |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{8:[No Name] [+] }{2:[No Name] [+] }|
|
]])
@@ -1693,17 +1412,7 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
{1: }{5:E}{4: }│{1: }{5:e}{4: }|
{1: }f │{1: }f |
{1: }g │{1: }g |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{8:[No Name] [+] }{2:[No Name] [+] }|
|
]])
@@ -1719,18 +1428,36 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
{1: }E │{1: }e |
{1: }f │{1: }f |
{1: }g │{1: }g |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{8:[No Name] [+] }{2:[No Name] [+] }|
|
]])
end)
+
+-- oldtest: Test_diff_breakindent_after_filler()
+it("diff mode draws 'breakindent' correctly after filler lines", function()
+ local screen = Screen.new(45, 8)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [1] = {background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue};
+ [2] = {background = Screen.colors.LightBlue};
+ [3] = {background = Screen.colors.LightCyan, bold = true, foreground = Screen.colors.Blue};
+ [4] = {foreground = Screen.colors.Blue, bold = true};
+ })
+ exec([[
+ set laststatus=0 diffopt+=followwrap breakindent
+ call setline(1, ['a', ' ' .. repeat('c', 50)])
+ vnew
+ call setline(1, ['a', 'b', ' ' .. repeat('c', 50)])
+ windo diffthis
+ norm! G$
+ ]])
+ screen:expect([[
+ {1: }a │{1: }a |
+ {1: }{2:b }│{1: }{3:--------------------}|
+ {1: } cccccccccccccccccc│{1: } cccccccccccccccccc|*2
+ {1: } cccccccccccccc │{1: } ccccccccccccc^c |
+ {4:~ }│{4:~ }|*2
+ |
+ ]])
+end)
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 3bc3af9853..072c9e89ce 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -38,10 +38,7 @@ local function test_embed(ext_linegrid)
it('can display errors', function()
startup('--cmd', 'echoerr invalid+')
screen:expect([[
- |
- |
- |
- |
+ |*4
{6: }|
{7:Error detected while processing pre-vimrc command line:} |
{7:E121: Undefined variable: invalid} |
@@ -51,12 +48,7 @@ local function test_embed(ext_linegrid)
feed('<cr>')
screen:expect([[
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*6
|
]])
end)
@@ -67,9 +59,7 @@ local function test_embed(ext_linegrid)
end
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
screen:expect([[
- |
- |
- |
+ |*3
{9: }|
{7:Error detected while processing pre-vimrc command line:} |
{7:foo} |
@@ -81,9 +71,7 @@ local function test_embed(ext_linegrid)
it("doesn't erase output when setting Normal colors", function()
startup('--cmd', 'echoerr "foo"', '--cmd', 'hi Normal guibg=Green', '--cmd', 'echoerr "bar"')
screen:expect{grid=[[
- |
- |
- |
+ |*3
{6: }|
{7:Error detected while processing pre-vimrc command line:} |
{7:foo} |
@@ -122,11 +110,7 @@ describe('--embed UI', function()
screen:expect{grid=[[
^hello nvim |
from external input |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
@@ -136,13 +120,43 @@ describe('--embed UI', function()
hello nvim |
^ |
from external input |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:-- INSERT --} |
]]}
end)
+
+ it("only sets background colors once even if overridden", function()
+ local screen, current, seen
+ local function handle_default_colors_set(_, _, rgb_bg, _, _, _)
+ seen[rgb_bg] = true
+ current = rgb_bg
+ end
+ local function startup(...)
+ seen = {}
+ current = nil
+ clear {args_rm={'--headless'}, args={...}}
+
+ -- attach immediately after startup, for early UI
+ screen = Screen.new(40, 8)
+ screen._handle_default_colors_set = handle_default_colors_set
+ screen:attach()
+ end
+
+ startup()
+ screen:expect{condition=function()
+ eq(16777215, current)
+ end}
+ eq({[16777215]=true}, seen)
+
+ -- NB: by accident how functional/helpers.lua currently handles the default color scheme, the
+ -- above is sufficient to test the behavior. But in case that workaround is removed, we need
+ -- a test with an explicit override like below, so do it to remain safe.
+ startup('--cmd', 'hi NORMAL guibg=#FF00FF')
+ screen:expect{condition=function()
+ eq(16711935, current)
+ end}
+ eq({[16711935]=true}, seen) -- we only saw the last one, despite 16777215 was set internally earlier
+ end)
end)
describe('--embed --listen UI', function()
@@ -175,9 +189,7 @@ describe('--embed --listen UI', function()
child_screen:attach(nil, child_session)
child_screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] 0,0-1 All}|
|
]], attr_ids={
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index eca8ee6422..5a78e2baa9 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -878,20 +878,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -904,8 +895,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1: }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -917,20 +907,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -941,10 +922,7 @@ describe('float window', function()
screen:expect([[
^ {1: } |
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end
@@ -953,31 +931,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
]])
else
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -992,27 +957,17 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
+ [2:-------------------]{5:│}[4:--------------------]|*5
{5:[No Name] }{4:[No Name] }|
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 5
{1: }|
{2:~ }|
@@ -1064,20 +1019,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1090,8 +1036,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1: }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -1103,20 +1048,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1127,10 +1063,7 @@ describe('float window', function()
screen:expect([[
^ {1: } |
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end
@@ -1139,31 +1072,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
]])
else
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -1191,20 +1111,13 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{14: 1 }^x |
{14: 2 }y |
{14: 3 } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
@@ -1230,36 +1143,25 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{14: 1 }^x |
{14: 2 }y |
{14: 3 } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
{18: 1 }{15: }|
- {16:~ }|
- {16:~ }|
- {16:~ }|
+ {16:~ }|*3
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
else
screen:expect([[
{14: 1 }^x |
{14: 2 }y |
{14: 3 } {18: 1 }{15: } |
- {0:~ }{16:~ }{0: }|
- {0:~ }{16:~ }{0: }|
- {0:~ }{16:~ }{0: }|
+ {0:~ }{16:~ }{0: }|*3
|
]])
end
@@ -1277,27 +1179,19 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{19: }{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
{15:x }|
{15:y }|
- {15: }|
- {15: }|
+ {15: }|*2
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
else
screen:expect{grid=[[
@@ -1305,8 +1199,7 @@ describe('float window', function()
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } {15:x } |
{0:~ }{15:y }{0: }|
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
+ {0:~ }{15: }{0: }|*2
|
]]}
end
@@ -1317,20 +1210,13 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{19: }{17:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
@@ -1358,36 +1244,24 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{19: }{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
- {15: }|
- {15: }|
- {15: }|
- {15: }|
+ {15: }|*4
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
else
screen:expect([[
{19: }{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } {15: } |
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
+ {0:~ }{15: }{0: }|*3
|
]])
end
@@ -1405,27 +1279,19 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{19: }{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
{15:x }|
{15:y }|
- {15: }|
- {15: }|
+ {15: }|*2
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
else
screen:expect{grid=[[
@@ -1433,8 +1299,7 @@ describe('float window', function()
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } {15:x } |
{0:~ }{15:y }{0: }|
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
+ {0:~ }{15: }{0: }|*2
|
]]}
end
@@ -1445,20 +1310,13 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{19: }{17:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
@@ -1486,36 +1344,24 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{19: }{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
- {15: }|
- {15: }|
- {15: }|
- {15: }|
+ {15: }|*4
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
else
screen:expect([[
{19: }{20: 1 }{22:^x}{21: }|
{19: }{14: 2 }{22:y} |
{19: }{14: 3 }{22: } {15: } |
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
+ {0:~ }{15: }{0: }|*3
|
]])
end
@@ -1534,27 +1380,19 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
{20:1}{19: }{20: }{22:^x}{21: }|
{14:2}{19: }{14: }{22:y} |
{14:3}{19: }{14: }{22: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
{15:x }|
{15:y }|
- {15: }|
- {15: }|
+ {15: }|*2
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
else
screen:expect{grid=[[
@@ -1562,8 +1400,7 @@ describe('float window', function()
{14:2}{19: }{14: }{22:y} |
{14:3}{19: }{14: }{22: } {15:x } |
{0:~ }{15:y }{0: }|
- {0:~ }{15: }{0: }|
- {0:~ }{15: }{0: }|
+ {0:~ }{15: }{0: }|*2
|
]]}
end
@@ -1578,20 +1415,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1621,20 +1449,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1664,20 +1483,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1707,20 +1517,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1751,20 +1552,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1794,20 +1586,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1825,8 +1608,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1: halloj! }{0: }|
{0:~ }{1: BORDAA }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end
@@ -1835,20 +1617,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1866,8 +1639,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{5:<}{1: halloj! }{5:>}{0: }|
{0:~ }{5:<}{1: BORDAA }{5:>}{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end
@@ -1876,20 +1648,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -1927,12 +1690,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
neeed some dummy |
@@ -2046,20 +1804,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2101,20 +1850,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2144,20 +1884,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2187,20 +1918,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2230,20 +1952,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2282,20 +1995,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2325,20 +2029,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2368,20 +2063,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2411,20 +2097,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2463,20 +2140,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2506,20 +2174,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2549,20 +2208,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2597,20 +2247,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -2643,31 +2284,17 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{5:┌────────────────────────────────────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*6
{5:└────────────────────────────────────────┘}|
]], float_pos={
[4] = { { id = 1001 }, "NW", 1, 0, 0, true, 201 }
@@ -2679,10 +2306,7 @@ describe('float window', function()
screen:expect{grid=[[
{5:^┌──────────────────────────────────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*4
{5:└──────────────────────────────────────┘}|
]]}
end
@@ -2699,26 +2323,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
|
## grid 4
@@ -2740,10 +2349,7 @@ describe('float window', function()
{0:~ }{5:║}{1:abb acc }{5:║}{0: }|
{0:~ }{5:║}{1:^ }{5:║}{0: }|
{0:~ }{5:╚═════════╝}{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
end
@@ -2752,26 +2358,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
{3:-- }{8:match 1 of 4} |
## grid 4
@@ -2811,26 +2402,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
|
## grid 4
@@ -2852,10 +2428,7 @@ describe('float window', function()
{0:~ }{5:║}{1:abb acc }{5:║}{0: }|
{0:~ }{5:║}{1:ac^c }{5:║}{0: }|
{0:~ }{5:╚═════════╝}{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
end
@@ -2869,26 +2442,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
:popup Test |
## grid 4
@@ -2917,8 +2475,7 @@ describe('float window', function()
{0:~ }{5:╚═}{1: foo }{5:═══╝}{0: }|
{0:~ }{1: bar }{0: }|
{0:~ }{1: baz }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:popup Test |
]]}
end
@@ -2935,20 +2492,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
1,1 All |
## grid 4
@@ -2966,9 +2514,7 @@ describe('float window', function()
{1:^aaa aab } |
{0:~ }{1:abb acc }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
1,1 All |
]]}
end
@@ -2977,20 +2523,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
1,5 All |
## grid 4
@@ -3008,9 +2545,7 @@ describe('float window', function()
{1:aaa ^aab } |
{0:~ }{1:abb acc }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
1,5 All |
]]}
end
@@ -3022,26 +2557,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
fish:<>< |
## grid 4
{1:^ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
]], float_pos={
[4] = {{id = 1001}, "NW", 1, 0, 5, true, 50};
}, win_viewport={
@@ -3051,11 +2576,8 @@ describe('float window', function()
else
screen:expect{grid=[[
{1:^ } |
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }{2:~ }{0: }|*2
+ {0:~ }|*3
fish:<>< |
]]}
end
@@ -3072,34 +2594,19 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
## grid 3
0,0-1 All |
## grid 4
{1: }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
## grid 5
{1:^ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
]], float_pos={
[5] = {{id = 1002}, "NW", 1, 0, 5, true, 50};
[4] = {{id = 1001}, "NW", 1, 0, 0, true, 50};
@@ -3111,13 +2618,8 @@ describe('float window', function()
else
screen:expect{grid=[[
{1: } {1:^ } |
- {2:~ }{0: }{2:~ }{0: }|
- {2:~ }{0: }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {2:~ }{0: }{2:~ }{0: }|*2
+ {0:~ }|*5
0,0-1 All |
]]}
end
@@ -3125,34 +2627,19 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
## grid 3
{3:-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)} |
## grid 4
{1: }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
## grid 5
{1:^ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
]], float_pos={
[5] = {{id = 1002}, "NW", 1, 0, 5, true, 50};
[4] = {{id = 1001}, "NW", 1, 0, 0, true, 50};
@@ -3164,13 +2651,8 @@ describe('float window', function()
else
screen:expect{grid=[[
{1: } {1:^ } |
- {2:~ }{0: }{2:~ }{0: }|
- {2:~ }{0: }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {2:~ }{0: }{2:~ }{0: }|*2
+ {0:~ }|*5
{3:-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)} |
]]}
end
@@ -3184,20 +2666,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
the background tex^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -3208,11 +2681,7 @@ describe('float window', function()
else
screen:expect([[
the {1:x}ackground tex^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -3221,20 +2690,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
the background tex^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -3245,11 +2705,7 @@ describe('float window', function()
else
screen:expect([[
the background {1:x}ex^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -3258,31 +2714,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
the background tex^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
]])
else
screen:expect([[
the background tex^t |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -3309,17 +2752,13 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [8:----------------------------------------]|
- [8:----------------------------------------]|
+ [8:----------------------------------------]|*2
{4:X6 }|
- [7:----------------------------------------]|
- [7:----------------------------------------]|
+ [7:----------------------------------------]|*2
{5:X5 }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*2
{5:X2 }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:X1 }|
[3:----------------------------------------]|
## grid 2
@@ -3471,13 +2910,9 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3511,13 +2946,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3554,13 +2985,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3597,13 +3024,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3640,13 +3063,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3683,13 +3102,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3726,13 +3141,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*3
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -3802,47 +3213,31 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*5
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
]])
else
screen:expect([[
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{5:[No Name] [+] }|
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:[No Name] [+] }|
|
]])
@@ -3856,33 +3251,21 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*5
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5
{5:╔═════════╗}|
{5:║}{1: halloj! }{5:║}|
@@ -3895,9 +3278,7 @@ describe('float window', function()
screen:expect([[
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{5:[No Name] [+] }|
just some exampl^e text |
some more exam{5:╔═════════╗} |
@@ -3913,33 +3294,21 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*5
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5
{5:╔═════════╗}|
{5:║}{1: halloj! }{5:║}|
@@ -3952,9 +3321,7 @@ describe('float window', function()
screen:expect([[
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{5:[No Name] [+] }|
jus{5:╔═════════╗}pl^e text |
som{5:║}{1: halloj! }{5:║}ple text |
@@ -3970,33 +3337,21 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*5
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5
{5:╔═════════╗}|
{5:║}{1: halloj! }{5:║}|
@@ -4015,9 +3370,7 @@ describe('float window', function()
{5:[No║}{1: BORDAA }{5:║ }|
jus{5:╚═════════╝}pl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:[No Name] [+] }|
|
]])
@@ -4027,33 +3380,21 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*5
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
just some example text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5
{5:╔═════════╗}|
{5:║}{1: halloj! }{5:║}|
@@ -4072,9 +3413,7 @@ describe('float window', function()
{5:[No Name] [+] ╚═════════╝ }|
just some exampl^e text |
some more example text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:[No Name] [+] }|
|
]])
@@ -4121,20 +3460,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
- |
- |
- |
+ |*3
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
## grid 3
|
## grid 5
@@ -4169,8 +3500,7 @@ describe('float window', function()
{1:5 } {1:1 } {1:6 } {1:2 } |
{1:3 } {1:4 } |
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -4197,20 +3527,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
- |
- |
- |
+ |*3
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
## grid 3
|
## grid 5
@@ -4245,8 +3567,7 @@ describe('float window', function()
{1:6 } {1:8 } {1:3 } {1:4 } |
{1:2 } {1:1 } |
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -4280,10 +3601,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*4
[3:------------------------------]|
## grid 2
^just some |
@@ -4298,8 +3616,7 @@ describe('float window', function()
^just some |
example text that is wider tha|
n the window |
- |
- |
+ |*2
]]}
end
@@ -4310,10 +3627,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*4
[3:------------------------------]|
## grid 2
^just some |
@@ -4343,16 +3657,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*4
[3:------------------------------]|
## grid 2
^example text that is wider tha|
n the window |
- |
- |
+ |*2
## grid 3
|
## grid 4
@@ -4365,8 +3675,7 @@ describe('float window', function()
^example text that is wider tha|
n the window |
{1:some info! } |
- |
- |
+ |*2
]]}
end
@@ -4375,15 +3684,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*4
[3:---------------------------------------------]|
## grid 2
^example text that is wider than the window |
- |
- |
+ |*2
more text |
## grid 3
|
@@ -4407,26 +3712,14 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*9
[3:-------------------------]|
## grid 2
^example text that is wide|
r than the window |
- |
- |
+ |*2
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -4441,10 +3734,7 @@ describe('float window', function()
{1:some info! } |
|
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
end
@@ -4453,26 +3743,14 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*9
[3:-------------------------]|
## grid 2
^example text that is wide|
r than the window |
- |
- |
+ |*2
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -4484,13 +3762,9 @@ describe('float window', function()
screen:expect{grid=[[
^example{1:some info! }s wide|
r than the window |
- |
- |
+ |*2
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
end
@@ -4500,15 +3774,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
- [2:----]{5:│}[5:--------------------]|
+ [2:----]{5:│}[5:--------------------]|*9
[3:-------------------------]|
## grid 2
exam|
@@ -4526,14 +3792,7 @@ describe('float window', function()
{1:some info! }|
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
]], float_pos={
[4] = { { id = 1001 }, "SW", 2, 8, 0, true }
}}
@@ -4557,26 +3816,14 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*9
[3:-------------------------]|
## grid 2
^example text that is wide|
r than the window |
- |
- |
+ |*2
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -4591,10 +3838,7 @@ describe('float window', function()
{1:some info! } |
|
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
end
@@ -4603,26 +3847,14 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*9
[3:-------------------------]|
## grid 2
^example text that is wide|
r than the window |
- |
- |
+ |*2
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -4637,10 +3869,7 @@ describe('float window', function()
|
{1:some info! } |
more text |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]]}
end
@@ -4649,26 +3878,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*9
[3:-------------------------]|
## grid 2
{28:^+-- 5 lines: just some··}|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
|
## grid 4
@@ -4681,12 +3895,7 @@ describe('float window', function()
{28:^+-- 5 lines: just some··}|
{0:~ }|
{1:some info! }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]]}
end
@@ -4699,25 +3908,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*4
[3:------------------------------]|
## grid 2
that is wider than the windo^w |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
]])
else
screen:expect([[
that is wider than the windo^w |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end
@@ -4728,16 +3930,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*4
[3:------------------------------]|
## grid 2
that is wider than the windo^w |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
@@ -4748,8 +3945,7 @@ describe('float window', function()
else
screen:expect([[
that is wider than the windo^w |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{0:~}{1:some floaty text }{0: }|
|
]])
@@ -4771,11 +3967,7 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
## grid 2
{1:^ }|
@@ -4786,8 +3978,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^ }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -4804,20 +3995,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -4842,16 +4024,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*4
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 3
|
## grid 4
@@ -4874,14 +4051,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*3
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
## grid 3
|
## grid 4
@@ -4903,8 +4077,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
[3:----------------------------------------]|
## grid 2
^ |
@@ -4928,8 +4101,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
[3:----------------------------------------]|
## grid 2
|
@@ -4954,20 +4126,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -4993,20 +4156,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5030,20 +4184,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------]|
- [2:--------------------------]|
- [2:--------------------------]|
- [2:--------------------------]|
- [2:--------------------------]|
- [2:--------------------------]|
+ [2:--------------------------]|*6
[3:--------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5067,20 +4212,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*6
[3:-------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5104,20 +4240,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:------------------------]|
- [2:------------------------]|
- [2:------------------------]|
- [2:------------------------]|
- [2:------------------------]|
- [2:------------------------]|
+ [2:------------------------]|*6
[3:------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5141,20 +4268,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------]|
- [2:----------------]|
- [2:----------------]|
- [2:----------------]|
- [2:----------------]|
- [2:----------------]|
+ [2:----------------]|*6
[3:----------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5178,20 +4296,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------]|
- [2:---------------]|
- [2:---------------]|
- [2:---------------]|
- [2:---------------]|
- [2:---------------]|
+ [2:---------------]|*6
[3:---------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5215,20 +4324,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------]|
- [2:--------------]|
- [2:--------------]|
- [2:--------------]|
- [2:--------------]|
- [2:--------------]|
+ [2:--------------]|*6
[3:--------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5252,20 +4352,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:------------]|
- [2:------------]|
- [2:------------]|
- [2:------------]|
- [2:------------]|
- [2:------------]|
+ [2:------------]|*6
[3:------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5312,20 +4403,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -5365,19 +4447,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] }|
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -5402,11 +4477,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[Preview] }|
[3:----------------------------------------]|
## grid 2
@@ -5435,19 +4506,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] }|
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -5483,27 +4547,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{7:^ }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}}
@@ -5512,9 +4565,7 @@ describe('float window', function()
|
{0:~ }|
{0:~ }{7:^ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
|
]])
end
@@ -5526,27 +4577,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
{7:x aa^ }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
## grid 5
{13: aa }|
{1: word }|
@@ -5571,27 +4611,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{7:x a^a }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}}
@@ -5601,9 +4630,7 @@ describe('float window', function()
|
{0:~ }|
{0:~ }{7:x a^a }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
|
]])
end
@@ -5613,27 +4640,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
xx^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
{7:x aa }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
## grid 5
{13:xx }|
{1:yy }|
@@ -5648,8 +4664,7 @@ describe('float window', function()
{13:xx }{0: }|
{1:yy }{7: }{0: }|
{1:zz }{12: }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*2
{3:-- INSERT --} |
]])
end
@@ -5658,27 +4673,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
xx^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
{7:x aa }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}}
@@ -5687,9 +4691,7 @@ describe('float window', function()
xx^ |
{0:~ }|
{0:~ }{7:x aa }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
{3:-- INSERT --} |
]])
end
@@ -5701,27 +4703,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sign un^ |
## grid 4
{7: }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
## grid 5
{1: undefine }|
{1: unplace }|
@@ -5750,27 +4741,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
{7:x aa^ }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}, popupmenu={
@@ -5781,9 +4761,7 @@ describe('float window', function()
|
{0:~ }|
{0:~ }{7:x aa^ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
{3:-- INSERT --} |
]], popupmenu={
anchor = {1, 2, 7}, items = items, pos = 0
@@ -5794,27 +4772,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{7:x a^a }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}}
@@ -5823,9 +4790,7 @@ describe('float window', function()
|
{0:~ }|
{0:~ }{7:x a^a }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
|
]])
end
@@ -5836,27 +4801,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
xx^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
{7:x aa }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}, popupmenu={
@@ -5867,9 +4821,7 @@ describe('float window', function()
xx^ |
{0:~ }|
{0:~ }{7:x aa }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
{3:-- INSERT --} |
]], popupmenu={
anchor = {1, 0, 0}, items = items, pos = 0
@@ -5880,27 +4832,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
xx^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
{7:x aa }|
- {12:~ }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*3
]], float_pos={
[4] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}}
@@ -5909,9 +4850,7 @@ describe('float window', function()
xx^ |
{0:~ }|
{0:~ }{7:x aa }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
- {0:~ }{12:~ }{0: }|
+ {0:~ }{12:~ }{0: }|*3
{3:-- INSERT --} |
]])
end
@@ -5927,20 +4866,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
@@ -5956,8 +4886,7 @@ describe('float window', function()
{13:aa }{0: }|
{1:word }{0: }|
{1:longtext }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- INSERT --} |
]])
end
@@ -5968,20 +4897,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
@@ -6001,8 +4921,7 @@ describe('float window', function()
{13:aa }{15:e info }{0: }|
{1:word }{15:ut item }{0: }|
{1:longtext }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- INSERT --} |
]])
end
@@ -6013,20 +4932,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 5
@@ -6040,9 +4950,7 @@ describe('float window', function()
aa^ |
{0:~ }{15:some info }{0: }|
{0:~ }{15:about item }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:-- INSERT --} |
]])
end
@@ -6051,31 +4959,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
]])
else
screen:expect([[
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
end
@@ -6086,20 +4981,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
@@ -6115,8 +5001,7 @@ describe('float window', function()
{13:aa }{0: }|
{1:word }{0: }|
{1:longtext }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- INSERT --} |
]])
end
@@ -6125,31 +5010,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
]])
else
screen:expect([[
aa^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{3:-- INSERT --} |
]])
end
@@ -6165,20 +5037,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6196,8 +5059,7 @@ describe('float window', function()
{0:~ }|
{0:~ }here {0: }|
{0:~ }float {0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end
@@ -6220,20 +5082,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6246,8 +5099,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6258,20 +5110,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6284,8 +5127,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6294,20 +5136,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6320,8 +5153,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6334,20 +5166,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
@@ -6360,8 +5183,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- INSERT --} |
]])
end
@@ -6370,20 +5192,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6396,8 +5209,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6408,20 +5220,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6434,8 +5237,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6444,20 +5246,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6470,8 +5263,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6482,20 +5274,11 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 4, 0, 0)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6509,8 +5292,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6519,20 +5301,11 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 2, 0, 0)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6546,8 +5319,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6561,20 +5333,12 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 4, 0, 0)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
a |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -6588,8 +5352,7 @@ describe('float window', function()
^a |
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6598,20 +5361,12 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 2, 0, 0)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
a |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -6625,8 +5380,7 @@ describe('float window', function()
a |
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6637,20 +5391,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- INSERT --} |
## grid 4
@@ -6663,8 +5408,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- INSERT --} |
]])
end
@@ -6673,20 +5417,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6699,8 +5434,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6709,20 +5443,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6735,8 +5460,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6748,20 +5472,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6774,8 +5489,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6784,34 +5498,23 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{1:^y }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
+ {0:~ }{2:~ }{0: }|*2
{0:~ }|
|
]])
@@ -6821,20 +5524,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6845,9 +5539,7 @@ describe('float window', function()
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end
@@ -6856,36 +5548,23 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{1:^y }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
+ {0:~ }{2:~ }{0: }|*3
|
]])
end
@@ -6894,38 +5573,21 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{1:^y }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
]], float_pos=expected_pos}
else
screen:expect([[
x {1:^y } |
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
- {0:~ }{2:~ }{0: }|
+ {0:~ }{2:~ }{0: }|*5
|
]])
end
@@ -6936,20 +5598,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6962,8 +5615,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -6972,20 +5624,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -6998,8 +5641,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -7008,20 +5650,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -7034,8 +5667,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -7044,20 +5676,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -7070,8 +5693,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -7080,20 +5702,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -7106,8 +5719,7 @@ describe('float window', function()
{0:~ }|
{1:^y }|
{2:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -7118,11 +5730,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{4:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7153,11 +5763,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{5:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7188,11 +5796,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{5:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7224,11 +5830,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{4:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7261,11 +5865,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{4:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7296,11 +5898,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{5:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7331,11 +5931,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{5:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7368,11 +5966,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{4:[No Name] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7405,11 +6001,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{4:[No Name] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7442,19 +6036,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
+ [5:--------------------]{5:│}[2:-------------------]|*5
{4:[No Name] [+] }{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -7462,10 +6049,7 @@ describe('float window', function()
{2:~ }|
## grid 5
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
else
screen:expect([[
@@ -7485,19 +6069,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
+ [5:--------------------]{5:│}[2:-------------------]|*5
{4:[No Name] }{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
:vnew |
## grid 4
@@ -7505,10 +6082,7 @@ describe('float window', function()
{2:~ }|
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
else
screen:expect([[
@@ -7528,19 +6102,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
- [5:--------------------]{5:│}[2:-------------------]|
+ [5:--------------------]{5:│}[2:-------------------]|*5
{4:[No Name] }{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
:vnew |
## grid 4
@@ -7548,10 +6115,7 @@ describe('float window', function()
{2:~ }|
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
else
screen:expect([[
@@ -7596,20 +6160,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -7638,20 +6193,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:quit |
## grid 4
@@ -7666,8 +6212,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:quit |
]])
end
@@ -7676,31 +6221,18 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:quit |
]])
else
screen:expect([[
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
:quit |
]])
end
@@ -7713,31 +6245,18 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
]]}
else
screen:expect([[
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -7748,20 +6267,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [3:----------------------------------------]|
- [3:----------------------------------------]|
- [3:----------------------------------------]|
+ [2:----------------------------------------]|*4
+ [3:----------------------------------------]|*3
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{7:E5601: Cannot close window, only floatin}|
{7:g window would remain} |
@@ -7787,20 +6297,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -7813,8 +6314,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -7825,11 +6325,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{4:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7860,31 +6358,18 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 3
|
## grid 5
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
]]}
else
screen:expect([[
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -7895,11 +6380,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{5:[No Name] [+] }|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -7930,13 +6413,10 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*2
{5:[No Name] [+] }|
[2:----------------------------------------]|
- [3:----------------------------------------]|
- [3:----------------------------------------]|
- [3:----------------------------------------]|
+ [3:----------------------------------------]|*3
## grid 2
x |
{0:~ }|
@@ -7969,11 +6449,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*2
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -8002,19 +6480,12 @@ describe('float window', function()
expected_pos = {[4]={external=true}}
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
@@ -8031,11 +6502,9 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*2
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -8055,20 +6524,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8093,11 +6553,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*2
{5:[No Name] [+] }|
- [4:----------------------------------------]|
- [4:----------------------------------------]|
+ [4:----------------------------------------]|*2
{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -8128,11 +6586,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [6:--------------------]{5:│}[5:-------------------]|
- [6:--------------------]{5:│}[5:-------------------]|
+ [6:--------------------]{5:│}[5:-------------------]|*2
{5:[No Name] [+] [No Name] [+] }|
- [7:--------------------]{5:│}[2:-------------------]|
- [7:--------------------]{5:│}[2:-------------------]|
+ [7:--------------------]{5:│}[2:-------------------]|*2
{4:[No Name] [+] }{5:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -8175,11 +6631,9 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [6:-------------------]{5:│}[5:--------------------]|
- [6:-------------------]{5:│}[5:--------------------]|
+ [6:-------------------]{5:│}[5:--------------------]|*2
{5:[No Name] [+] [No Name] [+] }|
- [7:-------------------]{5:│}[2:--------------------]|
- [7:-------------------]{5:│}[2:--------------------]|
+ [7:-------------------]{5:│}[2:--------------------]|*2
{5:[No Name] [+] [No Name] [+] }|
[3:----------------------------------------]|
## grid 2
@@ -8253,19 +6707,11 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
{9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*5
[3:----------------------------------------]|
## grid 2 (hidden)
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:tabnew |
## grid 4 (hidden)
@@ -8273,19 +6719,13 @@ describe('float window', function()
{2:~ }|
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]]}
else
screen:expect([[
{9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
:tabnew |
]])
end
@@ -8295,18 +6735,11 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
{3: }{11:2}{3:+ [No Name] }{9: [No Name] }{5: }{9:X}|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
:tabnext |
## grid 4
@@ -8314,10 +6747,7 @@ describe('float window', function()
{2:~ }|
## grid 5 (hidden)
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
else
screen:expect([[
@@ -8325,8 +6755,7 @@ describe('float window', function()
^x |
{0:~ }{1:y }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:tabnext |
]])
end
@@ -8336,18 +6765,11 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
{9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*5
[3:----------------------------------------]|
## grid 2 (hidden)
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
:tabnext |
## grid 4 (hidden)
@@ -8355,19 +6777,13 @@ describe('float window', function()
{2:~ }|
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]]}
else
screen:expect([[
{9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
:tabnext |
]])
end
@@ -8382,32 +6798,19 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
{9: + [No Name] }{3: }{11:2}{3:+ [No Name] }{5: }{9:X}|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*5
[3:----------------------------------------]|
## grid 2 (hidden)
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:tabnew |
## grid 4
y |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
else
eq("UI doesn't support external windows",
@@ -8419,31 +6822,19 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
{3: }{11:2}{3:+ [No Name] }{9: [No Name] }{5: }{9:X}|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*5
[3:----------------------------------------]|
## grid 2
^x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
:tabnext |
## grid 4
y |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5 (hidden)
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
end
@@ -8452,31 +6843,19 @@ describe('float window', function()
screen:expect{grid=[[
## grid 1
{9: + [No Name] }{3: }{11:2}{3:+ [No Name] }{5: }{9:X}|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
- [5:----------------------------------------]|
+ [5:----------------------------------------]|*5
[3:----------------------------------------]|
## grid 2 (hidden)
x |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
:tabnext |
## grid 4
y |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
## grid 5
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
]], float_pos=expected_pos}
end
end)
@@ -8489,20 +6868,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8519,20 +6889,11 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 4, 0, 0)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8549,20 +6910,11 @@ describe('float window', function()
meths.input_mouse('left', 'drag', '', 4, 1, 2)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- VISUAL --} |
## grid 4
@@ -8617,20 +6969,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8649,20 +6992,11 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 4, 1, 1)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8681,20 +7015,11 @@ describe('float window', function()
meths.input_mouse('left', 'drag', '', 4, 2, 3)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- VISUAL --} |
## grid 4
@@ -8752,20 +7077,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8783,20 +7099,11 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 4, 1, 0)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -8814,20 +7121,11 @@ describe('float window', function()
meths.input_mouse('left', 'drag', '', 4, 2, 2)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
{3:-- VISUAL --} |
## grid 4
@@ -8884,87 +7182,62 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
+ [2:-------------------]{5:│}[4:--------------------]|*5
{5:[No Name] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
^foo |
bar |
baz |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
]])
meths.input_mouse('left', 'press', '', 4, 2, 2)
screen:expect([[
## grid 1
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
+ [2:-------------------]{5:│}[4:--------------------]|*5
{5:[No Name] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
foo |
bar |
ba^z |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
]])
meths.input_mouse('left', 'drag', '', 4, 1, 1)
screen:expect([[
## grid 1
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
- [2:-------------------]{5:│}[4:--------------------]|
+ [2:-------------------]{5:│}[4:--------------------]|*5
{5:[No Name] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
{3:-- VISUAL --} |
## grid 4
foo |
b^a{27:r} |
{27:baz} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
]])
else
screen:expect([[
{5:│}^foo |
{0:~ }{5:│}bar |
{0:~ }{5:│}baz |
- {0:~ }{5:│}{0:~ }|
- {0:~ }{5:│}{0:~ }|
+ {0:~ }{5:│}{0:~ }|*2
{5:[No Name] }{4:[No Name] [+] }|
|
]])
@@ -8974,8 +7247,7 @@ describe('float window', function()
{5:│}foo |
{0:~ }{5:│}bar |
{0:~ }{5:│}ba^z |
- {0:~ }{5:│}{0:~ }|
- {0:~ }{5:│}{0:~ }|
+ {0:~ }{5:│}{0:~ }|*2
{5:[No Name] }{4:[No Name] [+] }|
|
]])
@@ -8985,8 +7257,7 @@ describe('float window', function()
{5:│}foo |
{0:~ }{5:│}b^a{27:r} |
{0:~ }{5:│}{27:baz} |
- {0:~ }{5:│}{0:~ }|
- {0:~ }{5:│}{0:~ }|
+ {0:~ }{5:│}{0:~ }|*2
{5:[No Name] }{4:[No Name] [+] }|
{3:-- VISUAL --} |
]])
@@ -9000,27 +7271,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{5:┌────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*3
{5:└────────────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "NW", 1, 0, 5, true, 50};
@@ -9031,9 +7291,7 @@ describe('float window', function()
else
screen:expect{grid=[[
^ {5:┌────────────────────┐} |
- {0:~ }{5:│}{1: }{5:│}{0: }|
- {0:~ }{5:│}{1: }{5:│}{0: }|
- {0:~ }{5:│}{1: }{5:│}{0: }|
+ {0:~ }{5:│}{1: }{5:│}{0: }|*3
{0:~ }{5:└────────────────────┘}{0: }|
{0:~ }|
|
@@ -9066,20 +7324,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -9110,20 +7359,11 @@ describe('float window', function()
meths.input_mouse('left', 'press', '', 4, 2, 1)
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -9220,14 +7460,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9263,14 +7496,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9307,14 +7533,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9359,14 +7578,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9402,14 +7614,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9446,14 +7651,7 @@ describe('float window', function()
meths.input_mouse('wheel', 'down', '', 4, 2, 2)
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9468,8 +7666,7 @@ describe('float window', function()
|
## grid 4
{11:popup text}{9: }|
- {12:~ }|
- {12:~ }|
+ {12:~ }|*2
]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}}
else
meths.input_mouse('wheel', 'down', '', 0, 4, 7)
@@ -9495,14 +7692,7 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
- [2:--------------------------------------------------]|
+ [2:--------------------------------------------------]|*8
[3:--------------------------------------------------]|
## grid 2
Ut enim ad minim veniam, quis nostrud |
@@ -9518,8 +7708,7 @@ describe('float window', function()
## grid 4
{17:┌}{23:Title}{17:──────────┐}|
{17:│}{11:popup text}{18: }{17:│}|
- {17:│}{19:~ }{17:│}|
- {17:│}{19:~ }{17:│}|
+ {17:│}{19:~ }{17:│}|*2
{17:└}{23:Footer}{17:─────────┘}|
]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}}
else
@@ -9547,25 +7736,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
# TODO: 测试字典信息的准确性 |
# FIXME: 测试字典信息的准确^性 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
## grid 4
- {1:口 }|
- {1:口 }|
+ {1:口 }|*2
{1: }|
]], float_pos={ [4] = { { id = 1001 }, "NW", 1, 0, 11, true } }}
else
@@ -9573,9 +7753,7 @@ describe('float window', function()
# TODO: 测 {1:口 }信息的准确性 |
# FIXME: 测{1:口 } 信息的准确^性 |
{0:~ }{1: }{0: }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end
@@ -9584,20 +7762,12 @@ describe('float window', function()
if multigrid then
screen:expect([[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
# TODO: 测试字典信息的准确性 |
# FIXME: 测试字典信息的准确^性 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
## grid 3
|
]])
@@ -9605,10 +7775,7 @@ describe('float window', function()
screen:expect([[
# TODO: 测试字典信息的准确性 |
# FIXME: 测试字典信息的准确^性 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end
@@ -9629,20 +7796,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
# TODO: 测试字典信息的准确性 |
# FIXME: 测试字典信息的准确^性 |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
## grid 3
|
## grid 5
@@ -9657,9 +7816,7 @@ describe('float window', function()
# TODO: 测 {2: x x x}{1:息}{2: xx} 确性 |
# FIXME: 测{1:试}{2:x x x}{1:息}{2: x}准确^性 |
{3:~ }{4: }{3: }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
|
]])
end
@@ -9668,20 +7825,12 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
# TODO: 测试字典信息的准确性 |
# FIXME: 测试字典信息的准确^性 |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
## grid 3
|
## grid 5
@@ -9696,9 +7845,7 @@ describe('float window', function()
# TODO: 测试{2: x x}{1:信}{2:x }{1:的}{2:xx}确性 |
# FIXME: 测 {2: x x}{1:信}{2:x }{1:的}{2:x} 确^性 |
{3:~ }{4: }{3: }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
|
]])
end
@@ -9735,20 +7882,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -9757,10 +7895,8 @@ describe('float window', function()
{2:longest}|
## grid 5
{2:---------}|
- {2:- -}|
- {2:- -}|
- {2: }|
- {2: }|
+ {2:- -}|*2
+ {2: }|*2
]], attr_ids={
[1] = {foreground = Screen.colors.Blue1, bold = true};
[2] = {background = Screen.colors.LightMagenta};
@@ -9803,20 +7939,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -9825,10 +7952,8 @@ describe('float window', function()
{2:n}|
## grid 5
{2:---}|
- {2:- -}|
- {2:- -}|
- {2: }|
- {2: }|
+ {2:- -}|*2
+ {2: }|*2
]], attr_ids={
[1] = {foreground = Screen.colors.Blue1, bold = true};
[2] = {background = Screen.colors.LightMagenta};
@@ -9857,20 +7982,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -9888,8 +8004,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{7: }{0: }|
{0:~ }{7:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end
@@ -9906,20 +8021,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -9962,20 +8068,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -9993,8 +8090,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{7: }{0: }|
{0:~ }{7:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end
@@ -10011,20 +8107,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -10071,34 +8158,22 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{7: }|
- {7:~ }|
- {7:~ }|
+ {7:~ }|*2
## grid 5
{17: }|
- {17:~ }|
- {17:~ }|
+ {17:~ }|*2
## grid 6
{8: }|
- {8:~ }|
- {8:~ }|
+ {8:~ }|*2
]], float_pos={
[4] = {{id = 1001}, "NW", 1, 1, 5, true, 30};
[5] = {{id = 1002}, "NW", 1, 2, 6, true, 50};
@@ -10130,20 +8205,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -10162,8 +8228,7 @@ describe('float window', function()
{0:~ }{3:floaty bar }{0: }|
{0:~ }{1: }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end
@@ -10174,28 +8239,18 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{5:┌───────────────┐}|
{5:│}{3:floaty bar }{5:│}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*2
{5:└───────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "NW", 1, 0, 4, true, 50};
@@ -10208,8 +8263,7 @@ describe('float window', function()
^ {5:┌───────────────┐} |
{0:~ }{5:│}{3:floaty bar }{5:│}{0: }|
{0:~ }{5:│}{1: }{5:│}{0: }|
- {0:~ }{5:│}{2:~ }{5:│}{0: }|
- {0:~ }{5:│}{2:~ }{5:│}{0: }|
+ {0:~ }{5:│}{2:~ }{5:│}{0: }|*2
{0:~ }{5:└───────────────┘}{0: }|
|
]]}
@@ -10225,32 +8279,14 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
## grid 4
{5:┌────────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*4
{5:└────────────────────────────────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "SW", 1, 9, 0, true, 50};
@@ -10261,13 +8297,9 @@ describe('float window', function()
else
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{5:┌──────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*4
{5:└──────────────────────────────────────┘}|
]]}
end
@@ -10281,30 +8313,14 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
## grid 4
{5:┌────────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*2
{5:└────────────────────────────────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "SW", 1, 9, 0, true, 50};
@@ -10315,13 +8331,9 @@ describe('float window', function()
else
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{5:┌──────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*2
{5:└──────────────────────────────────────┘}|
]]}
@@ -10331,25 +8343,10 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*9
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
## grid 3
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
@@ -10357,14 +8354,7 @@ describe('float window', function()
else
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
]]}
end
end)
@@ -10377,32 +8367,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*8
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
## grid 3
|
## grid 4
{5:┌────────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*4
{5:└────────────────────────────────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "SW", 1, 8, 0, true, 50};
@@ -10415,10 +8389,7 @@ describe('float window', function()
^ |
{0:~ }|
{5:┌──────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*4
{5:└──────────────────────────────────────┘}|
|
]]}
@@ -10436,33 +8407,17 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [3:----------------------------------------]|
- [3:----------------------------------------]|
+ [2:----------------------------------------]|*7
+ [3:----------------------------------------]|*2
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
## grid 3
|
{8:Press ENTER or type command to continue}^ |
## grid 4
{5:┌────────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*4
{5:└────────────────────────────────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "SW", 1, 8, 0, true, 50};
@@ -10475,9 +8430,7 @@ describe('float window', function()
|
{0:~ }|
{5:┌──────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*3
{4: }|
|
{8:Press ENTER or type command to continue}^ |
@@ -10488,30 +8441,16 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*8
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
## grid 3
|
## grid 4
{5:┌────────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*2
{5:└────────────────────────────────────────┘}|
]], float_pos={
[4] = {{id = 1001}, "SW", 1, 8, 0, true, 50};
@@ -10522,12 +8461,9 @@ describe('float window', function()
else
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{5:┌──────────────────────────────────────┐}|
- {5:│}{1: }{5:│}|
- {5:│}{1: }{5:│}|
+ {5:│}{1: }{5:│}|*2
{5:└──────────────────────────────────────┘}|
|
]]}
@@ -10537,24 +8473,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*8
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
## grid 3
|
]], win_viewport={
@@ -10563,13 +8486,7 @@ describe('float window', function()
else
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
|
]]}
end
@@ -10611,20 +8528,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sleep 100^ |
## grid 4
@@ -10643,8 +8551,7 @@ describe('float window', function()
{0:~}{1:ab }{0: }|
{0:~}{1:cd }{0: }|
{0:~}{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:sleep 100^ |
]]}
end
@@ -10653,20 +8560,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sleep 100 |
## grid 4
@@ -10685,8 +8583,7 @@ describe('float window', function()
{0:~}{1:ab }{0: }|
{0:~}{1:c^d }{0: }|
{0:~}{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:sleep 100 |
]]}
end
@@ -10698,20 +8595,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sleep 100^ |
## grid 4
@@ -10742,20 +8630,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sleep 100 |
## grid 4
@@ -10789,20 +8668,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sleep 100^ |
## grid 4
@@ -10833,20 +8703,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
:sleep 100 |
## grid 4
@@ -10884,20 +8745,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
@@ -10935,20 +8787,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
@@ -10959,11 +8802,7 @@ describe('float window', function()
else
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -10972,20 +8811,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
@@ -10999,8 +8829,7 @@ describe('float window', function()
{0:~ }|
{0:~ }{1: }{0: }|
{0:~ }{2:~ }{0: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end
@@ -11009,20 +8838,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
@@ -11033,11 +8853,7 @@ describe('float window', function()
else
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
@@ -11065,53 +8881,27 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{5:┌───────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*10
{5:└───────────┘}|
## grid 5
{5:┌────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*7
{5:└────────┘}|
## grid 6
{5:┌────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*3
{5:└────┘}|
## grid 7
{5:┌──┐}|
@@ -11136,63 +8926,35 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{5:┌───────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*10
{5:└───────────┘}|
## grid 5
{5:┌────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*7
{5:└────────┘}|
## grid 6
{5:┌────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*3
{5:└────┘}|
]], float_pos=expected_pos}
else
screen:expect([[
^ {5:┌─┌─┌────┐─┐┐} |
{0:~ }{5:│}{1: }{5:│}{1: }{5:│}{1: }{5:│}{1: }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }|
+ {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }|*3
{0:~ }{5:│}{2:~}{5:│}{2:~}{5:└────┘}{2: }{5:││}{0: }|
|
]])
@@ -11203,57 +8965,30 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
## grid 4
{5:┌───────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*10
{5:└───────────┘}|
## grid 5
{5:┌────────┐}|
{5:│}{1: }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
- {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|*7
{5:└────────┘}|
]], float_pos=expected_pos}
else
screen:expect([[
^ {5:┌─┌────────┐┐} |
{0:~ }{5:│}{1: }{5:│}{1: }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }|
- {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }|
+ {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }|*4
|
]])
end
@@ -11262,20 +8997,11 @@ describe('float window', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
- [2:----------------------------------------]|
+ [2:----------------------------------------]|*6
[3:----------------------------------------]|
## grid 2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
## grid 3
|
@@ -11283,11 +9009,7 @@ describe('float window', function()
else
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 1addf7088e..55197c75a8 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -60,34 +60,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7: }{5:^+-- 2 lines: ·············}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]])
else
screen:expect([[
{7: }{5:^+-- 2 lines: ·············}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end
@@ -101,22 +85,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+ }{8: 1 }{5:+-- 4 lines: This is a················}|
{6: }{9: 5 }{12:^in his cave. }|
{7: }{8: 6 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -125,10 +100,7 @@ describe("folded lines", function()
{7:+ }{8: 1 }{5:+-- 4 lines: This is a················}|
{6: }{9: 5 }{12:^in his cave. }|
{7: }{8: 6 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -136,22 +108,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{6:+ }{9: 1 }{13:^+-- 4 lines: This is a················}|
{7: }{8: 5 }in his cave. |
{7: }{8: 6 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -160,10 +123,7 @@ describe("folded lines", function()
{6:+ }{9: 1 }{13:^+-- 4 lines: This is a················}|
{7: }{8: 5 }in his cave. |
{7: }{8: 6 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -177,22 +137,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+ }{8: 1 }{13:^+-- 4 lines: This is a················}|
{7: }{8: 5 }in his cave. |
{7: }{8: 6 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -201,10 +152,7 @@ describe("folded lines", function()
{7:+ }{8: 1 }{13:^+-- 4 lines: This is a················}|
{7: }{8: 5 }in his cave. |
{7: }{8: 6 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -212,22 +160,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{6:+ }{9:1 }{5:^+-- 4 lines: This is a················}|
{7: }{8: 1 }in his cave. |
{7: }{8: 2 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -236,10 +175,7 @@ describe("folded lines", function()
{6:+ }{9:1 }{5:^+-- 4 lines: This is a················}|
{7: }{8: 1 }in his cave. |
{7: }{8: 2 } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -272,10 +208,7 @@ describe("folded lines", function()
{5:^+-- 4 lines: This is a······················}|
in his cave. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end
@@ -292,10 +225,7 @@ describe("folded lines", function()
{5:^+-- 4 lines: This is a······················}|
in his cave. |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end
@@ -318,13 +248,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:▾▾}^aa |
@@ -354,13 +278,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
a^a{7:▾▾}|
@@ -391,22 +309,12 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 0, 1)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:▾▸}{5:^+--- 5 lines: aa··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
:set norightleft |
]])
@@ -415,11 +323,7 @@ describe("folded lines", function()
screen:expect([[
{7:▾▸}{5:^+--- 5 lines: aa··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:set norightleft |
]])
end
@@ -428,22 +332,11 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 0, 0)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:▸ }{5:^+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
:set norightleft |
]])
@@ -451,12 +344,7 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[
{7:▸ }{5:^+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
:set norightleft |
]])
end
@@ -467,22 +355,13 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 1, 0)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{11:!!!!!! }|
{7:▾▸}{5:^+--- 5 lines: aa··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:set norightleft |
]])
@@ -492,10 +371,7 @@ describe("folded lines", function()
{11:!!!!!! }|
{7:▾▸}{5:^+--- 5 lines: aa··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:set norightleft |
]])
end
@@ -504,13 +380,7 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 1, 1)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{11:!!!!!! }|
@@ -569,12 +439,9 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 4, 0, 0)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*2
{2:[No Name] [+] }|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*3
{3:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
@@ -605,12 +472,9 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 4, 1, 0)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*2
{2:[No Name] [+] }|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*3
{3:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
@@ -641,12 +505,9 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 1, 0)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*2
{3:[No Name] [+] }|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*3
{2:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
@@ -677,12 +538,9 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 0, 0)
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*2
{3:[No Name] [+] }|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*3
{2:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
@@ -741,12 +599,7 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 4, 0, 0)
screen:expect([[
## grid 1
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
+ [2:----------------------]{2:│}[4:----------------------]|*6
{2:[No Name] [+] }{3:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
@@ -762,9 +615,7 @@ describe("folded lines", function()
{7:-}^aa |
{7:+}{5:+--- 4 lines: bb····}|
{7:│}ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]])
else
meths.input_mouse('left', 'press', '', 0, 0, 23)
@@ -784,12 +635,7 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 4, 1, 0)
screen:expect([[
## grid 1
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
+ [2:----------------------]{2:│}[4:----------------------]|*6
{2:[No Name] [+] }{3:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
@@ -827,21 +673,14 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 1, 0)
screen:expect([[
## grid 1
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
+ [2:----------------------]{2:│}[4:----------------------]|*6
{3:[No Name] [+] }{2:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
{7:-}aa |
{7:+}{5:^+--- 4 lines: bb····}|
{7:│}ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
:1 |
## grid 4
@@ -870,21 +709,12 @@ describe("folded lines", function()
meths.input_mouse('left', 'press', '', 2, 0, 0)
screen:expect([[
## grid 1
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
- [2:----------------------]{2:│}[4:----------------------]|
+ [2:----------------------]{2:│}[4:----------------------]|*6
{3:[No Name] [+] }{2:[No Name] [+] }|
[3:---------------------------------------------]|
## grid 2
{7:+}{5:^+-- 6 lines: aa·····}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
:1 |
## grid 4
@@ -930,12 +760,7 @@ describe("folded lines", function()
screen:expect([[
## grid 1
{10: + [No Name] }{11: + [No Name] }{2: }{10:X}|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*6
[3:---------------------------------------------]|
## grid 2 (hidden)
{7:- }aa |
@@ -951,9 +776,7 @@ describe("folded lines", function()
{7:- }^aa |
{7:│+}{5:+--- 4 lines: bb··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]])
else
meths.input_mouse('left', 'press', '', 0, 2, 1)
@@ -962,9 +785,7 @@ describe("folded lines", function()
{7:- }^aa |
{7:│+}{5:+--- 4 lines: bb··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:tab split |
]])
end
@@ -974,12 +795,7 @@ describe("folded lines", function()
screen:expect([[
## grid 1
{10: + [No Name] }{11: + [No Name] }{2: }{10:X}|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*6
[3:---------------------------------------------]|
## grid 2 (hidden)
{7:- }aa |
@@ -993,22 +809,14 @@ describe("folded lines", function()
:tab split |
## grid 4
{7:+ }{5:^+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]])
else
meths.input_mouse('left', 'press', '', 0, 1, 0)
screen:expect([[
{10: + [No Name] }{11: + [No Name] }{2: }{10:X}|
{7:+ }{5:^+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:tab split |
]])
end
@@ -1019,29 +827,18 @@ describe("folded lines", function()
screen:expect([[
## grid 1
{11: + [No Name] }{10: + [No Name] }{2: }{10:X}|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*6
[3:---------------------------------------------]|
## grid 2
{7:- }^aa |
{7:│+}{5:+--- 4 lines: bb··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
:tabnext |
## grid 4 (hidden)
{7:+ }{5:+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]])
else
meths.input_mouse('left', 'press', '', 0, 2, 1)
@@ -1050,9 +847,7 @@ describe("folded lines", function()
{7:- }^aa |
{7:│+}{5:+--- 4 lines: bb··························}|
{7:│ }ff |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:tabnext |
]])
end
@@ -1062,40 +857,23 @@ describe("folded lines", function()
screen:expect([[
## grid 1
{11: + [No Name] }{10: + [No Name] }{2: }{10:X}|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*6
[3:---------------------------------------------]|
## grid 2
{7:+ }{5:^+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
:tabnext |
## grid 4 (hidden)
{7:+ }{5:+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]])
else
meths.input_mouse('left', 'press', '', 0, 1, 0)
screen:expect([[
{11: + [No Name] }{10: + [No Name] }{2: }{10:X}|
{7:+ }{5:^+-- 6 lines: aa···························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:tabnext |
]])
end
@@ -1109,22 +887,12 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ ﺎﻠﻋَﺮَﺒِﻳَّﺓ |
möre tex^t |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
]])
@@ -1132,11 +900,7 @@ describe("folded lines", function()
screen:expect([[
å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ ﺎﻠﻋَﺮَﺒِﻳَّﺓ |
möre tex^t |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end
@@ -1145,34 +909,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:^+-- 2 lines: å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ ﺎﻠﻋَﺮَﺒِﻳَّﺓ·················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]])
else
screen:expect([[
{5:^+-- 2 lines: å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ ﺎﻠﻋَﺮَﺒِﻳَّﺓ·················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end
@@ -1181,34 +929,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:^+-- 2 lines: å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ العَرَبِيَّة·················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
:set noarabicshape |
]])
else
screen:expect([[
{5:^+-- 2 lines: å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ العَرَبِيَّة·················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
:set noarabicshape |
]])
end
@@ -1217,34 +949,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+ }{8: 1 }{5:^+-- 2 lines: å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ العَرَبِيَّة···········}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
:set number foldcolumn=2 |
]])
else
screen:expect([[
{7:+ }{8: 1 }{5:^+-- 2 lines: å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ العَرَبِيَّة···········}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
:set number foldcolumn=2 |
]])
end
@@ -1254,34 +970,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:···········ةيَّبِرَعَلا x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å :senil 2 --^+}{8: 1 }{7: +}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*6
## grid 3
:set rightleft |
]])
else
screen:expect([[
{5:···········ةيَّبِرَعَلا x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å :senil 2 --^+}{8: 1 }{7: +}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*6
:set rightleft |
]])
end
@@ -1290,34 +990,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:·················ةيَّبِرَعَلا x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å :senil 2 --^+}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*6
## grid 3
:set nonumber foldcolumn=0 |
]])
else
screen:expect([[
{5:·················ةيَّبِرَعَلا x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å :senil 2 --^+}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*6
:set nonumber foldcolumn=0 |
]])
end
@@ -1326,34 +1010,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:·················ﺔﻴَّﺑِﺮَﻌَﻟﺍ x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å :senil 2 --^+}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*6
## grid 3
:set arabicshape |
]])
else
screen:expect([[
{5:·················ﺔﻴَّﺑِﺮَﻌَﻟﺍ x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å :senil 2 --^+}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*6
:set arabicshape |
]])
end
@@ -1362,22 +1030,12 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
ﺔﻴَّﺑِﺮَﻌَ^ﻟﺍ x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å|
txet eröm|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*5
## grid 3
:set arabicshape |
]])
@@ -1385,11 +1043,7 @@ describe("folded lines", function()
screen:expect([[
ﺔﻴَّﺑِﺮَﻌَ^ﻟﺍ x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å|
txet eröm|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*5
:set arabicshape |
]])
end
@@ -1398,22 +1052,12 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
ةيَّبِرَعَ^لا x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å|
txet eröm|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*5
## grid 3
:set noarabicshape |
]])
@@ -1421,11 +1065,7 @@ describe("folded lines", function()
screen:expect([[
ةيَّبِرَعَ^لا x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢ 语 å|
txet eröm|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*5
:set noarabicshape |
]])
end
@@ -1444,10 +1084,7 @@ describe("folded lines", function()
## grid 1
[2:---------------------------------------------]|
{2:[No Name] }|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*4
{3:[Command Line] }|
[3:---------------------------------------------]|
## grid 2
@@ -1479,10 +1116,7 @@ describe("folded lines", function()
## grid 1
[2:---------------------------------------------]|
{2:[No Name] }|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
- [4:---------------------------------------------]|
+ [4:---------------------------------------------]|*4
{3:[Command Line] }|
[3:---------------------------------------------]|
## grid 2
@@ -1492,8 +1126,7 @@ describe("folded lines", function()
## grid 4
{1::}{5:^+-- 2 lines: set foldmethod=manual·········}|
{1::} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]])
else
screen:expect([[
@@ -1501,8 +1134,7 @@ describe("folded lines", function()
{2:[No Name] }|
{1::}{5:^+-- 2 lines: set foldmethod=manual·········}|
{1::} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[Command Line] }|
: |
]])
@@ -1512,34 +1144,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
: |
]])
else
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
: |
]])
end
@@ -1550,10 +1166,7 @@ describe("folded lines", function()
## grid 1
[2:---------------------------------------------]|
{2:[No Name] }|
- [5:---------------------------------------------]|
- [5:---------------------------------------------]|
- [5:---------------------------------------------]|
- [5:---------------------------------------------]|
+ [5:---------------------------------------------]|*4
{3:[Command Line] }|
[3:---------------------------------------------]|
## grid 2
@@ -1585,10 +1198,7 @@ describe("folded lines", function()
## grid 1
[2:---------------------------------------------]|
{2:[No Name] }|
- [5:---------------------------------------------]|
- [5:---------------------------------------------]|
- [5:---------------------------------------------]|
- [5:---------------------------------------------]|
+ [5:---------------------------------------------]|*4
{3:[Command Line] }|
[3:---------------------------------------------]|
## grid 2
@@ -1597,18 +1207,14 @@ describe("folded lines", function()
/ |
## grid 5
{1:/}{5:^+-- 3 lines: alpha·························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]])
else
screen:expect([[
|
{2:[No Name] }|
{1:/}{5:^+-- 3 lines: alpha·························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3:[Command Line] }|
/ |
]])
@@ -1628,22 +1234,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:^+-- 2 lines: line 1·························}|
line 3 |
line 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -1652,10 +1249,7 @@ describe("folded lines", function()
{5:^+-- 2 lines: line 1·························}|
line 3 |
line 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -1664,22 +1258,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+}{5:^+-- 2 lines: line 1························}|
{7: }line 3 |
{7: }line 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -1688,10 +1273,7 @@ describe("folded lines", function()
{7:+}{5:^+-- 2 lines: line 1························}|
{7: }line 3 |
{7: }line 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -1699,22 +1281,13 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+}{5:^+-- 2 lines: line 1························}|
{7: }line 3 |
{7: }line 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]], unchanged=true}
@@ -1723,10 +1296,7 @@ describe("folded lines", function()
{7:+}{5:^+-- 2 lines: line 1························}|
{7: }line 3 |
{7: }line 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]], unchanged=true}
end
@@ -1736,34 +1306,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+}{5:^+-- 4 lines: line 1························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]])
else
screen:expect([[
{7:+}{5:^+-- 4 lines: line 1························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end
@@ -1771,34 +1325,18 @@ describe("folded lines", function()
command("set foldcolumn=auto:1")
if multigrid then screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+}{5:^+-- 4 lines: line 1························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]], unchanged=true}
else
screen:expect{grid=[[
{7:+}{5:^+-- 4 lines: line 1························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]], unchanged=true}
end
@@ -1809,34 +1347,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{7:+ }{5:^+-- 4 lines: line 1·······················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]])
else
screen:expect([[
{7:+ }{5:^+-- 4 lines: line 1·······················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end
@@ -1854,34 +1376,18 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:^---------------------------------------------}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]])
else
screen:expect([[
{5:^---------------------------------------------}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end
@@ -1904,17 +1410,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*11
[3:---------------------------------------------]|
## grid 2
|
@@ -1926,8 +1422,7 @@ describe("folded lines", function()
Line7 |
{5:+-- 2 lines: Line8··························}|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
]])
@@ -1942,8 +1437,7 @@ describe("folded lines", function()
Line7 |
{5:+-- 2 lines: Line8··························}|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end
@@ -1957,13 +1451,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{8: 1 }^This is a |
@@ -1971,8 +1459,7 @@ describe("folded lines", function()
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
{8: 5 }in his cave. |
{8: 6 } |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
]])
@@ -1983,8 +1470,7 @@ describe("folded lines", function()
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
{8: 5 }in his cave. |
{8: 6 } |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end
@@ -1993,13 +1479,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{8: 1 }^his is a |
@@ -2007,8 +1487,7 @@ describe("folded lines", function()
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
{8: 5 }n his cave. |
{8: 6 } |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
]])
@@ -2019,8 +1498,7 @@ describe("folded lines", function()
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
{8: 5 }n his cave. |
{8: 6 } |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end
@@ -2040,13 +1518,7 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:^+-- 2 lines: line 1·························}|
@@ -2054,8 +1526,7 @@ describe("folded lines", function()
line 3 |
line 4 |
virt_line below line 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
]], win_viewport={
@@ -2068,8 +1539,7 @@ describe("folded lines", function()
line 3 |
line 4 |
virt_line below line 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end
@@ -2078,22 +1548,12 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:+-- 2 lines: line 1·························}|
{5:^+-- 2 lines: line 3·························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
]], win_viewport={
@@ -2103,11 +1563,7 @@ describe("folded lines", function()
screen:expect([[
{5:+-- 2 lines: line 1·························}|
{5:^+-- 2 lines: line 3·························}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end
@@ -2117,13 +1573,7 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
virt_line above line 1 |
@@ -2168,13 +1618,7 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
line 1 |
@@ -2206,13 +1650,7 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
line 2 |
@@ -2220,8 +1658,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
]], win_viewport={
@@ -2234,8 +1671,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end
@@ -2244,22 +1680,14 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
virt_line below line 2 |
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
]], win_viewport={
@@ -2271,9 +1699,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end
@@ -2282,22 +1708,13 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]], win_viewport={
@@ -2308,10 +1725,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -2320,22 +1734,12 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
]], win_viewport={
@@ -2345,11 +1749,7 @@ describe("folded lines", function()
screen:expect([[
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end
@@ -2358,22 +1758,11 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
|
]], win_viewport={
@@ -2382,12 +1771,7 @@ describe("folded lines", function()
else
screen:expect([[
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end
@@ -2396,22 +1780,14 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
virt_line below line 2 |
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
]], win_viewport={
@@ -2423,9 +1799,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^line 5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end
@@ -2434,22 +1808,14 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
virt_line below line 2 |
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^l{16:ine 5} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{11:-- VISUAL LINE --} |
]], win_viewport={
@@ -2461,9 +1827,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^l{16:ine 5} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{11:-- VISUAL LINE --} |
]])
end
@@ -2472,22 +1836,13 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^l{16:ine 5} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
{11:-- VISUAL LINE --} |
]], win_viewport={
@@ -2498,10 +1853,7 @@ describe("folded lines", function()
more virt_line below line 2 |
{5:+-- 2 lines: line 3·························}|
^l{16:ine 5} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{11:-- VISUAL LINE --} |
]])
end
@@ -2510,22 +1862,12 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{5:+-- 2 lines: line 3·························}|
{16:line }^5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
{11:-- VISUAL LINE --} |
]], win_viewport={
@@ -2535,11 +1877,7 @@ describe("folded lines", function()
screen:expect([[
{5:+-- 2 lines: line 3·························}|
{16:line }^5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{11:-- VISUAL LINE --} |
]])
end
@@ -2549,10 +1887,7 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*4
{3:[No Name] [+] }|
[4:---------------------------------------------]|
{2:[No Name] [+] }|
@@ -2587,10 +1922,7 @@ describe("folded lines", function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*4
{3:[No Name] [+] }|
[4:---------------------------------------------]|
{2:[No Name] [+] }|
@@ -2640,13 +1972,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{14:" foofoofoofoofo}ofoo |
@@ -2654,8 +1980,7 @@ describe("folded lines", function()
{14:" barbarbarbarba}rbar |
{15:+-- 3 lines: " }{5:口···························}|
{14:" bazbazbazbazb}^azbaz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL BLOCK --} |
]])
@@ -2666,8 +1991,7 @@ describe("folded lines", function()
{14:" barbarbarbarba}rbar |
{15:+-- 3 lines: " }{5:口···························}|
{14:" bazbazbazbazb}^azbaz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL BLOCK --} |
]])
end
@@ -2676,13 +2000,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{14:" foofoofoofoofoo}foo |
@@ -2690,8 +2008,7 @@ describe("folded lines", function()
{14:" barbarbarbarbar}bar |
{15:+-- 3 lines: " 口}{5:···························}|
{14:" bazbazbazbazba}^zbaz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL BLOCK --} |
]])
@@ -2702,8 +2019,7 @@ describe("folded lines", function()
{14:" barbarbarbarbar}bar |
{15:+-- 3 lines: " 口}{5:···························}|
{14:" bazbazbazbazba}^zbaz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL BLOCK --} |
]])
end
@@ -2712,13 +2028,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{14:" foofoofoofoofoof}oo |
@@ -2726,8 +2036,7 @@ describe("folded lines", function()
{14:" barbarbarbarbarb}ar |
{15:+-- 3 lines: " 口}{5:···························}|
{14:" bazbazbazbazbaz}^baz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL BLOCK --} |
]])
@@ -2738,8 +2047,7 @@ describe("folded lines", function()
{14:" barbarbarbarbarb}ar |
{15:+-- 3 lines: " 口}{5:···························}|
{14:" bazbazbazbazbaz}^baz |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL BLOCK --} |
]])
end
@@ -2748,13 +2056,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{14:" foofoofoofoofoofoo} |
@@ -2762,8 +2064,7 @@ describe("folded lines", function()
{14:" barbarbarbarbarbar} |
{15:+-- 3 lines: " 口··}{5:·························}|
{14:" bazbazbazbazbazba}^z |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL BLOCK --} |
]])
@@ -2774,8 +2075,7 @@ describe("folded lines", function()
{14:" barbarbarbarbarbar} |
{15:+-- 3 lines: " 口··}{5:·························}|
{14:" bazbazbazbazbazba}^z |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL BLOCK --} |
]])
end
@@ -2784,13 +2084,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
" foofoofoofoofo{14:ofoo} |
@@ -2798,8 +2092,7 @@ describe("folded lines", function()
" barbarbarbarba{14:rbar} |
{5:+-- 3 lines: " }{15:口··}{5:·························}|
" bazbazbazbazba^z{14:baz} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL BLOCK --} |
]])
@@ -2810,8 +2103,7 @@ describe("folded lines", function()
" barbarbarbarba{14:rbar} |
{5:+-- 3 lines: " }{15:口··}{5:·························}|
" bazbazbazbazba^z{14:baz} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL BLOCK --} |
]])
end
@@ -2820,13 +2112,7 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
" foofoofoofoofoo{14:foo} |
@@ -2834,8 +2120,7 @@ describe("folded lines", function()
" barbarbarbarbar{14:bar} |
{5:+-- 3 lines: " }{15:口··}{5:·························}|
" bazbazbazbazbaz^b{14:az} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL BLOCK --} |
]])
@@ -2846,8 +2131,7 @@ describe("folded lines", function()
" barbarbarbarbar{14:bar} |
{5:+-- 3 lines: " }{15:口··}{5:·························}|
" bazbazbazbazbaz^b{14:az} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL BLOCK --} |
]])
end
@@ -2864,22 +2148,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{2:line} 1 |
{5:+-- 2 lines: line 2·························}|
{6:line} 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
/line^ |
]])
@@ -2888,10 +2163,7 @@ describe("folded lines", function()
{2:line} 1 |
{5:+-- 2 lines: line 2·························}|
{6:line} 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
/line^ |
]])
end
@@ -2900,22 +2172,13 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
- [2:---------------------------------------------]|
+ [2:---------------------------------------------]|*7
[3:---------------------------------------------]|
## grid 2
{6:line} 1 |
{5:+-- 2 lines: line 2·························}|
{6:line} ^4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -2924,10 +2187,7 @@ describe("folded lines", function()
{6:line} 1 |
{5:+-- 2 lines: line 2·························}|
{6:line} ^4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -2953,20 +2213,12 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*6
[3:------------------------------]|
## grid 2
{7: }This is a |
{7:+ }{4:^▶}{13:-}{17: }{18:valid English}{13:·····}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]])
@@ -2974,10 +2226,7 @@ describe("folded lines", function()
screen:expect([[
{7: }This is a |
{7:+ }{4:^▶}{13:-}{17: }{18:valid English}{13:·····}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end
@@ -2987,20 +2236,14 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*6
[3:------------------------------]|
## grid 2
{7: }This is a |
{7:- }valid English |
{7:│+ }{4:▶}{5:--}{19: }{18:sentence composed }|
{7:│+ }{4:^▶}{13:--}{17: }{18:in his cave.}{13:······}|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
]])
@@ -3010,8 +2253,7 @@ describe("folded lines", function()
{7:- }valid English |
{7:│+ }{4:▶}{5:--}{19: }{18:sentence composed }|
{7:│+ }{4:^▶}{13:--}{17: }{18:in his cave.}{13:······}|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end
@@ -3023,20 +2265,14 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*6
[3:------------------------------]|
## grid 2
{7: }This is a |
{7:- }^v{14:alid English} |
{7:│+ }{4:▶}{15:--}{19: }{20:sentence composed }|
{7:│+ }{4:▶}{15:--}{19: }{20:in his cave.}{15:······}|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{11:-- VISUAL LINE --} |
]])
@@ -3046,8 +2282,7 @@ describe("folded lines", function()
{7:- }^v{14:alid English} |
{7:│+ }{4:▶}{15:--}{19: }{20:sentence composed }|
{7:│+ }{4:▶}{15:--}{19: }{20:in his cave.}{15:······}|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{11:-- VISUAL LINE --} |
]])
end
@@ -3056,20 +2291,14 @@ describe("folded lines", function()
if multigrid then
screen:expect([[
## grid 1
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
- [2:------------------------------]|
+ [2:------------------------------]|*6
[3:------------------------------]|
## grid 2
a si sihT{7: }|
{14:hsilgnE dila}^v{7: -}|
{20: desopmoc ecnetnes}{19: }{15:--}{4:▶}{7: +│}|
{15:······}{20:.evac sih ni}{19: }{15:--}{4:▶}{7: +│}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
## grid 3
{11:-- VISUAL LINE --} |
]])
@@ -3079,8 +2308,7 @@ describe("folded lines", function()
{14:hsilgnE dila}^v{7: -}|
{20: desopmoc ecnetnes}{19: }{15:--}{4:▶}{7: +│}|
{15:······}{20:.evac sih ni}{19: }{15:--}{4:▶}{7: +│}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
{11:-- VISUAL LINE --} |
]])
end
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 7776e024b0..f5df11115c 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -58,9 +58,7 @@ describe('highlight: `:syntax manual`', function()
feed_command('bp')
screen:expect([[
{1:^echo} 1 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
:bp |
]])
end)
@@ -82,9 +80,7 @@ describe('highlight: `:syntax manual`', function()
eq("Xtest-functional-ui-highlight.tmp.vim", eval("fnamemodify(bufname('%'), ':t')"))
screen:expect([[
{1:^echo} 1 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
:silent bp |
]])
end)
@@ -116,17 +112,10 @@ describe('highlight defaults', function()
feed_command('sp', 'vsp', 'vsp')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{1:[No Name] }{2:[No Name] [No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:[No Name] }|
:vsp |
]])
@@ -134,17 +123,10 @@ describe('highlight defaults', function()
feed('<c-w>j')
screen:expect([[
│ │ |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{2:[No Name] [No Name] [No Name] }|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{1:[No Name] }|
:vsp |
]])
@@ -154,51 +136,30 @@ describe('highlight defaults', function()
feed('<c-w>k<c-w>l')
screen:expect([[
│^ │ |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{2:[No Name] }{1:[No Name] }{2:[No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:[No Name] }|
:vsp |
]])
feed('<c-w>l')
screen:expect([[
│ │^ |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{2:[No Name] [No Name] }{1:[No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:[No Name] }|
:vsp |
]])
feed('<c-w>h<c-w>h')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{1:[No Name] }{2:[No Name] [No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{2:[No Name] }|
:vsp |
]])
@@ -209,8 +170,7 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:-- INSERT --} |
]])
end)
@@ -219,8 +179,7 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -243,8 +202,7 @@ describe('highlight defaults', function()
feed('i')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
-- INSERT -- |
]])
feed('<esc>')
@@ -253,8 +211,7 @@ describe('highlight defaults', function()
feed('i')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{5:-- INSERT --} |
]])
end)
@@ -266,16 +223,14 @@ describe('highlight defaults', function()
insert('neovim')
screen:expect([[
{6:neovi^m} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed_command("hi ErrorMsg term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE"
.. " gui=NONE guifg=NONE guibg=NONE guisp=NONE")
screen:expect([[
neovi^m |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -284,16 +239,14 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed_command("hi NonTextAlt guifg=Red")
feed_command("hi! link NonText NonTextAlt")
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:hi! link NonText NonTextAlt |
]], {[0] = {foreground=Screen.colors.Red}})
end)
@@ -310,15 +263,13 @@ describe('highlight defaults', function()
insert(' ne \t o\tv im ')
screen:expect([[
ne{7:.>----.}o{7:>-----}v{7:..}im{7:*^*¬} |
- {7:~ }|
- {7:~ }|
+ {7:~ }|*2
|
]])
feed_command('highlight Whitespace gui=NONE guifg=#0000FF')
screen:expect([[
ne{8:.>----.}o{8:>-----}v{8:..}im{8:*^*}{7:¬} |
- {7:~ }|
- {7:~ }|
+ {7:~ }|*2
:highlight Whitespace gui=NONE guifg=#0000FF |
]])
end)
@@ -327,24 +278,21 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], hl_groups={EndOfBuffer=0, MsgSeparator=1}}
command('highlight EndOfBuffer gui=italic')
screen:expect{grid=[[
^ |
- {9:~ }|
- {9:~ }|
+ {9:~ }|*2
|
]], hl_groups={EndOfBuffer=9, MsgSeparator=1}}
command('highlight clear EndOfBuffer')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], hl_groups={EndOfBuffer=0, MsgSeparator=1}}
end)
@@ -452,11 +400,9 @@ describe('highlight', function()
foobar
]])
screen:expect{grid=[[
- {1:foobar} |
- {1:foobar} |
+ {1:foobar} |*2
^ |
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
|
]]}
@@ -465,8 +411,7 @@ describe('highlight', function()
{3:foo}{1:bar} |
{4:foo}{1:bar} |
|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
/foo^ |
]]}
feed('<cr>')
@@ -474,8 +419,7 @@ describe('highlight', function()
{4:^foo}{1:bar} |
{4:foo}{1:bar} |
|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{5:search hit...uing at TOP} |
]]}
end)
@@ -542,8 +486,7 @@ describe('highlight', function()
screen:expect([[
{1: }^ |
{1: }{2:01}{3:234 67}{2:89}{5: }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{7:[No Name] [+] }|
{1: } |
{1: }{6:-----------------------}|
@@ -583,48 +526,41 @@ describe("'listchars' highlight", function()
feed('i')
screen:expect([[
{1:^ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
-- INSERT -- |
]])
feed('abcdefg<cr>kkasdf')
screen:expect([[
abcdefg |
{1:kkasdf^ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
-- INSERT -- |
]])
feed('<esc>')
screen:expect([[
abcdefg |
{1:kkasd^f }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed_command('set nocursorline')
screen:expect([[
abcdefg |
kkasd^f |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:set nocursorline |
]])
feed('k')
screen:expect([[
abcde^fg |
kkasdf |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:set nocursorline |
]])
feed('jjji<cr><cr><cr><esc>')
screen:expect([[
kkasd |
- |
- |
+ |*2
^f |
|
]])
@@ -717,8 +653,7 @@ describe("'listchars' highlight", function()
feed('$')
screen:expect([[
{3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
- {4:<} |
- {4:<} |
+ {4:<} |*2
{4:~ }|
:set cursorline |
]])
@@ -741,17 +676,14 @@ describe("'listchars' highlight", function()
feed('90ia<esc>')
screen:expect([[
{0:<}aaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaa|
+ aaaaaaaaaaaaaaaaaaaa|*2
aaaaaaaaa^a{0:¬} |
|
]])
feed('0')
screen:expect([[
^aaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaa|
+ aaaaaaaaaaaaaaaaaaaa|*3
|
]])
end)
@@ -842,25 +774,19 @@ describe("'listchars' highlight", function()
feed('ia \t bc \t <esc>')
screen:expect([[
a bc ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
screen:expect([[
a{2:.>-----.}bc{2:*>---*^*}{0:¬} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
feed_command('match Error /\\s\\+$/')
screen:expect([[
a{2:.>-----.}bc{3:*>---*^*}{0:¬} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -1142,8 +1068,7 @@ describe('CursorLine and CursorLineNr highlights', function()
screen:expect([[
{9:abc} |
^a{9:bc} |
- abc |
- abc |
+ abc |*2
{10:-- VISUAL LINE --} |
]])
end)
@@ -1172,9 +1097,7 @@ describe('CursorLine and CursorLineNr highlights', function()
bbbbb |
ccccc |
{1:^ddddd }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]], timeout = 100})
screen:expect({grid = [[
@@ -1182,9 +1105,7 @@ describe('CursorLine and CursorLineNr highlights', function()
{1:^bbbbb }|
ccccc |
ddddd |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]})
end)
@@ -1217,13 +1138,10 @@ describe('CursorLine and CursorLineNr highlights', function()
{1: }{7:line 1 some text }│{1: }{7:^line 1 some text }|
{1: }{3:line 2 mo}{2:Re text!}{3: }│{1: }{3:line 2 mo}{2:re text}{3: }|
{1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |
- {1: }extra line! │{1: }extra line! |
+ {1: }extra line! │{1: }extra line! |*2
{1: }last line ... │{1: }last line ... |
{1: } │{1: } |
- {8:~ }│{8:~ }|
- {8:~ }│{8:~ }|
- {8:~ }│{8:~ }|
+ {8:~ }│{8:~ }|*3
{4:[No Name] [+] }{9:[No Name] [+] }|
|
]])
@@ -1232,13 +1150,10 @@ describe('CursorLine and CursorLineNr highlights', function()
{1: }line 1 some text │{1: }line 1 some text |
{1: }{3:line 2 mo}{2:Re text!}{3: }│{1: }{3:line 2 mo}{2:re text}{3: }|
{1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |
- {1: }extra line! │{1: }extra line! |
+ {1: }extra line! │{1: }extra line! |*2
{1: }last line ... │{1: }last line ... |
{1: }{7: }│{1: }{7:^ }|
- {8:~ }│{8:~ }|
- {8:~ }│{8:~ }|
- {8:~ }│{8:~ }|
+ {8:~ }│{8:~ }|*3
{4:[No Name] [+] }{9:[No Name] [+] }|
|
]])
@@ -1251,13 +1166,10 @@ describe('CursorLine and CursorLineNr highlights', function()
{1: }line 1 some text │{1: }line 1 some text |
{1: }{11:line 2 mo}{12:Re text!}{11: }│{1: }{11:^line 2 mo}{12:re text}{11: }|
{1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |
- {1: }extra line! │{1: }extra line! |
+ {1: }extra line! │{1: }extra line! |*2
{1: }last line ... │{1: }last line ... |
{1: } │{1: } |
- {8:~ }│{8:~ }|
- {8:~ }│{8:~ }|
- {8:~ }│{8:~ }|
+ {8:~ }│{8:~ }|*3
{4:[No Name] [+] }{9:[No Name] [+] }|
|
]], {
@@ -1308,12 +1220,7 @@ describe('CursorLine and CursorLineNr highlights', function()
{1: }{6: 1 }{5:^foo }│{1: }{6: 2 }{5:foo }|
{1: }{9: 2 }foo │{1: }{9: 3 }foo |
{1: }{9: 3 }bar │{1: }{9: 4 }bar |
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
+ {7:~ }│{7:~ }|*6
{8:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -1323,12 +1230,7 @@ describe('CursorLine and CursorLineNr highlights', function()
{1: }{6: 1 }^foo │{1: }{6: 2 }{5:foo }|
{1: }{9: 2 }foo │{1: }{9: 3 }foo |
{1: }{9: 3 }bar │{1: }{9: 4 }bar |
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
- {7:~ }│{7:~ }|
+ {7:~ }│{7:~ }|*6
{8:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -1357,44 +1259,28 @@ describe('CursorColumn highlight', function()
screen:expect([[
1234567{1:8}9 |
a ^ b |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
|
]])
feed('i')
screen:expect([[
1{1:2}3456789 |
a^ b |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
{3:-- INSERT --} |
]])
feed('<C-O>')
screen:expect([[
1234567{1:8}9 |
a ^ b |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
{3:-- (insert) --} |
]])
feed('i')
screen:expect([[
1{1:2}3456789 |
a^ b |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
{3:-- INSERT --} |
]])
end)
@@ -1417,9 +1303,7 @@ describe('CursorColumn highlight', function()
bbbb{1:b} |
cccc{1:c} |
dddd^d |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]], timeout = 100})
screen:expect({grid = [[
@@ -1427,9 +1311,7 @@ describe('CursorColumn highlight', function()
{1:b}bbbb |
{1:c}cccc |
{1:d}dddd |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]})
end)
@@ -1472,16 +1354,12 @@ describe('ColorColumn highlight', function()
{4: 1 }11{1:1}11111{1:1}1 |
{3: 2 }22{1:2}22222{1:2}22 |
{3: 3 }33{1:3}33333{1:3}3 |
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*3
{8:X }|
{4: 1 }^11{1:1}11111{1:1}1 |
{3: 2 }22{1:2}22222{1:2}22 |
{3: 3 }33{1:3}33333{1:3}3 |
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*3
{7:X }|
|
]])
@@ -1496,18 +1374,7 @@ describe('ColorColumn highlight', function()
screen:expect([[
^The quick brown fox jumped over the {1: }|
{1: } {1:l}azy dogs |
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*12
|
]])
end)
@@ -1521,18 +1388,7 @@ describe('ColorColumn highlight', function()
screen:expect([[
^The quick brown fox jumped over the laz{1:y}|
{6:+}{5:+}{6:+}{5:>\} dogs |
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*12
|
]])
end)
@@ -1631,17 +1487,13 @@ describe("MsgSeparator highlight and msgsep fillchar", function()
feed_command("hi MsgArea guibg=Gray")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{6: }|
]]}
feed(":ls")
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{6::ls^ }|
]]}
feed(":<cr>")
@@ -1659,17 +1511,13 @@ describe("MsgSeparator highlight and msgsep fillchar", function()
feed_command("hi MsgSeparator blend=30 guibg=Magenta")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{8::hi}{9: }{8:MsgSeparator}{9: }{8:blend=30}{9: }{8:guibg=Magenta}{9: }|
]]}
feed(":ls")
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{8::ls}{9:^ }|
]]}
feed("<cr>")
@@ -1775,9 +1623,7 @@ describe("'number' and 'relativenumber' highlight", function()
{1: 2 }bbbbb |
{1: 1 }ccccc |
{1: 0 }^ddddd |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]], timeout = 100})
screen:expect({grid = [[
@@ -1785,9 +1631,7 @@ describe("'number' and 'relativenumber' highlight", function()
{1: 1 }bbbbb |
{1: 2 }ccccc |
{1: 3 }ddddd |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]]})
end)
@@ -1844,8 +1688,7 @@ describe("'winhighlight' highlight", function()
command("set winhl=Normal:Background1")
screen:expect([[
{1:a^a }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] [+] }|
aa |
{0:~ }|
@@ -1856,8 +1699,7 @@ describe("'winhighlight' highlight", function()
command("enew")
screen:expect([[
{1:^ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] }|
aa |
{0:~ }|
@@ -1874,18 +1716,13 @@ describe("'winhighlight' highlight", function()
command('setlocal winhl=Normal:Background1')
screen:expect([[
{1: ^aa}|
- {2: ~}|
- {2: ~}|
- {2: ~}|
- {2: ~}|
+ {2: ~}|*4
|
]])
command('botright vsplit')
screen:expect([[
{1: aa│ ^aa}|
- {2: ~}{1:│}{2: ~}|
- {2: ~}{1:│}{2: ~}|
- {2: ~}{1:│}{2: ~}|
+ {2: ~}{1:│}{2: ~}|*3
{4:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -1895,12 +1732,7 @@ describe("'winhighlight' highlight", function()
command("set winhl=Normal:Background1")
screen:expect([[
{1:^ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*6
|
]])
@@ -1908,12 +1740,7 @@ describe("'winhighlight' highlight", function()
eq('xxx:yyy', eval('&winhl'))
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]]}
end)
@@ -1922,24 +1749,14 @@ describe("'winhighlight' highlight", function()
command("set winhl=EndOfBuffer:Background1")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
command("set winhl=Normal:ErrorMsg")
screen:expect{grid=[[
{15:^ }|
- {29:~ }|
- {29:~ }|
- {29:~ }|
- {29:~ }|
- {29:~ }|
- {29:~ }|
+ {29:~ }|*6
|
]]}
end)
@@ -1950,8 +1767,7 @@ describe("'winhighlight' highlight", function()
command("setlocal winhl=Normal:Background1")
screen:expect([[
{1:a^a }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] [+] }|
aa |
{0:~ }|
@@ -1962,8 +1778,7 @@ describe("'winhighlight' highlight", function()
command("enew")
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
aa |
{0:~ }|
@@ -1974,8 +1789,7 @@ describe("'winhighlight' highlight", function()
command("bnext")
screen:expect([[
{1:^aa }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] [+] }|
aa |
{0:~ }|
@@ -1990,8 +1804,7 @@ describe("'winhighlight' highlight", function()
command("split")
screen:expect([[
{1:^ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] }|
{5: }|
{6:~ }|
@@ -2002,8 +1815,7 @@ describe("'winhighlight' highlight", function()
feed("<c-w><c-w>")
screen:expect([[
{5: }|
- {6:~ }|
- {6:~ }|
+ {6:~ }|*2
{4:[No Name] }|
{1:^ }|
{2:~ }|
@@ -2014,8 +1826,7 @@ describe("'winhighlight' highlight", function()
feed("<c-w><c-w>")
screen:expect([[
{1:^ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] }|
{5: }|
{6:~ }|
@@ -2030,8 +1841,7 @@ describe("'winhighlight' highlight", function()
command("split")
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
{7: }|
{8:~ }|
@@ -2042,8 +1852,7 @@ describe("'winhighlight' highlight", function()
command("wincmd w")
screen:expect([[
{7: }|
- {8:~ }|
- {8:~ }|
+ {8:~ }|*2
{4:[No Name] }|
^ |
{0:~ }|
@@ -2056,8 +1865,7 @@ describe("'winhighlight' highlight", function()
command("set winhl=Normal:Background1")
screen:expect([[
{7: }|
- {8:~ }|
- {8:~ }|
+ {8:~ }|*2
{4:[No Name] }|
{1:^ }|
{2:~ }|
@@ -2068,8 +1876,7 @@ describe("'winhighlight' highlight", function()
command("wincmd w")
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
{1: }|
{2:~ }|
@@ -2081,8 +1888,7 @@ describe("'winhighlight' highlight", function()
command("set winhl=Normal:Background1,NormalNC:Background2")
screen:expect([[
{7: }|
- {8:~ }|
- {8:~ }|
+ {8:~ }|*2
{4:[No Name] }|
{1:^ }|
{2:~ }|
@@ -2093,8 +1899,7 @@ describe("'winhighlight' highlight", function()
command("wincmd w")
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
{5: }|
{6:~ }|
@@ -2108,8 +1913,7 @@ describe("'winhighlight' highlight", function()
command("setlocal winhl=Normal:FancyGroup") -- does not yet exist
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
|
{0:~ }|
@@ -2120,8 +1924,7 @@ describe("'winhighlight' highlight", function()
command("hi FancyGroup guibg=#FF8800") -- nice orange
screen:expect{grid=[[
{30:^ }|
- {31:~ }|
- {31:~ }|
+ {31:~ }|*2
{3:[No Name] }|
|
{0:~ }|
@@ -2144,10 +1947,7 @@ describe("'winhighlight' highlight", function()
{9: 1 } ^Lorem ipsum do|
{9: } {0:↪}lor sit |
{9: } {0:↪}amet{0:-} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
@@ -2156,10 +1956,7 @@ describe("'winhighlight' highlight", function()
{10: 1 }{1: ^Lorem ipsum do}|
{10: }{1: }{2:↪}{1:lor sit }|
{10: }{1: }{2:↪}{1:amet}{2:-}{1: }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*4
|
]])
@@ -2168,12 +1965,7 @@ describe("'winhighlight' highlight", function()
feed('3w')
screen:expect([[
{10: 1 }{2:❮}{1: dolor ^sit ame}{2:❯}|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*6
|
]])
end)
@@ -2188,11 +1980,7 @@ describe("'winhighlight' highlight", function()
screen:expect([[
{25:the} {26:foobar} was {26:fooba}|
{26:^r} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
@@ -2202,11 +1990,7 @@ describe("'winhighlight' highlight", function()
screen:expect([[
{27:the}{1: }{26:foobar}{1: was }{26:fooba}|
{26:^r}{1: }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*5
|
]])
end)
@@ -2222,8 +2006,7 @@ describe("'winhighlight' highlight", function()
screen:expect([[
^r{5:#}a{15:^@} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[No Name] [+] }|
r{19:#}a{16:^@} |
{0:~ }|
@@ -2261,22 +2044,14 @@ describe("'winhighlight' highlight", function()
screen:expect([[
{20: No Name] }{15: No Name]}{20:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
command("tabnext")
screen:expect([[
{21: No Name] }{1: No Name]}{20:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
end)
@@ -2288,8 +2063,7 @@ describe("'winhighlight' highlight", function()
..'PmenuSbar:ErrorMsg,PmenuThumb:Normal')
screen:expect([[
word wording word^y |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] [+] }|
word wording wordy |
{0:~ }|
@@ -2329,8 +2103,7 @@ describe("'winhighlight' highlight", function()
command('set winhl=CursorLine:Background1')
screen:expect{grid=[[
{28: 1 }{1:^ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
{28: 1 }{18: }|
{0:~ }|
@@ -2341,8 +2114,7 @@ describe("'winhighlight' highlight", function()
command('set winhl=CursorLineNr:Background2,CursorLine:Background1')
screen:expect{grid=[[
{5: 1 }{1:^ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
{28: 1 }{18: }|
{0:~ }|
@@ -2353,8 +2125,7 @@ describe("'winhighlight' highlight", function()
feed('<c-w>w')
screen:expect{grid=[[
{5: 1 }{1: }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{4:[No Name] }|
{28: 1 }{18:^ }|
{0:~ }|
@@ -2368,8 +2139,7 @@ describe("'winhighlight' highlight", function()
command('split')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1:[No Name] }|
|
{0:~ }|
@@ -2405,11 +2175,7 @@ describe("'winhighlight' highlight", function()
screen:expect([[
{25:the} {26:foobar} was {26:fooba}|
{26:^r} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]])
@@ -2431,8 +2197,7 @@ describe("'winhighlight' highlight", function()
command('split | set winhl=Normal:ErrorMsg | set winhl=')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
|
{0:~ }|
@@ -2495,8 +2260,7 @@ describe("'winhighlight' highlight", function()
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
|
{0:~ }|
@@ -2539,56 +2303,28 @@ describe('highlight namespaces', function()
it('can be used globally', function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]]}
meths.set_hl_ns(ns1)
screen:expect{grid=[[
{2:^ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*8
|
]]}
meths.set_hl_ns(ns2)
screen:expect{grid=[[
{4:^ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*8
|
]]}
meths.set_hl_ns(0)
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]]}
end)
@@ -2619,28 +2355,14 @@ describe('highlight namespaces', function()
it('redraws correctly when ns=0', function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]]}
meths.set_hl(0, 'EndOfBuffer', {fg='#333333'})
screen:expect{grid=[[
^ |
- {8:~ }|
- {8:~ }|
- {8:~ }|
- {8:~ }|
- {8:~ }|
- {8:~ }|
- {8:~ }|
- {8:~ }|
+ {8:~ }|*8
|
]]}
end)
@@ -2663,8 +2385,7 @@ describe('highlight namespaces', function()
command('highlight Ignore')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{6: }|
|
Ignore {8:xxx} {9:ctermf}|
diff --git a/test/functional/ui/hlstate_spec.lua b/test/functional/ui/hlstate_spec.lua
index b35d61744f..e36309f32a 100644
--- a/test/functional/ui/hlstate_spec.lua
+++ b/test/functional/ui/hlstate_spec.lua
@@ -36,11 +36,7 @@ describe('ext_hlstate detailed highlights', function()
screen:expect([[
these are {1:some} lines |
^wi{2:th }{4:co}{3:lorful text} |
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*5
{8:search hit BOTTOM, continuing at TOP}{7: }|
]], {
[1] = {{foreground = Screen.colors.Magenta},
@@ -77,11 +73,7 @@ describe('ext_hlstate detailed highlights', function()
screen:expect([[
^ {1:│} |
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
+ {2:~ }{1:│}{2:~ }|*5
{3:[No Name] }{4:[No Name] }|
{7: }|
]])
@@ -89,11 +81,7 @@ describe('ext_hlstate detailed highlights', function()
command("hi clear StatusLine | hi clear StatuslineNC")
screen:expect([[
^ {1:│} |
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
+ {2:~ }{1:│}{2:~ }|*5
{5:[No Name] }{6:[No Name] }|
{7: }|
]])
@@ -102,11 +90,7 @@ describe('ext_hlstate detailed highlights', function()
command("wincmd w")
screen:expect([[
{1:│}^ |
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
- {2:~ }{1:│}{2:~ }|
+ {2:~ }{1:│}{2:~ }|*5
{6:[No Name] }{5:[No Name] }|
{7: }|
]])
@@ -136,8 +120,7 @@ describe('ext_hlstate detailed highlights', function()
-- NormalNC is not applied if not set, to avoid spurious redraws
screen:expect([[
{1: 1 }^ |
- {2:~ }|
- {2:~ }|
+ {2:~ }|*2
{3:[No Name] }|
{1: 1 } |
{2:~ }|
@@ -148,8 +131,7 @@ describe('ext_hlstate detailed highlights', function()
command("set winhl=LineNr:ErrorMsg")
screen:expect{grid=[[
{13: 1 }^ |
- {14:~ }|
- {14:~ }|
+ {14:~ }|*2
{3:[No Name] }|
{1: 1 } |
{2:~ }|
@@ -160,8 +142,7 @@ describe('ext_hlstate detailed highlights', function()
command("set winhl=Normal:MsgSeparator,NormalNC:Statement")
screen:expect([[
{7: 1 }{6:^ }|
- {8:~ }|
- {8:~ }|
+ {8:~ }|*2
{3:[No Name] }|
{1: 1 } |
{2:~ }|
@@ -172,8 +153,7 @@ describe('ext_hlstate detailed highlights', function()
command("wincmd w")
screen:expect([[
{10: 1 }{9: }|
- {11:~ }|
- {11:~ }|
+ {11:~ }|*2
{4:[No Name] }|
{1: 1 }^ |
{2:~ }|
@@ -198,11 +178,7 @@ describe('ext_hlstate detailed highlights', function()
screen:expect([[
^tty ready |
{1: } |
- |
- |
- |
- |
- |
+ |*5
{7: }|
]])
@@ -217,10 +193,7 @@ describe('ext_hlstate detailed highlights', function()
^tty ready |
x {5:y z} |
{1: } |
- |
- |
- |
- |
+ |*4
{7: }|
]])
else
@@ -228,10 +201,7 @@ describe('ext_hlstate detailed highlights', function()
^tty ready |
x {2:y }{3:z} |
{1: } |
- |
- |
- |
- |
+ |*4
{7: }|
]])
end
@@ -242,22 +212,14 @@ describe('ext_hlstate detailed highlights', function()
screen:expect([[
^tty ready |
x {6:y}{5: z} |
- |
- |
- |
- |
- |
+ |*5
{7: }|
]])
else
screen:expect([[
^tty ready |
x {4:y}{2: }{3:z} |
- |
- |
- |
- |
- |
+ |*5
{7: }|
]])
end
@@ -274,24 +236,14 @@ describe('ext_hlstate detailed highlights', function()
})
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{3: }|
]])
command("hi NonText guifg=Red gui=reverse ctermfg=Green cterm=italic")
screen:expect([[
^ |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*6
{3: }|
]])
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 3ee67a710c..7a7c3c2945 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -4,10 +4,10 @@ local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
-local feed_command = helpers.feed_command
local expect = helpers.expect
local feed = helpers.feed
local insert = helpers.insert
+local funcs = helpers.funcs
local meths = helpers.meths
local neq = helpers.neq
local ok = helpers.ok
@@ -136,14 +136,14 @@ describe(":substitute, 'inccommand' preserves", function()
local screen = Screen.new(30,10)
common_setup(screen, "split", "ABC")
- feed_command("%s/AB/BA/")
- feed_command("ls")
+ feed(':%s/AB/BA/')
+ poke_eventloop()
+ feed('<CR>')
+ feed(':ls<CR>')
screen:expect([[
BAC |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{11: }|
:ls |
1 %a + "[No Name]" |
@@ -153,29 +153,54 @@ describe(":substitute, 'inccommand' preserves", function()
]])
end)
+ it("'[ and '] marks #26439", function()
+ local screen = Screen.new(30, 10)
+ common_setup(screen, 'nosplit', ('abc\ndef\n'):rep(50))
+
+ feed('ggyG')
+ local X = meths.get_vvar('maxcol')
+ eq({0, 1, 1, 0}, funcs.getpos("'["))
+ eq({0, 101, X, 0}, funcs.getpos("']"))
+
+ feed(":'[,']s/def/")
+ poke_eventloop()
+ eq({0, 1, 1, 0}, funcs.getpos("'["))
+ eq({0, 101, X, 0}, funcs.getpos("']"))
+
+ feed('DEF/g')
+ poke_eventloop()
+ eq({0, 1, 1, 0}, funcs.getpos("'["))
+ eq({0, 101, X, 0}, funcs.getpos("']"))
+
+ feed('<CR>')
+ expect(('abc\nDEF\n'):rep(50))
+ end)
+
for _, case in pairs{"", "split", "nosplit"} do
it("various delimiters (inccommand="..case..")", function()
insert(default_text)
- feed_command("set inccommand=" .. case)
+ command("set inccommand=" .. case)
local delims = { '/', '#', ';', '%', ',', '@', '!' }
for _,delim in pairs(delims) do
- feed_command("%s"..delim.."lines"..delim.."LINES"..delim.."g")
+ feed(":%s"..delim.."lines"..delim.."LINES"..delim.."g")
+ poke_eventloop()
+ feed('<CR>')
expect([[
Inc substitution on
two LINES
]])
- feed_command("undo")
+ command("undo")
end
end)
end
for _, case in pairs{"", "split", "nosplit"} do
it("'undolevels' (inccommand="..case..")", function()
- feed_command("set undolevels=139")
- feed_command("setlocal undolevels=34")
- feed_command("split") -- Show the buffer in multiple windows
- feed_command("set inccommand=" .. case)
+ command("set undolevels=139")
+ command("setlocal undolevels=34")
+ command("split") -- Show the buffer in multiple windows
+ command("set inccommand=" .. case)
insert("as")
feed(":%s/as/glork/")
poke_eventloop()
@@ -187,8 +212,8 @@ describe(":substitute, 'inccommand' preserves", function()
for _, case in ipairs({"", "split", "nosplit"}) do
it("empty undotree() (inccommand="..case..")", function()
- feed_command("set undolevels=1000")
- feed_command("set inccommand=" .. case)
+ command("set undolevels=1000")
+ command("set inccommand=" .. case)
local expected_undotree = eval("undotree()")
-- Start typing an incomplete :substitute command.
@@ -205,8 +230,8 @@ describe(":substitute, 'inccommand' preserves", function()
for _, case in ipairs({"", "split", "nosplit"}) do
it("undotree() with branches (inccommand="..case..")", function()
- feed_command("set undolevels=1000")
- feed_command("set inccommand=" .. case)
+ command("set undolevels=1000")
+ command("set inccommand=" .. case)
-- Make some changes.
feed([[isome text 1<C-\><C-N>]])
feed([[osome text 2<C-\><C-N>]])
@@ -240,7 +265,7 @@ describe(":substitute, 'inccommand' preserves", function()
for _, case in pairs{"", "split", "nosplit"} do
it("b:changedtick (inccommand="..case..")", function()
- feed_command("set inccommand=" .. case)
+ command("set inccommand=" .. case)
feed([[isome text 1<C-\><C-N>]])
feed([[osome text 2<C-\><C-N>]])
local expected_tick = eval("b:changedtick")
@@ -326,37 +351,41 @@ describe(":substitute, 'inccommand' preserves undo", function()
local cases = { "", "split", "nosplit" }
local substrings = {
- ":%s/1",
- ":%s/1/",
- ":%s/1/<bs>",
- ":%s/1/a",
- ":%s/1/a<bs>",
- ":%s/1/ax",
- ":%s/1/ax<bs>",
- ":%s/1/ax<bs><bs>",
- ":%s/1/ax<bs><bs><bs>",
- ":%s/1/ax/",
- ":%s/1/ax/<bs>",
- ":%s/1/ax/<bs>/",
- ":%s/1/ax/g",
- ":%s/1/ax/g<bs>",
- ":%s/1/ax/g<bs><bs>"
+ { ':%s/', '1' },
+ { ':%s/', '1', '/' },
+ { ':%s/', '1', '/', '<bs>' },
+ { ':%s/', '1', '/', 'a' },
+ { ':%s/', '1', '/', 'a', '<bs>' },
+ { ':%s/', '1', '/', 'a', 'x' },
+ { ':%s/', '1', '/', 'a', 'x', '<bs>' },
+ { ':%s/', '1', '/', 'a', 'x', '<bs>', '<bs>' },
+ { ':%s/', '1', '/', 'a', 'x', '<bs>', '<bs>', '<bs>' },
+ { ':%s/', '1', '/', 'a', 'x', '/' },
+ { ':%s/', '1', '/', 'a', 'x', '/', '<bs>' },
+ { ':%s/', '1', '/', 'a', 'x', '/', '<bs>', '/' },
+ { ':%s/', '1', '/', 'a', 'x', '/', 'g' },
+ { ':%s/', '1', '/', 'a', 'x', '/', 'g', '<bs>' },
+ { ':%s/', '1', '/', 'a', 'x', '/', 'g', '<bs>', '<bs>' },
}
local function test_sub(substring, split, redoable)
command('bwipe!')
- feed_command("set inccommand=" .. split)
+ command("set inccommand=" .. split)
insert("1")
feed("o2<esc>")
- feed_command("undo")
+ command("undo")
feed("o3<esc>")
if redoable then
feed("o4<esc>")
- feed_command("undo")
+ command("undo")
+ end
+ for _, s in pairs(substring) do
+ feed(s)
end
- feed(substring.. "<enter>")
- feed_command("undo")
+ poke_eventloop()
+ feed("<enter>")
+ command("undo")
feed("g-")
expect([[
@@ -371,17 +400,21 @@ describe(":substitute, 'inccommand' preserves undo", function()
local function test_notsub(substring, split, redoable)
command('bwipe!')
- feed_command("set inccommand=" .. split)
+ command("set inccommand=" .. split)
insert("1")
feed("o2<esc>")
- feed_command("undo")
+ command("undo")
feed("o3<esc>")
if redoable then
feed("o4<esc>")
- feed_command("undo")
+ command("undo")
+ end
+ for _, s in pairs(substring) do
+ feed(s)
end
- feed(substring .. "<esc>")
+ poke_eventloop()
+ feed("<esc>")
feed("g-")
expect([[
@@ -405,7 +438,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
local function test_threetree(substring, split)
command('bwipe!')
- feed_command("set inccommand=" .. split)
+ command("set inccommand=" .. split)
insert("1")
feed("o2<esc>")
@@ -425,7 +458,11 @@ describe(":substitute, 'inccommand' preserves undo", function()
-- 1 - 2 - 3
feed("2u")
- feed(substring .. "<esc>")
+ for _, s in pairs(substring) do
+ feed(s)
+ poke_eventloop()
+ end
+ feed("<esc>")
expect([[
1]])
feed("g-")
@@ -441,7 +478,11 @@ describe(":substitute, 'inccommand' preserves undo", function()
feed("g-") -- go to b
feed("2u")
- feed(substring .. "<esc>")
+ for _, s in pairs(substring) do
+ feed(s)
+ poke_eventloop()
+ end
+ feed("<esc>")
feed("<c-r>")
expect([[
1
@@ -449,7 +490,11 @@ describe(":substitute, 'inccommand' preserves undo", function()
feed("g-") -- go to 3
feed("2u")
- feed(substring .. "<esc>")
+ for _, s in pairs(substring) do
+ feed(s)
+ poke_eventloop()
+ end
+ feed("<esc>")
feed("<c-r>")
expect([[
1
@@ -500,22 +545,26 @@ describe(":substitute, 'inccommand' preserves undo", function()
for _, case in pairs(cases) do
clear()
common_setup(nil, case, default_text)
- feed_command("set undolevels=0")
+ command("set undolevels=0")
feed("1G0")
insert("X")
- feed(":%s/tw/MO/<esc>")
- feed_command("undo")
+ feed(":%s/tw/MO/")
+ poke_eventloop()
+ feed("<esc>")
+ command("undo")
expect(default_text)
- feed_command("undo")
+ command("undo")
expect(default_text:gsub("Inc", "XInc"))
- feed_command("undo")
+ command("undo")
- feed_command("%s/tw/MO/g")
+ feed(":%s/tw/MO/g")
+ poke_eventloop()
+ feed("<CR>")
expect(default_text:gsub("tw", "MO"))
- feed_command("undo")
+ command("undo")
expect(default_text)
- feed_command("undo")
+ command("undo")
expect(default_text:gsub("tw", "MO"))
end
end)
@@ -530,29 +579,31 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
two lines |
^ |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
|
]])
- feed_command("set undolevels=1")
+ command("set undolevels=1")
feed("1G0")
insert("X")
feed("IY<esc>")
- feed(":%s/tw/MO/<esc>")
- -- feed_command("undo") here would cause "Press ENTER".
+ feed(":%s/tw/MO/")
+ poke_eventloop()
+ feed("<esc>")
feed("u")
expect(default_text:gsub("Inc", "XInc"))
feed("u")
expect(default_text)
- feed(":%s/tw/MO/g<enter>")
- feed(":%s/MO/GO/g<enter>")
- feed(":%s/GO/NO/g<enter>")
+ feed(":%s/tw/MO/g")
+ poke_eventloop()
+ feed("<enter>")
+ feed(":%s/MO/GO/g")
+ poke_eventloop()
+ feed("<enter>")
+ feed(":%s/GO/NO/g")
+ poke_eventloop()
+ feed("<enter>")
feed("u")
expect(default_text:gsub("tw", "GO"))
feed("u")
@@ -564,12 +615,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
else
@@ -577,12 +623,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
end
@@ -595,13 +636,14 @@ describe(":substitute, 'inccommand' preserves undo", function()
for _, case in pairs(cases) do
clear()
common_setup(screen, case, default_text)
- feed_command("set undolevels=2")
+ command("set undolevels=2")
feed("2GAx<esc>")
feed("Ay<esc>")
feed("Az<esc>")
- feed(":%s/tw/AR<esc>")
- -- feed_command("undo") here would cause "Press ENTER".
+ feed(":%s/tw/AR")
+ poke_eventloop()
+ feed("<esc>")
feed("u")
expect(default_text:gsub("lines", "linesxy"))
feed("u")
@@ -615,12 +657,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
two line^s |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
else
@@ -628,20 +665,23 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
two line^s |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
end
- feed(":%s/tw/MO/g<enter>")
- feed(":%s/MO/GO/g<enter>")
- feed(":%s/GO/NO/g<enter>")
- feed(":%s/NO/LO/g<enter>")
+ feed(":%s/tw/MO/g")
+ poke_eventloop()
+ feed("<enter>")
+ feed(":%s/MO/GO/g")
+ poke_eventloop()
+ feed("<enter>")
+ feed(":%s/GO/NO/g")
+ poke_eventloop()
+ feed("<enter>")
+ feed(":%s/NO/LO/g")
+ poke_eventloop()
+ feed("<enter>")
feed("u")
expect(default_text:gsub("tw", "NO"))
feed("u")
@@ -655,12 +695,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
else
@@ -668,12 +703,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
end
@@ -687,21 +717,17 @@ describe(":substitute, 'inccommand' preserves undo", function()
clear()
common_setup(screen, case, default_text)
- feed_command("set undolevels=-1")
- feed(":%s/tw/MO/g<enter>")
- -- feed_command("undo") here will result in a "Press ENTER" prompt
+ command("set undolevels=-1")
+ feed(":%s/tw/MO/g")
+ poke_eventloop()
+ feed("<enter>")
feed("u")
if case == "split" then
screen:expect([[
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
else
@@ -709,12 +735,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
end
@@ -723,22 +744,19 @@ describe(":substitute, 'inccommand' preserves undo", function()
clear()
common_setup(screen, case, default_text)
- feed_command("set undolevels=-1")
+ command("set undolevels=-1")
feed("1G")
feed("IL<esc>")
- feed(":%s/tw/MO/g<esc>")
+ feed(":%s/tw/MO/g")
+ poke_eventloop()
+ feed("<esc>")
feed("u")
screen:expect([[
^LInc substitution on|
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
Already ...t change |
]])
end
@@ -756,7 +774,7 @@ describe(":substitute, inccommand=split", function()
end)
it("preserves 'modified' buffer flag", function()
- feed_command("set nomodified")
+ command("set nomodified")
feed(":%s/tw")
screen:expect([[
Inc substitution on |
@@ -767,11 +785,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] }|
|2| {12:tw}o lines |
|4| {12:tw}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw^ |
]])
@@ -800,15 +814,7 @@ describe(":substitute, inccommand=split", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
:silent tabedit %s/tw/to^ |
]])
feed('<Esc>')
@@ -832,11 +838,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| {12:to}o lines |
|4| {12:to}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:topleft %s/tw/to^ |
]])
@@ -854,11 +856,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| {12:to}o lines |
|4| {12:to}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:topleft vert %s/tw/to^ |
]])
@@ -877,11 +875,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| {12:tw}o lines |
|4| {12:tw}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw^ |
]])
@@ -898,11 +892,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| o lines |
|4| o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw/^ |
]])
@@ -917,11 +907,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| {12:x}o lines |
|4| {12:x}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw/x^ |
]])
@@ -936,11 +922,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| o lines |
|4| o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw/^ |
]])
@@ -958,11 +940,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| {12:XX}o lines |
|4| {12:XX}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw/XX^ |
]])
@@ -977,21 +955,13 @@ describe(":substitute, inccommand=split", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
:s/tw^ |
]])
end)
it("'hlsearch' is active, 'cursorline' is not", function()
- feed_command("set hlsearch cursorline")
+ command("set hlsearch cursorline")
feed("gg")
-- Assert that 'cursorline' is active.
@@ -1001,16 +971,8 @@ describe(":substitute, inccommand=split", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- :set hlsearch cursorline |
+ {15:~ }|*9
+ |
]])
feed(":%s/tw")
@@ -1024,11 +986,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|2| {12:tw}o lines |
|4| {12:tw}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/tw^ |
]])
@@ -1046,12 +1004,7 @@ describe(":substitute, inccommand=split", function()
two lines |
{11:[No Name] [+] }|
|1| {12:123} {12:123} {12:123} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/M/123/g^ |
]])
@@ -1068,33 +1021,20 @@ describe(":substitute, inccommand=split", function()
|
{11:[No Name] [+] }|
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/Inx^ |
]])
end)
it('previews correctly when previewhight is small', function()
- feed_command('set cwh=3')
- feed_command('set hls')
+ command('set cwh=3')
+ command('set hls')
feed('ggdG')
insert(string.rep('abc abc abc\n', 20))
feed(':%s/abc/MMM/g')
screen:expect([[
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
- {12:MMM} {12:MMM} {12:MMM} |
+ {12:MMM} {12:MMM} {12:MMM} |*9
{11:[No Name] [+] }|
| 1| {12:MMM} {12:MMM} {12:MMM} |
| 2| {12:MMM} {12:MMM} {12:MMM} |
@@ -1105,7 +1045,9 @@ describe(":substitute, inccommand=split", function()
end)
it('actually replaces text', function()
- feed(":%s/tw/XX/g<Enter>")
+ feed(":%s/tw/XX/g")
+ poke_eventloop()
+ feed("<Enter>")
screen:expect([[
Inc substitution on |
@@ -1113,15 +1055,7 @@ describe(":substitute, inccommand=split", function()
Inc substitution on |
^XXo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
:%s/tw/XX/g |
]])
end)
@@ -1130,7 +1064,7 @@ describe(":substitute, inccommand=split", function()
feed("gg")
feed("2yy")
feed("2000p")
- feed_command("1,1000s/tw/BB/g")
+ command("1,1000s/tw/BB/g")
feed(":%s/tw/X")
screen:expect([[
@@ -1168,26 +1102,20 @@ describe(":substitute, inccommand=split", function()
feed("<CR>")
poke_eventloop()
feed(":vs tmp<enter>")
- eq(3, helpers.call('bufnr', '$'))
+ eq(3, funcs.bufnr('$'))
end)
it('works with the n flag', function()
- feed(":%s/tw/Mix/n<Enter>")
+ feed(":%s/tw/Mix/n")
+ poke_eventloop()
+ feed("<Enter>")
screen:expect([[
Inc substitution on |
two lines |
Inc substitution on |
two lines |
^ |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
2 matches on 2 lines |
]])
end)
@@ -1198,9 +1126,9 @@ describe(":substitute, inccommand=split", function()
-- Assert that 'inccommand' is ENABLED initially.
eq("split", eval("&inccommand"))
-- Set 'redrawtime' to minimal value, to ensure timeout is triggered.
- feed_command("set redrawtime=1 nowrap")
+ command("set redrawtime=1 nowrap")
-- Load a big file.
- feed_command("silent edit! test/functional/fixtures/bigfile_oneline.txt")
+ command("silent edit! test/functional/fixtures/bigfile_oneline.txt")
-- Start :substitute with a slow pattern.
feed([[:%s/B.*N/x]])
poke_eventloop()
@@ -1267,7 +1195,7 @@ describe(":substitute, inccommand=split", function()
it("clears preview if non-previewable command is edited #5585", function()
feed('gg')
-- Put a non-previewable command in history.
- feed_command("echo 'foo'")
+ feed(":echo 'foo'<CR>")
-- Start an incomplete :substitute command.
feed(":1,2s/t/X")
@@ -1280,11 +1208,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|1| Inc subs{12:X}itution on |
|2| {12:X}wo lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:1,2s/t/X^ |
]])
@@ -1298,15 +1222,7 @@ describe(":substitute, inccommand=split", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
:echo 'foo'^ |
]])
end)
@@ -1323,11 +1239,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|1| Inc subs{12:X}itution on |
|2| {12:X}wo lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:1,2s/t/X^ |
]])
@@ -1343,11 +1255,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|1| Inc subs{12:X}itution on |
|2| {12:X}wo lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
={1:'Y'}^ |
]])
@@ -1363,11 +1271,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|1| Inc subs{12:XY}itution on |
|2| {12:XY}wo lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:1,2s/t/XY^ |
]])
@@ -1383,11 +1287,7 @@ describe(":substitute, inccommand=split", function()
{11:[No Name] [+] }|
|1| Inc subs{12:XY}itution on |
|2| {12:XY}wo lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
={1:'echo'}^ |
]])
@@ -1400,15 +1300,7 @@ describe(":substitute, inccommand=split", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
:echo^ |
]])
end)
@@ -1425,7 +1317,7 @@ describe("inccommand=nosplit", function()
end)
it("works with :smagic, :snomagic", function()
- feed_command("set hlsearch")
+ command("set hlsearch")
insert("Line *.3.* here")
feed(":%smagic/3.*/X") -- start :smagic command
@@ -1435,10 +1327,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
two lines |
Line *.{12:X} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%smagic/3.*/X^ |
]])
@@ -1450,10 +1339,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
two lines |
Line *.{12:X} here |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%snomagic/3.*/X^ |
]])
end)
@@ -1479,8 +1365,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11: }|
:silent tabedit %s/t|
w/to^ |
@@ -1502,16 +1387,13 @@ describe("inccommand=nosplit", function()
Inc substitution on |
{12:OKOK}o lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/tw/OKOK^ |
]])
end)
it('never shows preview buffer', function()
- feed_command("set hlsearch")
+ command("set hlsearch")
feed(":%s/tw")
screen:expect([[
@@ -1520,10 +1402,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
{12:tw}o lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/tw^ |
]])
@@ -1534,10 +1413,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
{12:BM}o lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/tw/BM^ |
]])
@@ -1548,10 +1424,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
{12:BM}o lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/tw/BM/^ |
]])
@@ -1562,17 +1435,14 @@ describe("inccommand=nosplit", function()
Inc substitution on |
^BMo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/tw/BM/ |
]])
end)
it("clears preview if non-previewable command is edited", function()
-- Put a non-previewable command in history.
- feed_command("echo 'foo'")
+ feed(":echo 'foo'<CR>")
-- Start an incomplete :substitute command.
feed(":1,2s/t/X")
@@ -1582,10 +1452,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:1,2s/t/X^ |
]])
@@ -1598,10 +1465,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:echo 'foo'^ |
]])
end)
@@ -1614,10 +1478,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
{12:three} lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/two/three/g|q!^ |
]])
eq(eval('v:null'), eval('v:exiting'))
@@ -1638,10 +1499,7 @@ describe("inccommand=nosplit", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:%s/^ |
]])
end)
@@ -1660,8 +1518,10 @@ describe(":substitute, 'inccommand' with a failing expression", function()
it('in the pattern does nothing', function()
for _, case in pairs(cases) do
refresh(case)
- feed_command("set inccommand=" .. case)
- feed(":silent! %s/tw\\(/LARD/<enter>")
+ command("set inccommand=" .. case)
+ feed(":silent! %s/tw\\(/LARD/")
+ poke_eventloop()
+ feed("<enter>")
expect(default_text)
end
end)
@@ -1672,10 +1532,12 @@ describe(":substitute, 'inccommand' with a failing expression", function()
local replacements = { "\\='LARD", "\\=xx_novar__xx" }
for _, repl in pairs(replacements) do
- feed_command("set inccommand=" .. case)
- feed(":silent! %s/tw/" .. repl .. "/<enter>")
+ command("set inccommand=" .. case)
+ feed(":silent! %s/tw/" .. repl .. "/")
+ poke_eventloop()
+ feed("<enter>")
expect(default_text:gsub("tw", ""))
- feed_command("undo")
+ command("undo")
end
end
end)
@@ -1689,12 +1551,7 @@ describe(":substitute, 'inccommand' with a failing expression", function()
Inc substitution on |
two lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
:100s/^ |
]])
@@ -1703,12 +1560,7 @@ describe(":substitute, 'inccommand' with a failing expression", function()
Inc substitution on |
two lines |
^ |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{14:E16: Invalid range} |
]])
end
@@ -1733,10 +1585,12 @@ describe("'inccommand' and :cnoremap", function()
for i = 1, string.len(cmd) do
local c = string.sub(cmd, i, i)
- feed_command("cnoremap ".. c .. " " .. c)
+ command("cnoremap ".. c .. " " .. c)
end
- feed_command(cmd)
+ feed(':' .. cmd)
+ poke_eventloop()
+ feed('<CR>')
expect([[
Inc substitution on
two LINES
@@ -1747,30 +1601,47 @@ describe("'inccommand' and :cnoremap", function()
it('work when mappings move the cursor', function()
for _, case in pairs(cases) do
refresh(case)
- feed_command("cnoremap ,S LINES/<left><left><left><left><left><left>")
+ command("cnoremap ,S LINES/<left><left><left><left><left><left>")
- feed(":%s/lines/,Sor three <enter>")
+ feed(":%s/lines/")
+ poke_eventloop()
+ feed(",S")
+ poke_eventloop()
+ feed("or three <enter>")
+ poke_eventloop()
expect([[
Inc substitution on
two or three LINES
]])
- feed_command("cnoremap ;S /X/<left><left><left>")
- feed(":%s/;SI<enter>")
+ command("cnoremap ;S /X/<left><left><left>")
+ feed(":%s/")
+ poke_eventloop()
+ feed(";S")
+ poke_eventloop()
+ feed("I<enter>")
expect([[
Xnc substitution on
two or three LXNES
]])
- feed_command("cnoremap ,T //Y/<left><left><left>")
- feed(":%s,TX<enter>")
+ command("cnoremap ,T //Y/<left><left><left>")
+ feed(":%s")
+ poke_eventloop()
+ feed(",T")
+ poke_eventloop()
+ feed("X<enter>")
expect([[
Ync substitution on
two or three LYNES
]])
- feed_command("cnoremap ;T s//Z/<left><left><left>")
- feed(":%;TY<enter>")
+ command("cnoremap ;T s//Z/<left><left><left>")
+ feed(":%")
+ poke_eventloop()
+ feed(";T")
+ poke_eventloop()
+ feed("Y<enter>")
expect([[
Znc substitution on
two or three LZNES
@@ -1781,7 +1652,7 @@ describe("'inccommand' and :cnoremap", function()
it('still works with a broken mapping', function()
for _, case in pairs(cases) do
refresh(case, true)
- feed_command("cnoremap <expr> x execute('bwipeout!')[-1].'x'")
+ command("cnoremap <expr> x execute('bwipeout!')[-1].'x'")
feed(":%s/tw/tox<enter>")
screen:expect{any=[[{14:^E565:]]}
@@ -1799,9 +1670,11 @@ describe("'inccommand' and :cnoremap", function()
it('work when temporarily moving the cursor', function()
for _, case in pairs(cases) do
refresh(case)
- feed_command("cnoremap <expr> x cursor(1, 1)[-1].'x'")
+ command("cnoremap <expr> x cursor(1, 1)[-1].'x'")
- feed(":%s/tw/tox/g<enter>")
+ feed(":%s/tw/tox")
+ poke_eventloop()
+ feed("/g<enter>")
expect(default_text:gsub("tw", "tox"))
end
end)
@@ -1809,9 +1682,11 @@ describe("'inccommand' and :cnoremap", function()
it("work when a mapping disables 'inccommand'", function()
for _, case in pairs(cases) do
refresh(case)
- feed_command("cnoremap <expr> x execute('set inccommand=')[-1]")
+ command("cnoremap <expr> x execute('set inccommand=')[-1]")
- feed(":%s/tw/toxa/g<enter>")
+ feed(":%s/tw/tox")
+ poke_eventloop()
+ feed("a/g<enter>")
expect(default_text:gsub("tw", "toa"))
end
end)
@@ -1823,6 +1698,7 @@ describe("'inccommand' and :cnoremap", function()
\.fo<CR><C-c>:new<CR>:bw!<CR>:<C-r>=remove(g:, 'fo')<CR>x]])
feed(":%s/tw/tox")
+ poke_eventloop()
feed("/<enter>")
expect(default_text:gsub("tw", "tox"))
end
@@ -1883,7 +1759,7 @@ describe("'inccommand' autocommands", function()
local function register_autocmd(event)
meths.set_var(event .. "_fired", {})
- feed_command("autocmd " .. event .. " * call add(g:" .. event .. "_fired, expand('<abuf>'))")
+ command("autocmd " .. event .. " * call add(g:" .. event .. "_fired, expand('<abuf>'))")
end
it('are not fired when splitting', function()
@@ -1930,95 +1806,63 @@ describe("'inccommand' split windows", function()
refresh()
feed("gg")
- feed_command("vsplit")
- feed_command("split")
+ command("vsplit")
+ command("split")
feed(":%s/tw")
screen:expect([[
Inc substitution on │Inc substitution on|
{12:tw}o lines │{12:tw}o lines |
│ |
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
+ {15:~ }│{15:~ }|*11
{11:[No Name] [+] }│{15:~ }|
Inc substitution on │{15:~ }|
{12:tw}o lines │{15:~ }|
│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
+ {15:~ }│{15:~ }|*2
{10:[No Name] [+] [No Name] [+] }|
|2| {12:tw}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/tw^ |
]])
feed("<esc>")
- feed_command("only")
- feed_command("split")
- feed_command("vsplit")
+ command("only")
+ command("split")
+ command("vsplit")
feed(":%s/tw")
screen:expect([[
Inc substitution on │Inc substitution on|
{12:tw}o lines │{12:tw}o lines |
│ |
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
- {15:~ }│{15:~ }|
+ {15:~ }│{15:~ }|*11
{11:[No Name] [+] }{10:[No Name] [+] }|
Inc substitution on |
{12:tw}o lines |
|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{10:[No Name] [+] }|
|2| {12:tw}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/tw^ |
]])
end)
local settings = {
- "splitbelow",
- "splitright",
- "noequalalways",
- "equalalways eadirection=ver",
- "equalalways eadirection=hor",
- "equalalways eadirection=both",
+ "splitbelow",
+ "splitright",
+ "noequalalways",
+ "equalalways eadirection=ver",
+ "equalalways eadirection=hor",
+ "equalalways eadirection=both",
}
it("are not affected by various settings", function()
for _, setting in pairs(settings) do
refresh()
- feed_command("set " .. setting)
+ command("set " .. setting)
feed(":%s/tw")
@@ -2026,31 +1870,10 @@ describe("'inccommand' split windows", function()
Inc substitution on |
{12:tw}o lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*17
{11:[No Name] [+] }|
|2| {12:tw}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/tw^ |
]])
@@ -2154,9 +1977,7 @@ describe(":substitute", function()
|2|{12: A B C} |
|3|{12: 4 5 6} |
|4|{12: X} Y Z |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{10:[Preview] }|
:%s/2\_.*X^ |
]])
@@ -2166,16 +1987,10 @@ describe(":substitute", function()
1 {12:MMM} Y Z |
7 8 9 |
|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11:[No Name] [+] }|
|1| 1 {12:MMM} Y Z |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/2\_.*X/MMM^ |
]])
@@ -2191,10 +2006,7 @@ describe(":substitute", function()
|1| 1 {12:MMM} |
|2|{12: K} |
|3|{12: LLL} Y Z |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
{10:[Preview] }|
:%s/2\_.*X/MMM\rK\rLLL^ |
]])
@@ -2209,17 +2021,7 @@ describe(":substitute", function()
1 {12:MMM} Y Z |
7 8 9 |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*11
:%s/2\_.*X/MMM^ |
]])
@@ -2230,15 +2032,7 @@ describe(":substitute", function()
{12:LLL} Y Z |
7 8 9 |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*9
:%s/2\_.*X/MMM\rK\rLLL^ |
]])
end)
@@ -2253,16 +2047,11 @@ describe(":substitute", function()
{12:XLK} bdc e{12:XLK}e {12:XLK} fgl lzi{12:XLK} r|
x |
|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11:[No Name] [+] }|
|1| {12:XLK} bdc e{12:XLK}e {12:XLK} fgl lzi{12:X}|
{12:LK} r |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/a/XLK^ |
]])
@@ -2278,17 +2067,7 @@ describe(":substitute", function()
{12:XLK} bdc e{12:XLK}e {12:XLK} fgl lzi{12:XLK} r|
x |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*11
:%s/a/XLK^ |
]])
end)
@@ -2309,9 +2088,7 @@ describe(":substitute", function()
|2| {12:OKO} B C |
|3| 4 5 6 |
|4| {12:OKO} Y Z |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{10:[Preview] }|
:%s/[0-9]\n\zs[A-Z]/OKO^ |
]])
@@ -2329,14 +2106,7 @@ describe(":substitute", function()
{12:OKO} Y Z |
7 8 9 |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*8
:%s/[0-9]\n\zs[A-Z]/OKO^ |
]])
end)
@@ -2348,17 +2118,11 @@ describe(":substitute", function()
screen:expect([[
T {12:123123} {12:22}T TTT {12:090804090804} |
x |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{11:[No Name] [+] }|
|1| T {12:123123} {12:22}T TTT {12:090804090}|
{12:804} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
{10:[Preview] }|
:%s/T\([0-9]\+\)/\1\1/g^ |
]])
@@ -2371,18 +2135,7 @@ describe(":substitute", function()
screen:expect([[
T {12:123123} {12:22}T TTT {12:090804090804} |
x |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*12
:%s/T\([0-9]\+\)/\1\1/g^ |
]])
end)
@@ -2408,10 +2161,7 @@ describe(":substitute", function()
|3| afa {12:Q} |
|4|{12: }adf la;lkd {12:R} |
|5|{12: }alx |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
{10:[Preview] }|
:%s/[QR]\n^ |
]])
@@ -2425,12 +2175,7 @@ describe(":substitute", function()
{15:~ }|
{11:[No Name] [+] }|
|3| afa {12:KKK}adf la;lkd {12:KKK}alx |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/[QR]\n/KKK^ |
]])
@@ -2452,16 +2197,7 @@ describe(":substitute", function()
x |
afa {12:KKK}adf la;lkd {12:KKK}alx |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*10
:%s/[QR]\n/KKK^ |
]])
end)
@@ -2545,10 +2281,7 @@ describe(":substitute", function()
|1| {12:X¥¥} PEPPERS |
|2| {12:X¥¥} |
|3| a{12:X¥¥}¥KOL |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
{10:[Preview] }|
:%s/£.*ѫ/X¥¥^ |
]])
@@ -2583,14 +2316,7 @@ describe(":substitute", function()
£ ¥ libm |
£ ¥ |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*8
:%s/£.*ѫ/X¥¥^ |
]])
@@ -2605,11 +2331,7 @@ describe(":substitute", function()
£ ¥ libm |
£ ¥ |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*5
:%s/£.*ѫ/X¥¥\ra££ ¥^ |
]])
end)
@@ -2745,16 +2467,10 @@ describe(":substitute", function()
some{12:one} |
everything |
someone |
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11:[No Name] [+] }|
|1| some{12:one} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/\(some\)\@<=thing/one/^ |
]])
@@ -2767,16 +2483,10 @@ describe(":substitute", function()
something |
every{12:one} |
someone |
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11:[No Name] [+] }|
|2| every{12:one} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/\(some\)\@<!thing/one/^ |
]])
@@ -2788,16 +2498,10 @@ describe(":substitute", function()
{12:every}thing |
everything |
someone |
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11:[No Name] [+] }|
|1| {12:every}thing |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/some\(thing\)\@=/every/^ |
]])
@@ -2809,16 +2513,10 @@ describe(":substitute", function()
something |
everything |
{12:every}one |
- {15:~ }|
- {15:~ }|
+ {15:~ }|*2
{11:[No Name] [+] }|
|3| {12:every}one |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*6
{10:[Preview] }|
:%s/some\(thing\)\@!/every/^ |
]])
@@ -2834,9 +2532,7 @@ describe(":substitute", function()
{12:MO}o lines |
{11:[No Name] [+] }|
|2| {12:MO}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{10:[Preview] }|
:2,1s/tw/MO/g^ |
]])
@@ -2847,9 +2543,7 @@ describe(":substitute", function()
{12:MO}o lines |
{11:[No Name] [+] }|
|2| {12:MO}o lines |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{10:[Preview] }|
{13:Backwards range given, OK to swap (y/n)?}^ |
]])
@@ -2859,10 +2553,7 @@ describe(":substitute", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
{13:Backwards range given, OK to swap (y/n)?}y |
]])
end)
@@ -2908,9 +2599,7 @@ it(':substitute with inccommand, timer-induced :redraw #9777', function()
{12:ZZZ} bar baz |
bar baz fox |
bar {12:ZZZ} baz |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
{11:[No Name] [+] }|
|1| {12:ZZZ} bar baz |
|3| bar {12:ZZZ} baz |
@@ -2966,10 +2655,7 @@ it(':substitute with inccommand, does not crash if range contains invalid marks'
feed([[:'a,'bs]])
screen:expect([[
test |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:'a,'bs^ |
]])
-- v:errmsg shouldn't be set either before the first separator is typed
@@ -2977,10 +2663,7 @@ it(':substitute with inccommand, does not crash if range contains invalid marks'
feed('/')
screen:expect([[
test |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:'a,'bs/^ |
]])
end)
@@ -3030,10 +2713,7 @@ it(':substitute with inccommand, no unnecessary redraw if preview is not shown',
-- now inccommand is shown, so screen is redrawn
screen:expect([[
{12:test} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:s/test^ |
]])
end)
@@ -3050,9 +2730,7 @@ it(":substitute doesn't crash with inccommand, if undo is empty #12932", functio
feed('f')
screen:expect([[
{12:f} |
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*3
:%s/test/f^ |
]])
assert_alive()
@@ -3147,10 +2825,7 @@ it("with 'inccommand' typing invalid `={expr}` does not show error", function()
feed(':edit `=`')
screen:expect([[
|
- {15:~ }|
- {15:~ }|
- {15:~ }|
- {15:~ }|
+ {15:~ }|*4
:edit `=`^ |
]])
end)
diff --git a/test/functional/ui/inccommand_user_spec.lua b/test/functional/ui/inccommand_user_spec.lua
index da7508fad1..20e9dbdafa 100644
--- a/test/functional/ui/inccommand_user_spec.lua
+++ b/test/functional/ui/inccommand_user_spec.lua
@@ -270,13 +270,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the {1:cats} stop |
|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
:Replace text cats^ |
]])
end)
@@ -318,13 +312,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
^ |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
|
]])
end)
@@ -342,13 +330,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the cats stop |
^ |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
:Replace text cats |
]])
end)
@@ -366,13 +348,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
:.Replace text cats^ |
]])
end)
@@ -425,13 +401,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the cats stop |
|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
:C^ |
]])
assert_alive()
@@ -481,13 +451,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
a.a.a.a. |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
:Test a.a.a.a.^ |
]])
feed('<C-V><Esc>u')
@@ -501,13 +465,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
a.a.a. |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
:Test a.a.a.a.{5:^[}u^ |
]])
feed('<Esc>')
@@ -521,13 +479,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
^ |
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*7
|
]])
end
@@ -581,17 +533,7 @@ describe("'inccommand' with multiple buffers", function()
baz {1:bar} bar │ bar baz {1:bar} |
{1:bar} bar baz │ baz {1:bar} bar |
│ |
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
+ {2:~ }│{2:~ }|*11
{4:[No Name] [+] }{3:[No Name] [+] }|
:Replace foo bar^ |
]])
@@ -601,17 +543,7 @@ describe("'inccommand' with multiple buffers", function()
baz bar bar │ bar baz bar |
bar bar baz │ baz bar bar |
^ │ |
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
+ {2:~ }│{2:~ }|*11
{4:[No Name] [+] }{3:[No Name] [+] }|
:Replace foo bar |
]])
@@ -645,17 +577,7 @@ describe("'inccommand' with multiple buffers", function()
baz bar bar │ bar baz bar |
bar bar baz │ baz bar bar |
^ │ |
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
- {2:~ }│{2:~ }|
+ {2:~ }│{2:~ }|*11
{4:[No Name] [+] }{3:[No Name] [+] }|
:Replace foo bar |
]])
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index 05d55b94fb..a3ab1a4ab6 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -273,9 +273,7 @@ it('typing a simplifiable key at hit-enter prompt triggers mapping vim-patch:8.2
feed_command('ls')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2: }|
:ls |
1 %a "[No Name]" line 1 |
@@ -284,12 +282,7 @@ it('typing a simplifiable key at hit-enter prompt triggers mapping vim-patch:8.2
feed('<C-6>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
hit ctrl-6 |
]])
end)
@@ -333,12 +326,7 @@ describe('input non-printable chars', function()
feed_command("e Xtest-overwrite")
screen:expect([[
^foobar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
"Xtest-overwrite" [noeol] 1L, 6B |
]])
@@ -348,9 +336,7 @@ describe('input non-printable chars', function()
feed_command("w")
screen:expect([[
foobar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4: }|
"Xtest-overwrite" |
{2:WARNING: The file has been changed since reading it!!!} |
@@ -360,8 +346,7 @@ describe('input non-printable chars', function()
feed("u")
screen:expect([[
foobar |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{4: }|
"Xtest-overwrite" |
{2:WARNING: The file has been changed since reading it!!!} |
@@ -396,12 +381,7 @@ describe('input non-printable chars', function()
feed("<cr>")
screen:expect([[
^foobar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -449,11 +429,7 @@ describe('display is updated', function()
screen:expect([[
abc |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
end)
@@ -465,11 +441,7 @@ describe('display is updated', function()
screen:expect([[
abc |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
end)
diff --git a/test/functional/ui/linematch_spec.lua b/test/functional/ui/linematch_spec.lua
index ef47ea7ed0..2dcc8c5858 100644
--- a/test/functional/ui/linematch_spec.lua
+++ b/test/functional/ui/linematch_spec.lua
@@ -107,8 +107,7 @@ describe('Diff mode screen with 3 diffs open', function()
{1: }{10: 10 }{9: BBB }│{1: }{10: 10 }{9: BBB }│{1: }{10: }{2:---------------------------}|
{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: }{2:---------------------------}|
{1: }{10: 12 } │{1: }{10: 12 } │{1: }{10: 6 } |
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
+ {6:~ }│{6:~ }│{6:~ }|*2
{7:<-functional-diff-screen-1.3 [+] }{3:<est-functional-diff-screen-1.2 Xtest-functional-diff-screen-1 }|
:2,6diffget screen-1.2 |
]])
@@ -127,11 +126,7 @@ describe('Diff mode screen with 3 diffs open', function()
{1: }{10: 5 }{9: }{8:BBB}{9: }│{1: }{10: 7 }{9: }{8:BBB}{9: }│{1: }{10: 5 }{9: }{8:AAA}{9: }|
{1: }{10: }{2:---------------------------}│{1: }{10: 8 }{4:>>>>>>> branch1 }│{1: }{10: }{2:---------------------------}|
{1: }{10: 6 } │{1: }{10: 9 } │{1: }{10: 6 } |
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
+ {6:~ }│{6:~ }│{6:~ }|*5
{3:<test-functional-diff-screen-1.3 }{7:<functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:5,7diffget screen-1.3 |
]])
@@ -153,8 +148,7 @@ describe('Diff mode screen with 3 diffs open', function()
{1: }{10: 5 } BBB │{1: }{10: 10 } BBB │{1: }{10: 9 } BBB |
{1: }{10: }{2:---------------------------}│{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: 10 }{9:>>>>>>> branch1 }|
{1: }{10: 6 } │{1: }{10: 12 } │{1: }{10: 11 } |
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
+ {6:~ }│{6:~ }│{6:~ }|*2
{3:<test-functional-diff-screen-1.3 <est-functional-diff-screen-1.2 }{7:<st-functional-diff-screen-1 [+] }|
:5,6diffget screen-1.2 |
]])
@@ -176,8 +170,7 @@ describe('Diff mode screen with 3 diffs open', function()
{1: }{10: 5 } BBB │{1: }{10: 10 } BBB │{1: }{10: 7 } BBB |
{1: }{10: }{2:---------------------------}│{1: }{10: 11 }{4:>>>>>>> branch1 }│{1: }{10: }{2:---------------------------}|
{1: }{10: 6 } │{1: }{10: 12 } │{1: }{10: 8 } |
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
+ {6:~ }│{6:~ }│{6:~ }|*2
{3:<test-functional-diff-screen-1.3 }{7:<est-functional-diff-screen-1.2 }{3:<st-functional-diff-screen-1 [+] }|
:6,8diffput screen-1 |
]])
@@ -199,8 +192,7 @@ describe('Diff mode screen with 3 diffs open', function()
{1: }{10: 5 } BBB │{1: }{10: 10 } BBB │{1: }{10: 9 } BBB |
{1: }{10: }{2:---------------------------}│{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: 10 }{9:>>>>>>> branch1 }|
{1: }{10: 6 } │{1: }{10: 12 } │{1: }{10: 11 } |
- {6:~ }│{6:~ }│{6:~ }|
- {6:~ }│{6:~ }│{6:~ }|
+ {6:~ }│{6:~ }│{6:~ }|*2
{3:<test-functional-diff-screen-1.3 }{7:<est-functional-diff-screen-1.2 }{3:<st-functional-diff-screen-1 [+] }|
:6,11diffput screen-1 |
]])
@@ -310,12 +302,7 @@ something
{1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
{1: }{10: 15 }something │{1: }{10: 17 }something |
{1: }{10: 16 } │{1: }{10: 18 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:5,9diffget |
]])
@@ -339,9 +326,7 @@ something
{1: }{10: }{2:-------------------------------------------}│{1: }{10: 13 }{4:DEF }|
{1: }{10: 12 }something │{1: }{10: 14 }something |
{1: }{10: 13 } │{1: }{10: 15 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*3
{3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
:5,10diffget |
]])
@@ -363,11 +348,7 @@ something
{1: }{10: 11 }common line │{1: }{10: 11 }common line |
{1: }{10: 12 }something │{1: }{10: 12 }something |
{1: }{10: 13 } │{1: }{10: 13 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*5
{3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
:4,17diffget |
]])
@@ -804,19 +785,7 @@ d
{1: }{10: 3 }{9:d }│{1: }{10: 2 }{8:// }{9:d }|
{1: }{10: }{2:-------------------------------------------}│{1: }{10: 3 }{4:// d }|
{1: }{10: 4 } │{1: }{10: 4 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*13
{7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
@@ -853,17 +822,7 @@ void testFunction () {
{1: }{10: }{2:-------------------------------------------}│{1: }{10: 5 }{4: } }|
{1: }{10: 4 }} │{1: }{10: 6 }} |
{1: }{10: 5 } │{1: }{10: 7 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*11
{7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
@@ -903,15 +862,7 @@ void testFunction () {
{1: }{10: 7 }{4:?B }│{1: }{10: }{2:--------------------------------------------}|
{1: }{10: 8 }{4:?C }│{1: }{10: }{2:--------------------------------------------}|
{1: }{10: 9 } │{1: }{10: 4 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*9
{7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
@@ -951,15 +902,7 @@ void testFunction () {
{1: }{10: 7 }{8:?}{9:C }│{1: }{10: 3 }{8:!}{9:C }|
{1: }{10: 8 }{4:?C }│{1: }{10: }{2:--------------------------------------------}|
{1: }{10: 9 } │{1: }{10: 4 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*9
{7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
@@ -1099,12 +1042,7 @@ something
{1: }{10: 10 }common line │{1: }{10: 10 }common line |
{1: }{10: 11 }something │{1: }{10: 11 }something |
{1: }{10: 12 } │{1: }{10: 12 } |
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
- {6:~ }│{6:~ }|
+ {6:~ }│{6:~ }|*6
{7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:1,19diffget |
]])
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 1d11a12af4..85895b2c36 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -50,10 +50,7 @@ describe('ui/ext_messages', function()
feed(':call confirm("test")<cr>')
screen:expect{grid=[[
line ^1 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={ {
content = {{"\ntest\n[O]k: ", 4}},
kind = 'confirm',
@@ -62,10 +59,7 @@ describe('ui/ext_messages', function()
feed('<cr>')
screen:expect{grid=[[
line ^1 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -77,9 +71,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
line 1 |
line ^2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], messages={ {
content = {{"\ntest\n[O]k: ", 4}},
kind = 'confirm',
@@ -88,9 +80,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
line 1 |
line ^2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], messages={ {
content = { { "\ntest\n[O]k: ", 4 } },
kind = "confirm"
@@ -108,9 +98,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
l{7:i}ne 1 |
l{8:i}ne ^2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], attr_ids={
[1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
@@ -133,9 +121,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
line 1 |
{MATCH:.*}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], attr_ids={
[1] = {bold = true, foreground = Screen.colors.Blue1},
[7] = {foreground = Screen.colors.Red},
@@ -150,9 +136,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
l^ine 1 |
line 2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], attr_ids={
[1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
@@ -171,9 +155,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
l^ine 1 |
line 2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], messages={ {
content = { { "Error detected while processing :", 2 } },
kind = "emsg"
@@ -193,9 +175,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
line 1 |
^line 2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], messages={ {
content = { { "(2 of 2): line2" } },
kind = "quickfix"
@@ -206,10 +186,7 @@ describe('ui/ext_messages', function()
feed(':echoerr "raa"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{"raa", 2}},
kind = "echoerr",
@@ -219,10 +196,7 @@ describe('ui/ext_messages', function()
feed(':')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], cmdline={{
firstc = ":",
content = {{ "" }},
@@ -233,10 +207,7 @@ describe('ui/ext_messages', function()
feed('echoerr "bork" | echoerr "fail"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "bork", 2 }},
kind = "echoerr"
@@ -251,10 +222,7 @@ describe('ui/ext_messages', function()
feed(':echoerr "extrafail"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = { { "bork", 2 } },
kind = "echoerr"
@@ -272,20 +240,14 @@ describe('ui/ext_messages', function()
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
-- cmdline without interleaving wait/display keeps the error message
feed(':echoerr "problem" | let x = input("foo> ")<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "problem", 2 }},
kind = "echoerr"
@@ -298,20 +260,14 @@ describe('ui/ext_messages', function()
feed('solution<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
eq('solution', eval('x'))
feed(":messages<cr>")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], msg_history={
{kind="echoerr", content={{"raa", 2}}},
{kind="echoerr", content={{"bork", 2}}},
@@ -326,10 +282,7 @@ describe('ui/ext_messages', function()
feed '<cr>'
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -338,10 +291,7 @@ describe('ui/ext_messages', function()
feed(':echoerr g:multi<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "bork\nfail", 2 }},
kind = "echoerr"
@@ -350,10 +300,7 @@ describe('ui/ext_messages', function()
feed(':messages<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "Press ENTER or type command to continue", 4 }},
kind = "return_prompt"
@@ -371,9 +318,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
{7:^line} 1 |
{7:line} 2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], messages={
{content = {{"/line W [1/2]"}}, kind = "search_count"}
}}
@@ -382,9 +327,7 @@ describe('ui/ext_messages', function()
screen:expect{grid=[[
{7:line} 1 |
{7:^line} 2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], messages={
{content = {{"/line [2/2]"}}, kind = "search_count"}
}}
@@ -394,10 +337,7 @@ describe('ui/ext_messages', function()
feed(':hi ErrorMsg<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={
{content = {{"\nErrorMsg " }, {"xxx", 2}, {" "},
{"ctermfg=", 5 }, { "15 " }, { "ctermbg=", 5 }, { "1 " },
@@ -411,10 +351,7 @@ describe('ui/ext_messages', function()
feed(':let x y<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={
{content = {{ "x #1" }}, kind = ""},
{content = {{ "y #2" }}, kind = ""},
@@ -427,10 +364,7 @@ describe('ui/ext_messages', function()
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={{"-- INSERT --", 3}}}
feed('alphpabet<cr>alphanum<cr>')
@@ -438,8 +372,7 @@ describe('ui/ext_messages', function()
alphpabet |
alphanum |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]], showmode={ { "-- INSERT --", 3 } }}
feed('<c-x>')
@@ -447,8 +380,7 @@ describe('ui/ext_messages', function()
alphpabet |
alphanum |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]], showmode={ { "-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)", 3 } }}
feed('<c-p>')
@@ -456,8 +388,7 @@ describe('ui/ext_messages', function()
alphpabet |
alphanum |
alphanum^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]], popupmenu={
anchor = { 1, 2, 0 },
items = { { "alphpabet", "", "", "" }, { "alphanum", "", "", "" } },
@@ -471,8 +402,7 @@ describe('ui/ext_messages', function()
alphpabet |
alphanum |
alphanum^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]], popupmenu={
anchor = { 1, 2, 0 },
items = { { "alphpabet", "", "", "" }, { "alphanum", "", "", "" } },
@@ -487,8 +417,7 @@ describe('ui/ext_messages', function()
alphpabet |
alphanum |
alphpabet^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]], popupmenu={
anchor = { 1, 2, 0 },
items = { { "alphpabet", "", "", "" }, { "alphanum", "", "", "" } },
@@ -503,8 +432,7 @@ describe('ui/ext_messages', function()
alphpabet |
alphanum |
alphpabe^t |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]], msg_history={{
content = {{ "stuff" }},
kind = "echomsg",
@@ -518,37 +446,25 @@ describe('ui/ext_messages', function()
feed('qq')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "recording @q", 3 } }}
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "-- INSERT --recording @q", 3 } }}
feed('<esc>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "recording @q", 3 } }}
feed('q')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]])
end)
@@ -558,37 +474,25 @@ describe('ui/ext_messages', function()
-- also check mode to avoid immediate success
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "recording @q", 3 } }, mode="normal"}
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "recording @q", 3 } }, mode="insert"}
feed('<esc>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "recording @q", 3 } }, mode="normal"}
feed('q')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], mode="normal"}
end)
@@ -596,66 +500,48 @@ describe('ui/ext_messages', function()
command('set showcmd ruler')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], ruler={ { "0,0-1 All" } }}
feed('i')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], showmode={ { "-- INSERT --", 3 } }, ruler={ { "0,1 All" } }}
feed('abcde<cr>12345<esc>')
screen:expect{grid=[[
abcde |
1234^5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], ruler={ { "2,5 All" } }}
feed('d')
screen:expect{grid=[[
abcde |
1234^5 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], showcmd={ { "d" } }, ruler={ { "2,5 All" } }}
feed('<esc>^')
screen:expect{grid=[[
abcde |
^12345 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], ruler={ { "2,1 All" } }}
feed('d')
screen:expect{grid=[[
abcde |
^12345 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], showcmd={ { "d" } }, ruler={ { "2,1 All" } }}
feed('i')
screen:expect{grid=[[
abcde |
^12345 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], showcmd={ { "di" } }, ruler={ { "2,1 All" } }}
feed('w')
screen:expect{grid=[[
abcde |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]], ruler={ { "2,0-1 All" } }}
-- when ruler is part of statusline it is not externalized.
@@ -664,8 +550,7 @@ describe('ui/ext_messages', function()
screen:expect([[
abcde |
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{6:<o Name] [+] 2,0-1 All}|
]])
end)
@@ -674,10 +559,7 @@ describe('ui/ext_messages', function()
feed(':echomsg "howdy"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "howdy" }}, kind = "echomsg"}
}}
@@ -687,10 +569,7 @@ describe('ui/ext_messages', function()
feed('<c-c>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "Type :qa and press <Enter> to exit Nvim" }},
kind = ""}
@@ -699,10 +578,7 @@ describe('ui/ext_messages', function()
feed(':echoerr "bork"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "bork", 2 }}, kind = "echoerr"}
}}
@@ -710,10 +586,7 @@ describe('ui/ext_messages', function()
feed(':echo "xyz"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "xyz" }}, kind = "echo"}
}}
@@ -721,10 +594,7 @@ describe('ui/ext_messages', function()
feed(':call nosuchfunction()<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{ "E117: Unknown function: nosuchfunction", 2 }},
kind = "emsg"}
@@ -733,10 +603,7 @@ describe('ui/ext_messages', function()
feed(':messages<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], msg_history={
{kind="echomsg", content={{"howdy"}}},
{kind="", content={{"Type :qa and press <Enter> to exit Nvim"}}},
@@ -753,10 +620,7 @@ describe('ui/ext_messages', function()
feed(':set cmdheight=1')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], cmdline={{
content = { { "set cmdheight=1" } },
firstc = ":",
@@ -766,20 +630,14 @@ describe('ui/ext_messages', function()
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]])
eq(0, eval('&cmdheight'))
feed(':set cmdheight=0')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], cmdline={{
content = { { "set cmdheight=0" } },
firstc = ":",
@@ -788,10 +646,7 @@ describe('ui/ext_messages', function()
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]])
eq(0, eval('&cmdheight'))
end)
@@ -800,10 +655,7 @@ describe('ui/ext_messages', function()
feed(':lua error("such\\nmultiline\\nerror")<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{[[E5108: Error executing lua [string ":lua"]:1: such
multiline
@@ -820,10 +672,7 @@ stack traceback:
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={{
content = {{"Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 2}},
kind = "rpc_error"
@@ -855,12 +704,7 @@ stack traceback:
feed(':set wildm<tab>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
]], messages={{
content = {{'wildmenu wildmode'}},
kind = '',
@@ -879,9 +723,7 @@ stack traceback:
feed('z=')
screen:expect{grid=[[
{9:helllo} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{1:^~ }|
]], messages={
{content = { { 'Change "helllo" to:\n 1 "Hello"\n 2 "Hallo"\n 3 "Hullo"\nType number and <Enter> or click with the mouse (q or empty cancels): ' } }, kind = ""}
@@ -890,9 +732,7 @@ stack traceback:
feed('1')
screen:expect{grid=[[
{9:helllo} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{1:^~ }|
]], messages={
{content = { { 'Change "helllo" to:\n 1 "Hello"\n 2 "Hallo"\n 3 "Hullo"\nType number and <Enter> or click with the mouse (q or empty cancels): ' } }, kind = ""},
@@ -902,10 +742,7 @@ stack traceback:
feed('<cr>')
screen:expect{grid=[[
^Hello |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -913,10 +750,7 @@ stack traceback:
async_meths.echo({{'wow, ',"Search"}, {"such\n\nvery ", "ErrorMsg"}, {"color", "LineNr"}}, true, {})
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={
{ content = { { "wow, ", 7 }, { "such\n\nvery ", 2 }, { "color", 10 } }, kind = "echomsg" }
}}
@@ -924,10 +758,7 @@ stack traceback:
feed ':ls<cr>'
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={
{ content = { { '\n 1 %a "[No Name]" line 1' } }, kind = "" }
}}
@@ -935,10 +766,7 @@ stack traceback:
feed ':messages<cr>'
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], messages={
{ content = { { "Press ENTER or type command to continue", 4 } }, kind = "return_prompt" }
}, msg_history={
@@ -948,10 +776,7 @@ stack traceback:
feed '<cr>'
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -1007,8 +832,7 @@ describe('ui/builtin messages', function()
feed(':hi ErrorMsg<cr>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3: }|
:hi ErrorMsg |
ErrorMsg {2:xxx} {5:ctermfg=}15 {5:ctermbg=}1 {5:guifg=}White {5:guibg=}Red |
@@ -1092,31 +916,19 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':call T1()<CR>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
message T1 |
]]}
feed(':call T2()<CR>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
message T2 |
]]}
feed(':call T3()<CR>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
message T3 |
]]}
end)
@@ -1125,33 +937,21 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
command("set ruler laststatus=0")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
0,0-1 All |
]]}
command("hi MsgArea guibg=#333333")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{7: 0,0-1 All }|
]]}
command("set rulerformat=%15(%c%V\\ %p%%%)")
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{7: 0,0-1 100% }|
]]}
end)
@@ -1160,8 +960,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':echo "line 1\\r\\nline 2"<cr>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3: }|
line 1 |
line 2 |
@@ -1171,11 +970,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed('<cr>:echo "abc\\rz"<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
zbc |
]]}
end)
@@ -1245,8 +1040,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>')
screen:expect{grid=[[
{2:E5108: Error executing lua [string ":lua"]:1: x} |
- |
- |
+ |*2
{2:x} |
{2:stack traceback:} |
{2: [C]: in function 'error'} |
@@ -1255,8 +1049,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed('<cr>')
screen:expect{grid=[[
- |
- |
+ |*2
{2:x} |
{2:stack traceback:} |
{2: [C]: in function 'error'} |
@@ -1280,11 +1073,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed '<cr>'
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
@@ -1319,8 +1108,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{11: 2 }^bbb |
{11: 3 }ccc |
{11: 4 } |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end)
@@ -1341,9 +1129,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':call PrintAndWait()<CR>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3: }|
aaa |
bbb^ |
@@ -1383,9 +1169,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
]], false)
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{3: }|
|
{4:Press ENTER or type command to continue}^ |
@@ -1393,11 +1177,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed('<CR>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
eq(1, meths.get_option_value('cmdheight', {}))
@@ -1408,9 +1188,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:try_resize(60, 5)
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
eq({ mode = 'n', blocking = false }, meths.get_mode())
@@ -1451,10 +1229,7 @@ describe('ui/ext_messages', function()
-- Note parts of it depends on version or is indeterministic. We ignore those parts.
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{MATCH:.*}|
{1:~ }|
{1:~ }Nvim is open source and freely distributable{1: }|
@@ -1467,50 +1242,20 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
- {MATCH:.*}|
- {MATCH:.*}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {MATCH:.*}|*2
+ {1:~ }|*5
]])
feed("<c-l>")
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*23
]])
feed(":intro<cr>")
screen:expect{grid=[[
^ |
- |
- |
- |
- |
+ |*4
{MATCH:.*}|
|
Nvim is open source and freely distributable |
@@ -1523,13 +1268,8 @@ describe('ui/ext_messages', function()
|
{MATCH: +}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
|
- {MATCH:.*}|
- {MATCH:.*}|
- |
- |
- |
- |
- |
+ {MATCH:.*}|*2
+ |*5
]], messages={
{content = { { "Press ENTER or type command to continue", 4 } }, kind = "return_prompt" }
}}
@@ -1541,28 +1281,10 @@ describe('ui/ext_messages', function()
feed(":set cmdheight<cr>")
screen:expect({grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
────────────────────────────────────────────────────────────────────────────────|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
{7:[No Name] }|
]], messages={
{content = { { " cmdheight=0" } }, kind = "" }
@@ -1572,28 +1294,10 @@ describe('ui/ext_messages', function()
feed(":set laststatus<cr>")
screen:expect({grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
────────────────────────────────────────────────────────────────────────────────|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*9
{7:[No Name] }|
]], messages={
{content = { { " laststatus=3" } }, kind = "" }
@@ -1607,28 +1311,10 @@ describe('ui/ext_messages', function()
feed(":set cmdheight<cr>")
screen:expect({grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
────────────────────────────────────────────────────────────────────────────────|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
{7:[No Name] }|
]], messages={
{content = { { " cmdheight=0" } }, kind = "" }
@@ -1726,9 +1412,7 @@ aliquip ex ea commodo consequat.]])
feed('q')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end)
@@ -1748,9 +1432,7 @@ aliquip ex ea commodo consequat.]])
feed('q')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
feed(':mess<cr>')
@@ -2064,10 +1746,7 @@ aliquip ex ea commodo consequat.]])
feed(':!sleep 1<cr>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{12: }|
:!sleep 1 |
|
@@ -2080,8 +1759,7 @@ aliquip ex ea commodo consequat.]])
-- before the "press ENTER" prompt though
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{12: }|
:!sleep 1 |
|
@@ -2092,9 +1770,7 @@ aliquip ex ea commodo consequat.]])
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end)
@@ -2134,9 +1810,7 @@ aliquip ex ea commodo consequat.]])
{2:mpore} |
{2:incididunt ut labore et dolore}|
{2:a aliqua.} |
- |
- |
- |
+ |*3
{4:-- More --}^ |
]]}
@@ -2177,16 +1851,7 @@ aliquip ex ea commodo consequat.]])
feed('q')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
|
]]}
end)
@@ -2208,13 +1873,7 @@ aliquip ex ea commodo consequat.]])
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
]]}
feed('g<lt>')
@@ -2232,13 +1891,7 @@ aliquip ex ea commodo consequat.]])
feed('<cr>')
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
]]}
end)
end)
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua
index e870d6f25f..3d5f94cdce 100644
--- a/test/functional/ui/mode_spec.lua
+++ b/test/functional/ui/mode_spec.lua
@@ -24,24 +24,21 @@ describe('ui mode_change event', function()
it('works in normal mode', function()
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
feed('d')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="operator"}
feed('<esc>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
end)
@@ -54,16 +51,14 @@ describe('ui mode_change event', function()
feed('c')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="operator"}
feed('c')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{4:E21: Cannot make changes, 'modifiable' is off} |
]], mode="normal"}
end)
@@ -73,16 +68,14 @@ describe('ui mode_change event', function()
feed('gr')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="replace"}
feed('<Esc>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
end)
@@ -91,16 +84,14 @@ describe('ui mode_change event', function()
feed('i')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- INSERT --} |
]], mode="insert"}
feed('word<esc>')
screen:expect{grid=[[
wor^d |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
@@ -114,23 +105,20 @@ describe('ui mode_change event', function()
feed('a(stuff')
screen:expect{grid=[[
word(stuff^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- INSERT --} |
]], mode="insert", timeout=screen_timeout}
feed(')')
screen:expect{grid=[[
word^(stuff) |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- INSERT --} |
]], mode="showmatch", timeout=screen_timeout}
screen:expect{grid=[[
word(stuff)^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- INSERT --} |
]], mode="insert", timeout=screen_timeout}
end)
@@ -140,16 +128,14 @@ describe('ui mode_change event', function()
feed('R')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- REPLACE --} |
]], mode="replace"}
feed('word<esc>')
screen:expect{grid=[[
wor^d |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
end)
@@ -158,24 +144,21 @@ describe('ui mode_change event', function()
feed(':')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:^ |
]], mode="cmdline_normal"}
feed('x<left>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:^x |
]], mode="cmdline_insert"}
feed('<insert>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:^x |
]], mode="cmdline_replace"}
@@ -183,16 +166,14 @@ describe('ui mode_change event', function()
feed('<right>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:x^ |
]], mode="cmdline_normal"}
feed('<esc>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
end)
@@ -202,16 +183,14 @@ describe('ui mode_change event', function()
feed('v')
screen:expect{grid=[[
tex^t |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- VISUAL --} |
]], mode="visual"}
feed('<esc>')
screen:expect{grid=[[
tex^t |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
@@ -219,16 +198,14 @@ describe('ui mode_change event', function()
feed('v')
screen:expect{grid=[[
tex^t |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:-- VISUAL --} |
]], mode="visual_select"}
feed('<esc>')
screen:expect{grid=[[
tex^t |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], mode="normal"}
end)
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index 1356ba3db8..e408df7096 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -151,24 +151,21 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftDrag><14,0>')
screen:expect([[
{tab: + bar }{sel: + foo }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -181,24 +178,21 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><11,0>')
screen:expect{grid=[[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], unchanged=true}
feed('<LeftDrag><6,0>')
screen:expect([[
{sel: + bar }{tab: + foo }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -211,24 +205,21 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftDrag><7,0>')
screen:expect([[
{tab: + bar }{sel: + foo }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -241,32 +232,28 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftDrag><4,1>')
screen:expect{grid=[[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], unchanged=true}
feed('<LeftDrag><14,1>')
screen:expect([[
{tab: + bar }{sel: + foo }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -279,32 +266,28 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><11,0>')
screen:expect{grid=[[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], unchanged=true}
feed('<LeftDrag><11,1>')
screen:expect{grid=[[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], unchanged=true}
feed('<LeftDrag><6,1>')
screen:expect([[
{sel: + bar }{tab: + foo }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -317,32 +300,28 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftDrag><4,1>')
screen:expect{grid=[[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]], unchanged=true}
feed('<LeftDrag><7,1>')
screen:expect([[
{tab: + bar }{sel: + foo }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -366,16 +345,14 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -389,16 +366,13 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<LeftMouse><24,0>')
screen:expect([[
this is fo^o |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -412,16 +386,14 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
feed('<2-LeftMouse><4,0>')
screen:expect([[
{sel: Name] }{tab: + foo + bar }{fill: }{tab:X}|
{0:^$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -574,16 +546,14 @@ describe('ui/mouse/input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
^this is bar{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
:tabprevious |
]])
feed('<LeftDrag><4,1>')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
{vis:this}^ is bar{0:$} |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sel:-- VISUAL --} |
]])
end)
@@ -601,15 +571,11 @@ describe('ui/mouse/input', function()
testing │testing |
mouse │mouse |
support and selection │support and selection |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*2
{0:~ }│{4:[No Name] [+] }|
{0:~ }│foo{0:$} |
{0:~ }│ba^r{0:$} |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*4
{4:[No Name] [+] }{5:[No Name] [+] }|
|
]]}
@@ -619,15 +585,11 @@ describe('ui/mouse/input', function()
testing │testing |
mouse │mouse |
support and selection │support and selection |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*2
{0:~ }│{4:[No Name] [+] }|
{0:~ }│^foo{0:$} |
{0:~ }│bar{0:$} |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*4
{4:[No Name] [+] }{5:[No Name] [+] }|
|
]]}
@@ -637,15 +599,11 @@ describe('ui/mouse/input', function()
testing │testing |
mouse │mouse |
support and selection │support and selection |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*2
{0:~ }│{4:[No Name] [+] }|
{0:~ }│{1:foo}{3:$} |
{0:~ }│{1:bar}{0:^$} |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*4
{4:[No Name] [+] }{5:[No Name] [+] }|
{2:-- VISUAL --} |
]]}
@@ -834,8 +792,7 @@ describe('ui/mouse/input', function()
meths.set_option_value('statuscolumn', 'foobar', { win = oldwin })
screen:expect([[
{8:fo}│{0:^$} |
- {8:fo}│{0:~ }|
- {8:fo}│{0:~ }|
+ {8:fo}│{0:~ }|*2
{4:< }{5:[No Name] }|
|
]])
@@ -971,8 +928,7 @@ describe('ui/mouse/input', function()
feed("a <esc>20Ab<esc>")
screen:expect([[
- |
- |
+ |*2
bbbbbbbbbbbbbbb^b |
{0:~ }|
|
@@ -980,8 +936,7 @@ describe('ui/mouse/input', function()
feed("<ScrollWheelLeft><0,0>")
screen:expect([[
- |
- |
+ |*2
n bbbbbbbbbbbbbbbbbbb^b |
{0:~ }|
|
@@ -1003,8 +958,7 @@ describe('ui/mouse/input', function()
feed("a <esc>20Ab<esc>")
screen:expect([[
- |
- |
+ |*2
bbbbbbbbbbbbbbb^b |
{0:~ }|
|
@@ -1012,8 +966,7 @@ describe('ui/mouse/input', function()
meths.input_mouse('wheel', 'left', '', 0, 0, 27)
screen:expect([[
- |
- |
+ |*2
n bbbbbbbbbbbbbbbbbbb^b |
{0:~ }|
|
@@ -1083,8 +1036,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
{c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1094,8 +1046,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
{c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1105,8 +1056,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
{c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1116,8 +1066,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t^3{c: } {c: }|
{c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1127,8 +1076,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
{c:^>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1138,8 +1086,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
{c:>} 私は^猫が大好き{0:>---}{c: X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1149,8 +1096,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
{c:>} 私は猫が大好き{0:>---}{c: ^X } {0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1166,8 +1112,7 @@ describe('ui/mouse/input', function()
t4{c: } |
{c:>} 私は猫が大好き{0:>---}{c: X} |
{c: } ✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><0,2>')
@@ -1177,8 +1122,7 @@ describe('ui/mouse/input', function()
^t4{c: } |
{c:>} 私は猫が大好き{0:>---}{c: X} |
{c: } ✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><8,3>')
@@ -1188,8 +1132,7 @@ describe('ui/mouse/input', function()
t4{c: } |
{c:>} 私は猫^が大好き{0:>---}{c: X} |
{c: } ✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><21,3>')
@@ -1199,8 +1142,7 @@ describe('ui/mouse/input', function()
t4{c: } |
{c:>} 私は猫が大好き{0:>---}{c: ^X} |
{c: } ✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><4,4>')
@@ -1210,8 +1152,7 @@ describe('ui/mouse/input', function()
t4{c: } |
{c:>} 私は猫が大好き{0:>---}{c: X} |
{c: } ✨^🐈✨ |
- |
- |
+ |*2
]])
end) -- level 1 - wrapped
@@ -1225,8 +1166,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1236,8 +1176,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} ^t2 t3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1247,8 +1186,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t^3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1258,8 +1196,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:^>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1269,8 +1206,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:>} 私は猫^が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1280,8 +1216,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:^X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end) -- level 2 - non wrapped
@@ -1295,8 +1230,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sm:-- INSERT --} |
]])
@@ -1306,8 +1240,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} ^t2 t3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sm:-- INSERT --} |
]])
@@ -1317,8 +1250,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t^3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sm:-- INSERT --} |
]])
@@ -1328,8 +1260,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:^>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sm:-- INSERT --} |
]])
@@ -1339,8 +1270,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:>} 私は猫^が大好き{0:>---}{c:X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sm:-- INSERT --} |
]])
@@ -1350,8 +1280,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
{c:>} 私は猫が大好き{0:>---}{c:^X} ✨{0:>}|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{sm:-- INSERT --} |
]])
end) -- level 2 - non wrapped (insert mode)
@@ -1366,8 +1295,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><14,1>')
@@ -1377,8 +1305,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><18,1>')
@@ -1388,8 +1315,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
✨🐈✨ |
- |
- |
+ |*2
]])
-- NOTE: The click would ideally be on the 't' in 't4', but wrapping
@@ -1405,8 +1331,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><1,2>')
@@ -1416,8 +1341,7 @@ describe('ui/mouse/input', function()
t^4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><0,3>')
@@ -1427,8 +1351,7 @@ describe('ui/mouse/input', function()
t4 |
{c:^>} 私は猫が大好き{0:>---}{c:X} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><20,3>')
@@ -1438,8 +1361,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:^X} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><1,4>')
@@ -1449,8 +1371,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
^✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><5,4>')
@@ -1460,8 +1381,7 @@ describe('ui/mouse/input', function()
t4 |
{c:>} 私は猫が大好き{0:>---}{c:X} |
✨🐈^✨ |
- |
- |
+ |*2
]])
end) -- level 2 - wrapped
@@ -1474,8 +1394,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
^ 私は猫が大好き{0:>----} ✨🐈|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1485,8 +1404,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
^私は猫が大好き{0:>----} ✨🐈|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1496,8 +1414,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
私は猫が大好^き{0:>----} ✨🐈|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
@@ -1508,8 +1425,7 @@ describe('ui/mouse/input', function()
{0:>--->--->---} t2 t3 t4 |
私は猫が大好き{0:>----}^ ✨🐈|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end) -- level 3 - non wrapped
@@ -1524,8 +1440,7 @@ describe('ui/mouse/input', function()
t4 |
私は猫が大好き{0:>----} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><18,1>')
@@ -1535,8 +1450,7 @@ describe('ui/mouse/input', function()
t4 |
私は猫が大好き{0:>----} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><1,2>')
@@ -1546,8 +1460,7 @@ describe('ui/mouse/input', function()
t^4 |
私は猫が大好き{0:>----} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><0,3>')
@@ -1557,8 +1470,7 @@ describe('ui/mouse/input', function()
t4 |
^ 私は猫が大好き{0:>----} |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><20,3>')
@@ -1568,8 +1480,7 @@ describe('ui/mouse/input', function()
t4 |
私は猫が大好き{0:>----}^ |
✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><1,4>')
@@ -1579,8 +1490,7 @@ describe('ui/mouse/input', function()
t4 |
私は猫が大好き{0:>----} |
^✨🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><3,4>')
@@ -1590,8 +1500,7 @@ describe('ui/mouse/input', function()
t4 |
私は猫が大好き{0:>----} |
✨^🐈✨ |
- |
- |
+ |*2
]])
feed('<esc><LeftMouse><5,4>')
@@ -1601,8 +1510,7 @@ describe('ui/mouse/input', function()
t4 |
私は猫が大好き{0:>----} |
✨🐈^✨ |
- |
- |
+ |*2
]])
end) -- level 3 - wrapped
diff --git a/test/functional/ui/multibyte_spec.lua b/test/functional/ui/multibyte_spec.lua
index d72bf27d6b..e66e6b2063 100644
--- a/test/functional/ui/multibyte_spec.lua
+++ b/test/functional/ui/multibyte_spec.lua
@@ -35,9 +35,7 @@ describe("multibyte rendering", function()
screen:expect([[
^ ̊ |
x |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
< ̊> 778, Hex 030a, Octal 1412 |
]])
@@ -47,9 +45,7 @@ describe("multibyte rendering", function()
screen:expect([[
^å |
x |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
<a> 97, Hex 61, Octal 141 < ̊> 778, Hex 030a, Octal 1412 |
]])
end)
@@ -58,10 +54,7 @@ describe("multibyte rendering", function()
feed('58a <esc>a馬<esc>')
screen:expect([[
^馬|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
@@ -69,9 +62,7 @@ describe("multibyte rendering", function()
screen:expect([[
^ {1:>}|
馬 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
@@ -79,9 +70,7 @@ describe("multibyte rendering", function()
screen:expect([[
{1:>}|
^馬 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -91,9 +80,7 @@ describe("multibyte rendering", function()
screen:expect([[
ab ^ |
-馬 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:-- INSERT --} |
]])
@@ -103,8 +90,7 @@ describe("multibyte rendering", function()
ab xx^ |
- {2: xx } |
{1:~ }{3: yy }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{4:-- INSERT --} |
]])
@@ -113,9 +99,7 @@ describe("multibyte rendering", function()
screen:expect([[
ab xxz^ |
-馬 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:-- INSERT --} |
]])
end)
@@ -125,10 +109,7 @@ describe("multibyte rendering", function()
feed('$')
screen:expect{grid=[[
{5:<ffff>}!!^! |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end)
@@ -185,20 +166,14 @@ describe("multibyte rendering", function()
feed('isghl!<esc>')
screen:expect{grid=[[
^!مالس|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*4
|
]]}
command('set arabicshape')
screen:expect{grid=[[
^!ﻡﻼﺳ|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*4
|
]]}
end)
@@ -210,20 +185,14 @@ describe("multibyte rendering", function()
feed('isghl!<esc>')
screen:expect{grid=[[
سلام^! |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
command('set arabicshape')
screen:expect{grid=[[
ﺱﻼﻣ^! |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
@@ -241,20 +210,14 @@ describe("multibyte rendering", function()
screen:expect{grid=[[
^سلام့̀́̂̃̄̅̆̇̈̉̊̋̌ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
command('set arabicshape')
screen:expect{grid=[[
^ﺱﻼﻣ̀́̂̃̄̅̆̇̈̉̊̋̌ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end)
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index 5b982df2b5..098c0f7fef 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -47,33 +47,12 @@ describe('ext_multigrid', function()
it('default initial screen', function()
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
]]}
@@ -83,48 +62,17 @@ describe('ext_multigrid', function()
command('vsplit')
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*12
{11:[No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
]], condition=function()
eq({
[2] = { win = {id=1000}, startrow = 0, startcol = 27, width = 26, height = 12 },
@@ -135,48 +83,22 @@ describe('ext_multigrid', function()
command('split')
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
+ [4:--------------------------]│[5:--------------------------]|*6
[4:--------------------------]│{11:[No Name] }|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*5
{12:[No Name] [No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]], condition=function()
eq({
[2] = { win = {id=1000}, startrow = 7, startcol = 27, width = 26, height = 5 },
@@ -188,35 +110,19 @@ describe('ext_multigrid', function()
command('q')
screen:expect{grid=[[
## grid 1
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
+ [5:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]], condition=function()
eq({
[2] = { win = {id=1000}, startrow = 7, startcol = 0, width = 53, height = 5 },
@@ -231,35 +137,19 @@ describe('ext_multigrid', function()
command('sp')
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]])
end)
@@ -268,35 +158,19 @@ describe('ext_multigrid', function()
command('resize 8')
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*8
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*3
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
]])
end)
@@ -306,162 +180,77 @@ describe('ext_multigrid', function()
command('vsp')
screen:expect{grid=[[
## grid 1
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
+ [6:--------------------]│[5:----------------]│[4:---------------]|*6
{11:[No Name] }{12:[No Name] [No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 6
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
insert('hello')
screen:expect{grid=[[
## grid 1
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
- [6:--------------------]│[5:----------------]│[4:---------------]|
+ [6:--------------------]│[5:----------------]│[4:---------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] [No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
hello |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
hello |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
hello |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 6
hell^o |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
end)
it('closes splits', function ()
command('sp')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
command('q')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
]]}
@@ -473,48 +262,17 @@ describe('ext_multigrid', function()
command('vsp')
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*12
{11:[No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
]]}
end)
it('resizes grids', function ()
@@ -522,48 +280,17 @@ describe('ext_multigrid', function()
command('vertical resize 10')
screen:expect{grid=[[
## grid 1
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
- [4:----------]│[2:------------------------------------------]|
+ [4:----------]│[2:------------------------------------------]|*12
{11:<No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
]]}
end)
it('splits horizontally', function ()
@@ -571,173 +298,69 @@ describe('ext_multigrid', function()
command('sp')
screen:expect{grid=[[
## grid 1
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
+ [5:--------------------------]│[2:--------------------------]|*6
{11:[No Name] }│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*5
{12:[No Name] [No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
insert('hello')
screen:expect{grid=[[
## grid 1
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
+ [5:--------------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
hello |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
hello |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 5
hell^o |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
end)
it('closes splits', function ()
command('vsp')
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*12
{11:[No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
]]}
command('q')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
]]}
@@ -750,17 +373,12 @@ describe('ext_multigrid', function()
screen:try_resize(25, 6)
screen:expect{grid=[[
## grid 1
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
- [2:-------------------------]|
+ [2:-------------------------]|*4
{11:[No Name] }|
[3:-------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
]]}
@@ -799,26 +417,12 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
]]}
@@ -831,41 +435,12 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*19
## grid 3
|
]]}
@@ -890,41 +465,13 @@ describe('ext_multigrid', function()
insert(('a'):rep(60).."\n")
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*18
## grid 3
|
]]}
@@ -936,82 +483,24 @@ describe('ext_multigrid', function()
feed('0')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa哦|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*19
## grid 3
|
]]}
feed('g$')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^哦|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*19
## grid 3
|
]]}
@@ -1021,41 +510,14 @@ describe('ext_multigrid', function()
insert(('b'):rep(160).."\n")
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*2
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*16
## grid 3
|
]]}
@@ -1063,18 +525,7 @@ describe('ext_multigrid', function()
command('setlocal cursorline cursorlineopt=screenline')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
@@ -1082,22 +533,7 @@ describe('ext_multigrid', function()
{23:^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*16
## grid 3
|
]]}
@@ -1108,41 +544,12 @@ describe('ext_multigrid', function()
' long message"')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*19
## grid 3
this is a very very very...ry very very long message |
]]}
@@ -1153,41 +560,13 @@ describe('ext_multigrid', function()
feed('kzfgg')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
{13:^+-- 2 lines: this is a fold································}|
this is outside fold |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*18
## grid 3
|
]]}
@@ -1197,39 +576,11 @@ describe('ext_multigrid', function()
insert(('c'):rep(1111))
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
+ cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|*18
cccccccccccccccccccccccccccccc^c |
{1:~ }|
## grid 3
@@ -1246,49 +597,18 @@ describe('ext_multigrid', function()
})
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
- cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|
+ cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|*18
cccccccccccccccccccccccccccccc^c |
{1:~ }|
## grid 3
|
## grid 4
{21: }|
- {22:~ }|
- {22:~ }|
- {22:~ }|
- {22:~ }|
+ {22:~ }|*4
]], float_pos={
[4] = {{id = 1001}, "SE", 2, 16, 58, true, 50};
}}
@@ -1299,41 +619,13 @@ describe('ext_multigrid', function()
feed('A<C-X><C-N>')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*14
foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
{7:-- Keyword Local completion (^N^P) }{15:match 1 of 2} |
## grid 4
@@ -1348,41 +640,14 @@ describe('ext_multigrid', function()
feed('o<C-X><C-N>')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*14
rab oof rab oof rab oof rab oof rab oof rab oof rab oof|
^ oof|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*4
## grid 3
{7:-- Keyword Local completion (^N^P) }{15:match 1 of 2} |
## grid 4
@@ -1397,41 +662,14 @@ describe('ext_multigrid', function()
feed(':sign un<Tab>')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*14
rab oof rab oof rab oof rab oof rab oof rab oof rab oof|
|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*4
## grid 3
:sign undefine^ |
## grid 4
@@ -1448,67 +686,34 @@ describe('ext_multigrid', function()
command('vsp')
screen:expect{grid=[[
## grid 1
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
+ [5:--------------------------]│[4:--------------------------]|*6
{11:[No Name] }{12:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
feed(":echoerr 'very' | echoerr 'much' | echoerr 'fail'<cr>")
screen:expect{grid=[[
## grid 1
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
+ [5:--------------------------]│[4:--------------------------]|*6
{11:[No Name] }{12:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*3
+ [3:-----------------------------------------------------]|*4
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
{14:very} |
{14:much} |
@@ -1516,59 +721,31 @@ describe('ext_multigrid', function()
{15:Press ENTER or type command to continue}^ |
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
feed('<cr>')
screen:expect{grid=[[
## grid 1
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
+ [5:--------------------------]│[4:--------------------------]|*6
{11:[No Name] }{12:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
command([[
@@ -1580,26 +757,10 @@ describe('ext_multigrid', function()
feed(":call ErrMsg()<cr>")
screen:expect{grid=[[
## grid 1
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|*14
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
{14:Error detected while processing function ErrMsg:} |
{19:line 2:} |
@@ -1617,59 +778,31 @@ describe('ext_multigrid', function()
{15:Press ENTER or type command to continue}^ |
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
feed("<c-c>")
screen:expect{grid=[[
## grid 1
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
- [5:--------------------------]│[4:--------------------------]|
+ [5:--------------------------]│[4:--------------------------]|*6
{11:[No Name] }{12:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
end)
@@ -1677,48 +810,17 @@ describe('ext_multigrid', function()
command('vsp')
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*12
{11:[No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
]]}
@@ -1727,232 +829,93 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
{16: }{17:2}{16: [No Name] }{7: [No Name] }{12: }{16:X}|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
+ [5:-----------------------------------------------------]|*11
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 5
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
]]}
command('sp')
screen:expect{grid=[[
## grid 1
{16: }{17:2}{16: [No Name] }{7: }{18:2}{7: [No Name] }{12: }{16:X}|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
+ [6:-----------------------------------------------------]|*5
{11:[No Name] }|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
+ [5:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 5
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 6
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
command('tabnext')
screen:expect{grid=[[
## grid 1
{7: }{18:2}{7: [No Name] }{16: }{17:2}{16: [No Name] }{12: }{16:X}|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*11
{11:[No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 5 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 6 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
command('tabnext')
screen:expect{grid=[[
## grid 1
{16: }{17:2}{16: [No Name] }{7: }{18:2}{7: [No Name] }{12: }{16:X}|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
- [6:-----------------------------------------------------]|
+ [6:-----------------------------------------------------]|*5
{11:[No Name] }|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
- [5:-----------------------------------------------------]|
+ [5:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 3
|
## grid 4 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 5
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 6
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
command('tabnext')
@@ -1960,117 +923,43 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
{16: }{17:2}{16: [No Name] }{17:2}{16: [No Name] }{7: [No Name] }{12: }{16:X}|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
- [7:-----------------------------------------------------]|
+ [7:-----------------------------------------------------]|*11
{11:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 3
|
## grid 4 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 5 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 6 (hidden)
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 7
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
]]}
command('tabclose')
command('tabclose')
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*12
{11:[No Name] }{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
]]}
end)
@@ -2078,33 +967,13 @@ describe('ext_multigrid', function()
insert('some text\nto be clicked')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicke^d |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 3
|
]]}
@@ -2112,33 +981,13 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'press', '', 2, 0, 5)
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some ^text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
## grid 3
|
]]}
@@ -2148,128 +997,75 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
Lorem ipsum dolor sit amet, consectetur adipiscing el|
it, sed do eiusm^o |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
meths.input_mouse('left', 'press', '', 2, 1, 6)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{12:[No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be ^clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
Lorem ipsum dolor sit amet, consectetur adipiscing el|
it, sed do eiusmo |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
meths.input_mouse('left', 'press', '', 4, 1, 4)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
Lorem ipsum dolor sit amet, consectetur adipiscing el|
it, ^sed do eiusmo |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
screen:try_resize_grid(4, 80, 2)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
@@ -2280,26 +1076,15 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'press', '', 4, 0, 64)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
@@ -2316,28 +1101,15 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'drag', '', 1, 4, 20)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] [+] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*7
{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -2348,28 +1120,15 @@ describe('ext_multigrid', function()
feed('<c-w><c-w><c-w>v')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{12:[No Name] [+] }|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
- [5:--------------------------]│[2:--------------------------]|
+ [5:--------------------------]│[2:--------------------------]|*7
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -2378,11 +1137,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be ^clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
meths.input_mouse('left', 'press', '', 1, 8, 26)
@@ -2390,28 +1145,15 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'drag', '', 1, 6, 30)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{12:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -2420,11 +1162,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be ^clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
command('aunmenu PopUp | vmenu PopUp.Copy y')
@@ -2433,28 +1171,15 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'press', '2', 2, 1, 6)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{12:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{12:[No Name] [+] }{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be {20:clicke}^d |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2463,38 +1188,21 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be {20:clicked} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
meths.input_mouse('right', 'press', '', 2, 1, 6)
meths.input_mouse('right', 'release', '', 2, 1, 6)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{12:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{12:[No Name] [+] }{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be {20:clicke}^d |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2503,11 +1211,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be {20:clicked} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 6
{21: Copy }|
]], float_pos={
@@ -2516,28 +1220,15 @@ describe('ext_multigrid', function()
feed('<Down><CR>')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{12:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{12:[No Name] [+] }{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be ^clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -2546,11 +1237,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
eq('clicked', funcs.getreg('"'))
@@ -2558,28 +1245,15 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'press', '2', 4, 0, 64)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{12:[No Name] [+] [No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2588,38 +1262,21 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
meths.input_mouse('right', 'press', '', 4, 0, 64)
meths.input_mouse('right', 'release', '', 4, 0, 64)
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{12:[No Name] [+] [No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2628,11 +1285,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 6
{21: Copy }|
]], float_pos={
@@ -2641,28 +1294,15 @@ describe('ext_multigrid', function()
feed('<Down><CR>')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] [+] }|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*7
{12:[No Name] [+] [No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
@@ -2671,11 +1311,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]]}
eq('eiusmo', funcs.getreg('"'))
@@ -2683,26 +1319,15 @@ describe('ext_multigrid', function()
screen:try_resize_grid(4, 7, 10)
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
@@ -2719,35 +1344,22 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]]}
funcs.setreg('"', '')
meths.input_mouse('left', 'press', '2', 4, 9, 1)
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2764,34 +1376,21 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]]}
meths.input_mouse('right', 'press', '', 4, 9, 1)
meths.input_mouse('right', 'release', '', 4, 9, 1)
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2808,9 +1407,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 6
{21: Copy }|
]], float_pos={
@@ -2819,26 +1416,15 @@ describe('ext_multigrid', function()
feed('<Down><CR>')
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
@@ -2855,35 +1441,22 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]]}
eq('eiusmo', funcs.getreg('"'))
screen:try_resize_grid(4, 7, 11)
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
@@ -2901,35 +1474,22 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]]}
funcs.setreg('"', '')
meths.input_mouse('left', 'press', '2', 4, 9, 1)
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2947,34 +1507,21 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]]}
meths.input_mouse('right', 'press', '', 4, 9, 1)
meths.input_mouse('right', 'release', '', 4, 9, 1)
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{7:-- VISUAL --} |
## grid 4
@@ -2992,9 +1539,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 6
{21: Copy }|
]], float_pos={
@@ -3003,26 +1548,15 @@ describe('ext_multigrid', function()
feed('<Down><CR>')
screen:expect{grid=[[
## grid 1
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
- [5:------------------------------]│[2:----------------------]|
+ [5:------------------------------]│[2:----------------------]|*5
{12:[No Name] [+] [No Name] [+] }|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:-----------------------------------------------------]|
## grid 2
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
@@ -3040,9 +1574,7 @@ describe('ext_multigrid', function()
## grid 5
some text |
to be clicked |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
]]}
eq('eiusmo', funcs.getreg('"'))
end)
@@ -3061,48 +1593,23 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
- [4:--------------------------]│[5:--------------------------]|
+ [4:--------------------------]│[5:--------------------------]|*6
[4:--------------------------]│{11:[No Name] [+] }|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
- [4:--------------------------]│[2:--------------------------]|
+ [4:--------------------------]│[2:--------------------------]|*5
{12:[No Name] [No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
{7:-- VISUAL --} |
## grid 4
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
## grid 5
{20:foo} |
{20:ba}^r |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
end)
@@ -3110,21 +1617,12 @@ describe('ext_multigrid', function()
screen:try_resize(48, 8)
screen:expect{grid=[[
## grid 1
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*6
{11:[No Name] }|
[3:------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
]], win_viewport={
@@ -3145,12 +1643,7 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3170,12 +1663,7 @@ describe('ext_multigrid', function()
feed('<c-u>')
screen:expect{grid=[[
## grid 1
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3194,12 +1682,9 @@ describe('ext_multigrid', function()
command("split")
screen:expect{grid=[[
## grid 1
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
+ [4:------------------------------------------------]|*3
{11:[No Name] [+] }|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*2
{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3219,12 +1704,9 @@ describe('ext_multigrid', function()
feed("b")
screen:expect{grid=[[
## grid 1
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
+ [4:------------------------------------------------]|*3
{11:[No Name] [+] }|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*2
{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3244,12 +1726,9 @@ describe('ext_multigrid', function()
feed("2k")
screen:expect{grid=[[
## grid 1
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
+ [4:------------------------------------------------]|*3
{11:[No Name] [+] }|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*2
{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3270,12 +1749,9 @@ describe('ext_multigrid', function()
meths.win_set_cursor(1000, {1, 10})
screen:expect{grid=[[
## grid 1
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
+ [4:------------------------------------------------]|*3
{11:[No Name] [+] }|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*2
{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3296,12 +1772,9 @@ describe('ext_multigrid', function()
feed('zfj')
screen:expect{grid=[[
## grid 1
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
+ [4:------------------------------------------------]|*3
{11:[No Name] [+] }|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*2
{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3321,12 +1794,9 @@ describe('ext_multigrid', function()
feed('<c-e>')
screen:expect{grid=[[
## grid 1
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
- [4:------------------------------------------------]|
+ [4:------------------------------------------------]|*3
{11:[No Name] [+] }|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*2
{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3346,12 +1816,7 @@ describe('ext_multigrid', function()
command('close | 21vsplit | setlocal number smoothscroll')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3378,12 +1843,7 @@ describe('ext_multigrid', function()
feed('5<C-E>')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3410,12 +1870,7 @@ describe('ext_multigrid', function()
feed('<C-Y>')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3442,12 +1897,7 @@ describe('ext_multigrid', function()
command('set cpoptions+=n')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3474,12 +1924,7 @@ describe('ext_multigrid', function()
feed('4<C-E>')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3506,12 +1951,7 @@ describe('ext_multigrid', function()
feed('2<C-Y>')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3538,12 +1978,7 @@ describe('ext_multigrid', function()
command('setlocal numberwidth=12')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3570,12 +2005,7 @@ describe('ext_multigrid', function()
feed('2<C-E>')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3602,12 +2032,7 @@ describe('ext_multigrid', function()
feed('<C-E>')
screen:expect{grid=[[
## grid 1
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
- [5:---------------------]│[2:--------------------------]|
+ [5:---------------------]│[2:--------------------------]|*6
{11:[No Name] [+] }{12:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3637,18 +2062,7 @@ describe('ext_multigrid', function()
command('edit test/functional/fixtures/bigfile.txt')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:test/functional/fixtures/bigfile.txt }|
[3:-----------------------------------------------------]|
## grid 2
@@ -3672,18 +2086,7 @@ describe('ext_multigrid', function()
feed('G')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:test/functional/fixtures/bigfile.txt }|
[3:-----------------------------------------------------]|
## grid 2
@@ -3707,18 +2110,7 @@ describe('ext_multigrid', function()
feed('gg')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:test/functional/fixtures/bigfile.txt }|
[3:-----------------------------------------------------]|
## grid 2
@@ -3742,18 +2134,7 @@ describe('ext_multigrid', function()
command('setlocal wrap')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:test/functional/fixtures/bigfile.txt }|
[3:-----------------------------------------------------]|
## grid 2
@@ -3777,18 +2158,7 @@ describe('ext_multigrid', function()
feed('G')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:test/functional/fixtures/bigfile.txt }|
[3:-----------------------------------------------------]|
## grid 2
@@ -3812,18 +2182,7 @@ describe('ext_multigrid', function()
feed('gg')
screen:expect{grid=[[
## grid 1
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*12
{11:test/functional/fixtures/bigfile.txt }|
[3:-----------------------------------------------------]|
## grid 2
@@ -3850,21 +2209,12 @@ describe('ext_multigrid', function()
screen:try_resize(48, 8)
screen:expect{grid=[[
## grid 1
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*6
{11:[No Name] }|
[3:------------------------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
]], win_viewport={
@@ -3885,12 +2235,7 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3912,12 +2257,7 @@ describe('ext_multigrid', function()
screen:expect{grid=[[
## grid 1
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
- [2:------------------------------------------------]|
+ [2:------------------------------------------------]|*6
{11:[No Name] [+] }|
[3:------------------------------------------------]|
## grid 2
@@ -3938,35 +2278,19 @@ describe('ext_multigrid', function()
command('split')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
@@ -3983,35 +2307,20 @@ describe('ext_multigrid', function()
command('setlocal winbar=very%=bar')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
{7:very bar}|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
@@ -4021,35 +2330,19 @@ describe('ext_multigrid', function()
command('setlocal winbar=')
screen:expect{grid=[[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
@@ -4062,35 +2355,21 @@ describe('ext_multigrid', function()
command('split')
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*6
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
{7:Set Up The Bars }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
|
## grid 4
{7:Set Up The Bars }|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]])
meths.input_mouse('left', 'press', '', 1, 6, 20)
@@ -4098,69 +2377,41 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'drag', '', 1, 7, 20)
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*7
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*4
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
{7:Set Up The Bars }|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
|
## grid 4
{7:Set Up The Bars }|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
]])
meths.input_mouse('left', 'drag', '', 1, 4, 20)
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*7
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
{7:Set Up The Bars }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
{7:Set Up The Bars }|
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]])
meths.input_mouse('left', 'press', '', 1, 12, 10)
@@ -4168,70 +2419,42 @@ describe('ext_multigrid', function()
meths.input_mouse('left', 'drag', '', 1, 10, 10)
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*5
{12:[No Name] }|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
- [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|*3
## grid 2
{7:Set Up The Bars }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
- |
- |
- |
+ |*3
## grid 4
{7:Set Up The Bars }|
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]])
eq(3, meths.get_option_value('cmdheight', {}))
meths.input_mouse('left', 'drag', '', 1, 12, 10)
screen:expect([[
## grid 1
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
- [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|*4
{11:[No Name] }|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
- [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|*7
{12:[No Name] }|
[3:-----------------------------------------------------]|
## grid 2
{7:Set Up The Bars }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
## grid 3
|
## grid 4
{7:Set Up The Bars }|
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
]])
eq(1, meths.get_option_value('cmdheight', {}))
end)
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 2c649709c6..4c197ad5b9 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -9,7 +9,7 @@ local eval = helpers.eval
describe('UI receives option updates', function()
local screen
- local function reset(opts, ...)
+ local function reset(screen_opts, clear_opts)
local defaults = {
ambiwidth='single',
arabicshape=true,
@@ -38,9 +38,12 @@ describe('UI receives option updates', function()
ext_termcolors=false,
}
- clear(...)
+ clear_opts = shallowcopy(clear_opts or {})
+ clear_opts.args_rm = clear_opts.args_rm or {}
+ table.insert(clear_opts.args_rm or {}, '--cmd')
+ clear(clear_opts)
screen = Screen.new(20,5)
- screen:attach(opts)
+ screen:attach(screen_opts)
-- NB: UI test suite can be run in both "linegrid" and legacy grid mode.
-- In both cases check that the received value is the one requested.
defaults.ext_linegrid = screen._options.ext_linegrid or false
diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua
index 1dbbe76bac..7ed65b52fa 100644
--- a/test/functional/ui/output_spec.lua
+++ b/test/functional/ui/output_spec.lua
@@ -21,14 +21,15 @@ describe("shell command :!", function()
local screen
before_each(function()
clear()
- screen = child_session.screen_setup(0, '["'..helpers.nvim_prog..
- '", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "'..helpers.nvim_set..'"]')
+ screen = child_session.setup_child_nvim({
+ '-u', 'NONE',
+ '-i', 'NONE',
+ '--cmd', 'colorscheme vim',
+ '--cmd', helpers.nvim_set .. ' notermguicolors',
+ })
screen:expect([[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*4
|
{3:-- TERMINAL --} |
]])
@@ -45,8 +46,7 @@ describe("shell command :!", function()
child_session.feed_data(":!printf foo; sleep 200\n")
screen:expect([[
|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*2
{5: }|
:!printf foo; sleep 200 |
foo |
@@ -143,8 +143,7 @@ describe("shell command :!", function()
feed([[:!printf '\n'<CR>]])
screen:expect([[
:!printf '\n' |
- |
- |
+ |*2
{2:Press ENTER or type command to continue}^ |
]])
feed([[<CR>]])
@@ -182,8 +181,7 @@ describe("shell command :!", function()
feed([[\l]])
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{4: }|
]]..result..[[ |
f1 |
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index a6cd216d84..042b7dbabf 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -48,11 +48,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -64,11 +60,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -81,11 +73,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -97,11 +85,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
bar^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]]}
end)
@@ -111,11 +95,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -127,11 +107,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -143,11 +119,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
spam^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -159,11 +131,7 @@ describe('ui/ext_popupmenu', function()
screen:expect([[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
@@ -172,11 +140,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -188,11 +152,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -204,11 +164,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
bar^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -220,11 +176,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -236,11 +188,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -252,11 +200,7 @@ describe('ui/ext_popupmenu', function()
screen:expect([[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
@@ -272,13 +216,8 @@ describe('ui/ext_popupmenu', function()
}
feed('<Esc>:sign <Tab>')
screen:expect({grid = [[
- |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ |*2
+ {1:~ }|*5
:sign define^ |
]], popupmenu = {
items = expected_wildpum,
@@ -288,13 +227,8 @@ describe('ui/ext_popupmenu', function()
meths.select_popupmenu_item(-1, true, false, {})
screen:expect({grid = [[
- |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ |*2
+ {1:~ }|*5
:sign ^ |
]], popupmenu = {
items = expected_wildpum,
@@ -304,13 +238,8 @@ describe('ui/ext_popupmenu', function()
meths.select_popupmenu_item(5, true, false, {})
screen:expect({grid = [[
- |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ |*2
+ {1:~ }|*5
:sign unplace^ |
]], popupmenu = {
items = expected_wildpum,
@@ -320,25 +249,15 @@ describe('ui/ext_popupmenu', function()
meths.select_popupmenu_item(-1, true, true, {})
screen:expect({grid = [[
- |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ |*2
+ {1:~ }|*5
:sign ^ |
]]})
feed('<Tab>')
screen:expect({grid = [[
- |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ |*2
+ {1:~ }|*5
:sign define^ |
]], popupmenu = {
items = expected_wildpum,
@@ -348,13 +267,8 @@ describe('ui/ext_popupmenu', function()
meths.select_popupmenu_item(5, true, true, {})
screen:expect({grid = [[
- |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ |*2
+ {1:~ }|*5
:sign unplace^ |
]]})
@@ -364,11 +278,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -380,11 +290,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
spam^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -396,11 +302,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
spam^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -412,11 +314,7 @@ describe('ui/ext_popupmenu', function()
screen:expect([[
|
bar^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
@@ -424,11 +322,7 @@ describe('ui/ext_popupmenu', function()
screen:expect({grid = [[
|
bar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:sign define^ |
]], popupmenu = {
items = expected_wildpum,
@@ -440,11 +334,7 @@ describe('ui/ext_popupmenu', function()
screen:expect({grid = [[
|
bar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:sign list^ |
]], popupmenu = {
items = expected_wildpum,
@@ -456,11 +346,7 @@ describe('ui/ext_popupmenu', function()
screen:expect({grid = [[
|
bar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:sign ^ |
]], popupmenu = {
items = expected_wildpum,
@@ -472,11 +358,7 @@ describe('ui/ext_popupmenu', function()
screen:expect({grid = [[
|
bar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:sign jump^ |
]]})
@@ -489,8 +371,7 @@ describe('ui/ext_popupmenu', function()
{6:fo x the foo }{1: }|
{7:bar }{1: }|
{7:spam }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- INSERT --} |
]])
@@ -501,8 +382,7 @@ describe('ui/ext_popupmenu', function()
{7:fo x the foo }{1: }|
{7:bar }{1: }|
{6:spam }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- INSERT --} |
]])
@@ -513,8 +393,7 @@ describe('ui/ext_popupmenu', function()
{7:fo x the foo }{1: }|
{7:bar }{1: }|
{7:spam }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- INSERT --} |
]])
@@ -522,11 +401,7 @@ describe('ui/ext_popupmenu', function()
screen:expect([[
|
bar^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
@@ -570,11 +445,7 @@ describe('ui/ext_popupmenu', function()
screen:expect([[
|
bar |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:sign jump^ |
]])
end
@@ -602,8 +473,7 @@ describe('ui/ext_popupmenu', function()
{6:aa }{1: }|
{7:bb }{1: }|
{7:cc }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- Keyword Local completion (^N^P) }{5:match 1 of 3} |
]])
@@ -614,8 +484,7 @@ describe('ui/ext_popupmenu', function()
{7:aa }{1: }|
{7:bb }{1: }|
{6:cc }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- Keyword Local completion (^N^P) }{5:match 3 of 3} |
]])
@@ -626,8 +495,7 @@ describe('ui/ext_popupmenu', function()
{7:aa }{1: }|
{7:bb }{1: }|
{7:cc }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- Keyword Local completion (^N^P) }{8:Back at original} |
]])
@@ -635,11 +503,7 @@ describe('ui/ext_popupmenu', function()
screen:expect([[
aa bb cc |
bb^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
end)
@@ -681,11 +545,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
January^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=month_expected,
@@ -736,11 +596,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
January^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=month_expected,
@@ -792,11 +648,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
January^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=month_expected,
@@ -807,11 +659,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
January^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=month_expected,
@@ -837,14 +685,7 @@ describe('ui/ext_popupmenu', function()
feed(':sign ')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign ^ |
]])
eq(0, funcs.wildmenumode())
@@ -852,14 +693,7 @@ describe('ui/ext_popupmenu', function()
feed('<tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign define^ |
]], popupmenu={items=wild_expected, pos=0, anchor={1, 9, 6}}}
eq(1, funcs.wildmenumode())
@@ -867,42 +701,21 @@ describe('ui/ext_popupmenu', function()
feed('<left>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign ^ |
]], popupmenu={items=wild_expected, pos=-1, anchor={1, 9, 6}}}
feed('<left>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign unplace^ |
]], popupmenu={items=wild_expected, pos=5, anchor={1, 9, 6}}}
feed('x')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign unplacex^ |
]])
feed('<esc>')
@@ -911,14 +724,7 @@ describe('ui/ext_popupmenu', function()
feed(':sign <S-tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign unplace^ |
]], popupmenu={items=wild_expected, pos=5, anchor={1, 9, 6}}}
feed('<esc>')
@@ -930,13 +736,10 @@ describe('ui/ext_popupmenu', function()
feed(':b lå<tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:långfile2 }|
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:långfile1 }|
:b långfile1^ |
]], popupmenu={
@@ -960,11 +763,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
foo^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -976,11 +775,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]], popupmenu={
items=expected,
@@ -992,11 +787,7 @@ describe('ui/ext_popupmenu', function()
screen:expect{grid=[[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
feed('<RightMouse><0,0>')
@@ -1005,20 +796,14 @@ describe('ui/ext_popupmenu', function()
{7:^foo } |
{7:bar }{1: }|
{7:baz }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
feed('<esc>')
screen:expect([[
|
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
end)
@@ -1295,47 +1080,21 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
+ [4:--------------------------------]|*8
{3:[No Name] [Preview][+] }|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*9
{4:[No Name] [+] }|
[3:--------------------------------]|
## grid 2
aa bb cc dd ee ff gg hh ii jj |
aa^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
## grid 3
{2:-- }{5:match 1 of 10} |
## grid 4
aa bb cc dd ee ff gg hh ii jj |
aa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 5
{s:aa }{c: }|
{n:bb }{c: }|
@@ -1352,12 +1111,7 @@ describe('builtin popupmenu', function()
screen:expect([[
aa bb cc dd ee ff gg hh ii jj |
aa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{3:[No Name] [Preview][+] }|
aa bb cc dd ee ff gg hh ii jj |
aa^ |
@@ -1381,47 +1135,21 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*9
{4:[No Name] [+] }|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
+ [4:--------------------------------]|*8
{3:[No Name] [Preview][+] }|
[3:--------------------------------]|
## grid 2
aa bb cc dd ee ff gg hh ii jj |
aa^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
## grid 3
{2:-- }{5:match 1 of 10} |
## grid 4
aa bb cc dd ee ff gg hh ii jj |
aa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 5
{s:aa }{c: }|
{n:bb }{c: }|
@@ -1448,12 +1176,7 @@ describe('builtin popupmenu', function()
{n:hh }{s: }{4: }|
aa bb cc dd ee ff gg hh ii jj |
aa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{3:[No Name] [Preview][+] }|
{2:-- }{5:match 1 of 10} |
]])
@@ -1469,24 +1192,9 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
+ [4:--------------------------------]|*4
{3:[No Name] [Preview][+] }|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*13
{4:[No Name] [+] }|
[3:--------------------------------]|
## grid 2
@@ -1561,24 +1269,9 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
+ [4:--------------------------------]|*8
{3:[No Name] [Preview][+] }|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*9
{4:[No Name] [+] }|
[3:--------------------------------]|
## grid 2
@@ -1649,24 +1342,9 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*9
{4:[No Name] [+] }|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
- [4:--------------------------------]|
+ [4:--------------------------------]|*8
{3:[No Name] [Preview][+] }|
[3:--------------------------------]|
## grid 2
@@ -1747,21 +1425,7 @@ describe('builtin popupmenu', function()
{n:one }{1: }|
{n:two }{1: }|
{n:three }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*15
{2:-- }{8:Back at original} |
]])
feed('<C-N>')
@@ -1774,16 +1438,7 @@ describe('builtin popupmenu', function()
{s:one }{1: }|
{n:two }{1: }|
{n:three }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
{4:[No Name] [+] }|
{2:-- }{5:match 1 of 3} |
]])
@@ -1821,39 +1476,25 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
+ [4:--------------------]│[2:-----------]|*6
{4:[No Name] [+] }{3:<Name] [+] }|
[3:--------------------------------]|
## grid 2
aaa aab aac|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:vsplit |
## grid 4
aaa aab aac |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
]]}
else
screen:expect([[
aaa aab aac │aaa aab aac|
^ │ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
{4:[No Name] [+] }{3:<Name] [+] }|
:vsplit |
]])
@@ -1863,30 +1504,19 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
- [4:--------------------]│[2:-----------]|
+ [4:--------------------]│[2:-----------]|*6
{4:[No Name] [+] }{3:<Name] [+] }|
[3:--------------------------------]|
## grid 2
aaa aab aac|
bbb aaa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
{2:-- }{5:match 1 of 3} |
## grid 4
aaa aab aac |
bbb aaa^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 5
{s: aaa }|
{n: aab }|
@@ -1911,30 +1541,21 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
+ [4:-----------]│[2:--------------------]|*6
{3:<Name] [+] }{4:[No Name] [+] }|
[3:--------------------------------]|
## grid 2
aaa aab aac |
bbb aaa |
c aaa^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{2:-- }{5:match 1 of 3} |
## grid 4
aaa aab aac|
bbb aaa |
c aaa |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 5
{s: aaa }|
{n: aab }|
@@ -1959,21 +1580,14 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
+ [4:-----------]│[2:--------------------]|*6
{3:<Name] [+] }{4:[No Name] [+] }|
[3:--------------------------------]|
## grid 2
aaa aab aac |
bbb aaa |
c aaabcdef ccc aaa^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
## grid 3
{2:-- }{5:match 1 of 4} |
## grid 4
@@ -1981,8 +1595,7 @@ describe('builtin popupmenu', function()
bbb aaa |
c aaabcdef |
ccc aaa |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 5
{s: aaa }|
{n: aab }|
@@ -2008,12 +1621,7 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
- [4:-----------]│[2:--------------------]|
+ [4:-----------]│[2:--------------------]|*6
{3:<Name] [+] }{4:[No Name] [+] }|
[3:--------------------------------]|
## grid 2
@@ -2021,8 +1629,7 @@ describe('builtin popupmenu', function()
bbb aaa |
c aaabcdef ccc aaa |
aaa^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
## grid 3
{2:-- }{5:match 1 of 6} |
## grid 4
@@ -2354,20 +1961,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice}|
{1:~ }{n: text }|
{1:~ }{n: thing }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
{2:-- INSERT --} |
]])
@@ -2379,19 +1973,7 @@ describe('builtin popupmenu', function()
{n:choice }{1: }|
{n:text }{1: }|
{s:thing }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
{2:-- INSERT --} |
]])
@@ -2402,20 +1984,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice}|
{1:~ }{s: text }|
{1:~ }{n: thing }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
{2:-- INSERT --} |
]])
@@ -2438,8 +2007,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice }{1: }|
{1:~ }{s: text }{1: }|
{1:~ }{n: thing }{1: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- INSERT --} |
]])
@@ -2451,9 +2019,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice }{1: }|
{1:~ }{s: text }{1: }|
{1:~ }{n: thing }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]])
@@ -2499,20 +2065,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice}|
{1:~ }{n: text }|
{1:~ }{n: thing }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
{2:-- INSERT --} |
]])
@@ -2525,8 +2078,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice }|
{1:~ }{n: text }|
{1:~ }{n: thing }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- INSERT --} |
]])
end)
@@ -2536,24 +2088,7 @@ describe('builtin popupmenu', function()
feed('isome rightleft ')
screen:expect([[
^ tfelthgir emos|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*18
{2:-- INSERT --} |
]])
@@ -2565,20 +2100,7 @@ describe('builtin popupmenu', function()
{1: }{n: eciohc }{1: ~}|
{1: }{n: txet }{1: ~}|
{1: }{n: gniht }{1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*14
{2:-- INSERT --} |
]])
@@ -2589,44 +2111,14 @@ describe('builtin popupmenu', function()
{1: }{n: eciohc }{1: ~}|
{1: }{n: txet }{1: ~}|
{1: }{n: gniht }{1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*14
{2:-- INSERT --} |
]])
feed('<c-y>')
screen:expect([[
^ drow tfelthgir emos|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*18
{2:-- INSERT --} |
]])
@@ -2634,42 +2126,14 @@ describe('builtin popupmenu', function()
feed('<esc>:sign ')
screen:expect{grid=[[
drow tfelthgir emos|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*18
:sign ^ |
]]}
feed('<tab>')
screen:expect{grid=[[
drow tfelthgir emos|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*12
{1: }{s: define }{1: ~}|
{1: }{n: jump }{1: ~}|
{1: }{n: list }{1: ~}|
@@ -2692,24 +2156,17 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
+ [2:-------------------]│[4:--------------------]|*4
{3:[No Name] [+] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
tfelthgir emos|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
## grid 3
{2:-- INSERT --} |
## grid 4
^ tfelthgir emos|
- {1: ~}|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*3
## grid 5
{c: }{n: drow }|
{s: }{n: eciohc }|
@@ -2731,24 +2188,19 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
+ [2:-------------------]│[4:--------------------]|*4
{3:[No Name] [+] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
tfelthgir emos|
|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
## grid 3
{2:-- INSERT --} |
## grid 4
tfelthgir emos|
^ |
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
## grid 5
{c: }{n: drow}|
{s: }{n: eciohc}|
@@ -2770,31 +2222,25 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
+ [2:-------------------]│[4:--------------------]|*4
{3:[No Name] [+] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
tfelthgir emos|
|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
## grid 3
^ |
## grid 4
tfelthgir emos|
|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
]]}
else
screen:expect([[
tfelthgir emos│ tfelthgir emos|
│ |
- {1: ~}│{1: ~}|
- {1: ~}│{1: ~}|
+ {1: ~}│{1: ~}|*2
{3:[No Name] [+] }{4:[No Name] [+] }|
^ |
]])
@@ -2804,24 +2250,19 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
- [2:-------------------]│[4:--------------------]|
+ [2:-------------------]│[4:--------------------]|*4
{3:[No Name] [+] }{4:[No Name] [+] }|
[3:----------------------------------------]|
## grid 2
tfelthgir emos|
|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
## grid 3
define^ |
## grid 4
tfelthgir emos|
|
- {1: ~}|
- {1: ~}|
+ {1: ~}|*2
## grid 5
{s:define }{c: }|
{n:jump }{s: }|
@@ -2927,9 +2368,7 @@ describe('builtin popupmenu', function()
{1:~ }{s: wordey x extrainfo }{1: }|
{1:~ }{n: thing }{1: }|
{1:~ }{n: sneaky bar }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]])
@@ -2939,9 +2378,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: wordey x extrainfo }{1: }|
{1:~ }{n: thing }{1: }|
{1:~ }{n: sneaky bar }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]])
@@ -2951,21 +2388,14 @@ describe('builtin popupmenu', function()
{1:~ }{n: wordey x extrainfo }{1: }|
{1:~ }{n: thing }{1: }|
{1:~ }{s: sneaky bar }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- INSERT --} |
]])
feed('<esc>')
screen:expect([[
xx secre^t |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -2980,22 +2410,14 @@ describe('builtin popupmenu', function()
feed(':sign ')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign ^ |
]])
feed('<Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3008,8 +2430,7 @@ describe('builtin popupmenu', function()
feed('<Right><Right>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{s: list }{1: }|
@@ -3022,8 +2443,7 @@ describe('builtin popupmenu', function()
feed('<C-N>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3036,8 +2456,7 @@ describe('builtin popupmenu', function()
feed('<C-P>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{s: list }{1: }|
@@ -3050,8 +2469,7 @@ describe('builtin popupmenu', function()
feed('<Left>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{s: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3065,14 +2483,7 @@ describe('builtin popupmenu', function()
feed('<C-E>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign ^ |
]])
@@ -3080,14 +2491,7 @@ describe('builtin popupmenu', function()
feed('<Tab><C-P><C-P><C-Y>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign unplace^ |
]])
@@ -3095,8 +2499,7 @@ describe('builtin popupmenu', function()
feed('<C-U>sign define <Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: culhl= }{1: }|
{1:~ }{n: icon= }{1: }|
{1:~ }{n: linehl= }{1: }|
@@ -3109,8 +2512,7 @@ describe('builtin popupmenu', function()
feed('<Space><Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: culhl= }{1: }|
{1:~ }{n: icon= }{1: }|
{1:~ }{n: linehl= }{1: }|
@@ -3123,12 +2525,7 @@ describe('builtin popupmenu', function()
feed('<C-U>e Xnamedi<Tab><Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{1:~ }{s: XdirA/ }{1: }|
{1:~ }{n: XfileA }{1: }|
:e Xnamedir/XdirA/^ |
@@ -3138,12 +2535,7 @@ describe('builtin popupmenu', function()
feed('<Down>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{1:~ }{s: XdirB/ }{1: }|
{1:~ }{n: XfileB }{1: }|
:e Xnamedir/XdirA/XdirB/^ |
@@ -3153,12 +2545,7 @@ describe('builtin popupmenu', function()
feed('<Up>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{1:~ }{s: XdirA/ }{1: }|
{1:~ }{n: XfileA }{1: }|
:e Xnamedir/XdirA/^ |
@@ -3169,12 +2556,7 @@ describe('builtin popupmenu', function()
feed(':<C-U>sign <Tab><C-A>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{4: }|
:sign define jump list place und|
efine unplace^ |
@@ -3184,12 +2566,7 @@ describe('builtin popupmenu', function()
feed('<Left>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{4: }|
:sign define jump list place und|
efine unplac^e |
@@ -3201,11 +2578,7 @@ describe('builtin popupmenu', function()
feed('<C-U>sign <Tab><C-D>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4: }|
:sign define |
define |
@@ -3216,8 +2589,7 @@ describe('builtin popupmenu', function()
feed('<C-U><CR>:sign <S-Tab><C-P>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3231,14 +2603,7 @@ describe('builtin popupmenu', function()
feed('<C-U><CR>:sign <Tab><Esc>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]])
@@ -3246,14 +2611,7 @@ describe('builtin popupmenu', function()
feed(':sign <Tab>x')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign definex^ |
]])
@@ -3264,10 +2622,7 @@ describe('builtin popupmenu', function()
{3:[No Name] }|
{1::}sign define |
{1::}sign defin^e |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{4:[Command Line] }|
:sign define |
]])
@@ -3277,12 +2632,7 @@ describe('builtin popupmenu', function()
feed(':sign u<Tab><C-N><C-N>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{1:~ }{n: undefine }{1: }|
{1:~ }{n: unplace }{1: }|
:sign u^ |
@@ -3292,10 +2642,7 @@ describe('builtin popupmenu', function()
feed('<C-U>bu<Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{s: bufdo }{1: }|
{n: buffer }{1: }|
{n: buffers }{1: }|
@@ -3307,14 +2654,7 @@ describe('builtin popupmenu', function()
feed('<C-E><C-U>sign <Tab><BS>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign defin^ |
]])
@@ -3322,14 +2662,7 @@ describe('builtin popupmenu', function()
feed('<C-E><C-U>sign <Tab><C-W>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign ^ |
]])
@@ -3337,14 +2670,7 @@ describe('builtin popupmenu', function()
feed('<C-E><C-U>sign <Tab><C-U>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:^ |
]])
@@ -3353,14 +2679,7 @@ describe('builtin popupmenu', function()
feed('sign xyz<Esc>:sign <Tab><C-E><Up>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:sign xyz^ |
]])
@@ -3371,9 +2690,7 @@ describe('builtin popupmenu', function()
feed(':cn<Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4: }|
:cn |
cnewer cnoreabbrev |
@@ -3384,9 +2701,7 @@ describe('builtin popupmenu', function()
feed('s')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4: }|
:cn |
cnewer cnoreabbrev |
@@ -3402,11 +2717,7 @@ describe('builtin popupmenu', function()
feed(':e あいう/<Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{1:~ }{s: 123 }{1: }|
{1:~ }{n: abc }{1: }|
{1:~ }{n: xyz }{1: }|
@@ -3418,8 +2729,7 @@ describe('builtin popupmenu', function()
feed(':sign <Tab><PageDown>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3431,8 +2741,7 @@ describe('builtin popupmenu', function()
feed('<PageDown>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3444,8 +2753,7 @@ describe('builtin popupmenu', function()
feed('<PageDown>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3457,8 +2765,7 @@ describe('builtin popupmenu', function()
feed('<PageDown>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3470,8 +2777,7 @@ describe('builtin popupmenu', function()
feed('<C-U>sign <Tab><Right><Right><PageDown>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3485,8 +2791,7 @@ describe('builtin popupmenu', function()
feed('<C-U>sign <Tab><PageUp>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3498,8 +2803,7 @@ describe('builtin popupmenu', function()
feed('<PageUp>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3511,8 +2815,7 @@ describe('builtin popupmenu', function()
feed('<PageUp>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{s: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3524,8 +2827,7 @@ describe('builtin popupmenu', function()
feed('<PageUp>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3539,12 +2841,7 @@ describe('builtin popupmenu', function()
feed('<Esc>:set wildchazz<Left><Left><Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
{1:~ }{s: wildchar }{1: }|
{1:~ }{n: wildcharm }{1: }|
:set wildchar^zz |
@@ -3552,14 +2849,7 @@ describe('builtin popupmenu', function()
feed('<C-E>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:set wildcha^zz |
]])
@@ -3567,14 +2857,7 @@ describe('builtin popupmenu', function()
feed('<Esc>:set wildchazz<Left><Left><Tab><C-Y>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
:set wildchar^zz |
]])
@@ -3586,9 +2869,7 @@ describe('builtin popupmenu', function()
feed(':b lå<tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4:långfile2 }|
|
{1:~ }|
@@ -3614,14 +2895,7 @@ describe('builtin popupmenu', function()
{1:~ }|
{4:långfile2 }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
{1:~ }{s: långfile1 }{1: }|
{3:lå}{n: långfile2 }{3: }|
:b långfile1^ |
@@ -3636,14 +2910,7 @@ describe('builtin popupmenu', function()
{1:~ }|
{4:långfile2 }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
{1:~ }{n: långfile1 }{1: }|
{3:lå}{n: långfile2 }{3: }|
:b långfile^ |
@@ -3658,17 +2925,7 @@ describe('builtin popupmenu', function()
feed(':e compdir/<tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
{1:~ }{s: file1 }{1: }|
{1:~ }{n: file2 }{1: }|
:e compdir/file1^ |
@@ -3683,11 +2940,7 @@ describe('builtin popupmenu', function()
feed(':echoerr "fail"|echoerr "error"<cr>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4: }|
{6:fail} |
{6:error} |
@@ -3697,8 +2950,7 @@ describe('builtin popupmenu', function()
feed(':sign <tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3711,11 +2963,7 @@ describe('builtin popupmenu', function()
feed('d')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4: }|
{6:fail} |
{6:error} |
@@ -3734,12 +2982,7 @@ describe('builtin popupmenu', function()
feed(':sign u<Tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
:sign un^ |
]]}
eq(0, funcs.wildmenumode())
@@ -3748,10 +2991,7 @@ describe('builtin popupmenu', function()
feed('<Tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{1:~ }{s: undefine }{1: }|
{1:~ }{n: unplace }{1: }|
:sign undefine^ |
@@ -3762,10 +3002,7 @@ describe('builtin popupmenu', function()
feed('<Tab>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{1:~ }{n: undefine }{1: }|
{1:~ }{s: unplace }{1: }|
:sign unplace^ |
@@ -3779,9 +3016,7 @@ describe('builtin popupmenu', function()
feed('$')
feed(':sign <Tab>')
screen:expect([[
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*3
aaaa {s: define } |
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3805,8 +3040,7 @@ describe('builtin popupmenu', function()
feed(':sign <C-E>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3820,8 +3054,7 @@ describe('builtin popupmenu', function()
feed('<C-E>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: define }{1: }|
{1:~ }{s: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3834,14 +3067,7 @@ describe('builtin popupmenu', function()
feed('<Esc>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]])
@@ -3851,8 +3077,7 @@ describe('builtin popupmenu', function()
feed(':sign <Esc>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3865,14 +3090,7 @@ describe('builtin popupmenu', function()
feed('<Esc>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]])
@@ -3882,8 +3100,7 @@ describe('builtin popupmenu', function()
feed([[:sign <C-\><C-\>]])
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{s: define }{1: }|
{1:~ }{n: jump }{1: }|
{1:~ }{n: list }{1: }|
@@ -3896,14 +3113,7 @@ describe('builtin popupmenu', function()
feed('<C-N>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]])
end)
@@ -3919,22 +3129,11 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*7
[3:--------------------------------]|
## grid 2
some long prefix before the ^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
{2:-- INSERT --} |
## grid 4
@@ -3948,10 +3147,7 @@ describe('builtin popupmenu', function()
some long prefix before the ^ |
{1:~ }{n: word }{c: }|
{1:~ }{n: choice}{s: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:-- INSERT --} |
]])
end
@@ -3967,22 +3163,11 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect{grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*7
[3:--------------------------------]|
## grid 2
some long prefix before the ^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
{2:-- INSERT --} |
## grid 4
@@ -4000,8 +3185,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: choice}|
{1:~ }{n: text }|
{1:~ }{n: thing }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:-- INSERT --} |
]])
end
@@ -4031,22 +3215,11 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*7
[3:--------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
{2:-- INSERT --} |
## grid 4
@@ -4056,11 +3229,7 @@ describe('builtin popupmenu', function()
screen:expect([[
^ |
{1:~ }{n: 哦哦哦哦哦哦哦哦哦>}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{2:-- INSERT --} |
]])
end
@@ -4079,39 +3248,23 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*7
[3:--------------------------------]|
## grid 2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
## grid 3
{2:-- INSERT --} |
## grid 4
- {n: 哦哦哦哦哦哦哦哦哦>}{c: }|
- {n: 哦哦哦哦哦哦哦哦哦>}{c: }|
- {n: 哦哦哦哦哦哦哦哦哦>}{s: }|
- {n: 哦哦哦哦哦哦哦哦哦>}{s: }|
+ {n: 哦哦哦哦哦哦哦哦哦>}{c: }|*2
+ {n: 哦哦哦哦哦哦哦哦哦>}{s: }|*2
]], float_pos={[4] = {{id = -1}, 'NW', 2, 1, 11, false, 100}}})
else
screen:expect([[
^ |
- {1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{c: }|
- {1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{c: }|
- {1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{s: }|
- {1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{s: }|
- {1:~ }|
- {1:~ }|
+ {1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{c: }|*2
+ {1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{s: }|*2
+ {1:~ }|*2
{2:-- INSERT --} |
]])
end
@@ -4133,18 +3286,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 2, 0, 4)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
@@ -4167,18 +3313,11 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
@@ -4200,18 +3339,11 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
|
## grid 4
@@ -4233,28 +3365,18 @@ describe('builtin popupmenu', function()
if multigrid then
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'bar' |
]]})
else
screen:expect([[
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:let g:menustr = 'bar' |
]])
end
@@ -4264,18 +3386,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 2, 2, 20)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'bar' |
## grid 4
@@ -4287,8 +3402,7 @@ describe('builtin popupmenu', function()
feed('<RightMouse><20,2>')
screen:expect([[
^popup menu test |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{1:~ }{n: foo }{1: }|
{1:~ }{n: bar }{1: }|
:let g:menustr = 'b{n: baz } |
@@ -4298,18 +3412,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('left', 'press', '', 4, 2, 2)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'baz' |
]]})
@@ -4317,10 +3424,7 @@ describe('builtin popupmenu', function()
feed('<LeftMouse><22,5>')
screen:expect([[
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:let g:menustr = 'baz' |
]])
end
@@ -4330,18 +3434,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 2, 0, 4)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'baz' |
## grid 4
@@ -4364,18 +3461,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'drag', '', 2, 3, 6)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'baz' |
## grid 4
@@ -4398,18 +3488,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'release', '', 2, 1, 6)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'foo' |
]]})
@@ -4417,10 +3500,7 @@ describe('builtin popupmenu', function()
feed('<RightRelease><6,1>')
screen:expect([[
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:let g:menustr = 'foo' |
]])
end
@@ -4431,18 +3511,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 2, 0, 4)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'foo' |
## grid 4
@@ -4466,18 +3539,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('move', '', '', 2, 3, 6)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'foo' |
## grid 4
@@ -4501,18 +3567,11 @@ describe('builtin popupmenu', function()
meths.input_mouse('left', 'press', '', 2, 2, 6)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*5
[3:--------------------------------]|
## grid 2
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
## grid 3
:let g:menustr = 'bar' |
]]})
@@ -4520,10 +3579,7 @@ describe('builtin popupmenu', function()
feed('<LeftMouse><6,2>')
screen:expect([[
^popup menu test |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:let g:menustr = 'bar' |
]])
end
@@ -4535,11 +3591,9 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 5, 1, 20)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*2
{3:[No Name] [+] }|
- [5:--------------------------------]|
- [5:--------------------------------]|
+ [5:--------------------------------]|*2
[3:--------------------------------]|
## grid 2
popup menu test |
@@ -4569,11 +3623,9 @@ describe('builtin popupmenu', function()
meths.input_mouse('left', 'press', '', 4, 2, 2)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*2
{3:[No Name] [+] }|
- [5:--------------------------------]|
- [5:--------------------------------]|
+ [5:--------------------------------]|*2
[3:--------------------------------]|
## grid 2
popup menu test |
@@ -4602,11 +3654,9 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 6, 1, 14)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*2
{3:[No Name] [+] }|
- [5:---------------]│[6:----------------]|
- [5:---------------]│[6:----------------]|
+ [5:---------------]│[6:----------------]|*2
[3:--------------------------------]|
## grid 2
popup menu test |
@@ -4639,11 +3689,9 @@ describe('builtin popupmenu', function()
meths.input_mouse('left', 'press', '', 4, 0, 2)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*2
{3:[No Name] [+] }|
- [5:---------------]│[6:----------------]|
- [5:---------------]│[6:----------------]|
+ [5:---------------]│[6:----------------]|*2
[3:--------------------------------]|
## grid 2
popup menu test |
@@ -4675,11 +3723,9 @@ describe('builtin popupmenu', function()
meths.input_mouse('right', 'press', '', 6, 1, 14)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*2
{3:[No Name] [+] }|
- [5:---------------]│[6:----------------]|
- [5:---------------]│[6:----------------]|
+ [5:---------------]│[6:----------------]|*2
[3:--------------------------------]|
## grid 2
popup menu test |
@@ -4712,11 +3758,9 @@ describe('builtin popupmenu', function()
meths.input_mouse('left', 'press', '', 4, 1, 2)
screen:expect({grid=[[
## grid 1
- [2:--------------------------------]|
- [2:--------------------------------]|
+ [2:--------------------------------]|*2
{3:[No Name] [+] }|
- [5:---------------]│[6:----------------]|
- [5:---------------]│[6:----------------]|
+ [5:---------------]│[6:----------------]|*2
[3:--------------------------------]|
## grid 2
popup menu test |
@@ -4779,13 +3823,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: Select Line }{1: }|
{1:~ }{n: Select Block }{1: }|
{1:~ }{n: Select All }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
:popup PopUp |
]])
@@ -4804,13 +3842,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: Select Line }{1: }|
{1:~ }{n: Select Block }{1: }|
{1:~ }{n: Select All }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
:popup PopUp |
]])
@@ -4829,13 +3861,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: Select Line }{1: }|
{1:~ }{n: Select Block }{1: }|
{1:~ }{n: Select All }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
:popup PopUp |
]])
@@ -4859,13 +3885,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: Select Line }{1: }|
{1:~ }{n: Select Block }{1: }|
{1:~ }{n: Select All }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*7
changed |
]])
@@ -4875,22 +3895,7 @@ describe('builtin popupmenu', function()
one two three four five |
and one two {7:^X}three four five |
one more two three four five |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*16
pasted |
]])
@@ -4911,12 +3916,7 @@ describe('builtin popupmenu', function()
{1:~ }{n: Select Line }{1: }|
{1:~ }{n: Select Block }{1: }|
{1:~ }{n: Select All }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
:popup PopUp |
]])
@@ -4951,9 +3951,7 @@ describe('builtin popupmenu', function()
{s:aword1 W extra text 1 }{1: }|
{n:aword2 W extra text 2 }{1: }|
{n:aword3 W extra text 3 }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- }{5:match 1 of 3} |
]])
end)
@@ -4977,9 +3975,7 @@ describe('builtin popupmenu', function()
{s:aword1 }{ks:W }{xs:extra text 1 }{1: }|
{n:aword2 }{kn:W }{xn:extra text 2 }{1: }|
{n:aword3 }{kn:W }{xn:extra text 3 }{1: }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:-- }{5:match 1 of 3} |
]], attrs)
end)
diff --git a/test/functional/ui/quickfix_spec.lua b/test/functional/ui/quickfix_spec.lua
index 9f072915e2..523e657249 100644
--- a/test/functional/ui/quickfix_spec.lua
+++ b/test/functional/ui/quickfix_spec.lua
@@ -49,9 +49,7 @@ describe('quickfix selection highlight', function()
Line 4 |
Line 5 |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 810a68d387..99cf4ffb1b 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -265,11 +265,13 @@ local ext_keys = {
-- row. Last character of each row (typically "|") is stripped.
-- Common indentation is stripped.
-- "{MATCH:x}" in a line is matched against Lua pattern `x`.
+-- "*n" at the end of a line means it repeats `n` times.
-- attr_ids: Expected text attributes. Screen rows are transformed according
-- to this table, as follows: each substring S composed of
-- characters having the same attributes will be substituted by
-- "{K:S}", where K is a key in `attr_ids`. Any unexpected
-- attributes in the final state are an error.
+-- Use an empty table for a text-only (no attributes) expectation.
-- Use screen:set_default_attr_ids() to define attributes for many
-- expect() calls.
-- extmarks: Expected win_extmarks accumulated for the grids. For each grid,
@@ -349,8 +351,11 @@ function Screen:expect(expected, attr_ids, ...)
end
end
local attr_state = {
- ids = attr_ids or self._default_attr_ids,
+ ids = attr_ids or self._default_attr_ids,
}
+ if isempty(attr_ids) then
+ attr_state.ids = nil
+ end
if self._options.ext_linegrid then
attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {})
end
@@ -381,14 +386,26 @@ function Screen:expect(expected, attr_ids, ...)
end
if grid ~= nil then
- local err_msg, msg_expected_rows = nil, {}
+ for i, row in ipairs(expected_rows) do
+ local count
+ row, count = row:match('^(.*%|)%*(%d+)$')
+ if row then
+ count = tonumber(count)
+ table.remove(expected_rows, i)
+ for _ = 1, count do
+ table.insert(expected_rows, i, row)
+ end
+ end
+ end
+ local err_msg = nil
-- `expected` must match the screen lines exactly.
if #actual_rows ~= #expected_rows then
err_msg = "Expected screen height " .. #expected_rows
.. ' differs from actual height ' .. #actual_rows .. '.'
end
+ local msg_expected_rows = shallowcopy(expected_rows)
+ local msg_actual_rows = shallowcopy(actual_rows)
for i, row in ipairs(expected_rows) do
- msg_expected_rows[i] = row
local pat = nil
if actual_rows[i] and row ~= actual_rows[i] then
local after = row
@@ -405,7 +422,7 @@ function Screen:expect(expected, attr_ids, ...)
if row ~= actual_rows[i] and (not pat or not actual_rows[i]:match(pat)) then
msg_expected_rows[i] = '*' .. msg_expected_rows[i]
if i <= #actual_rows then
- actual_rows[i] = '*' .. actual_rows[i]
+ msg_actual_rows[i] = '*' .. msg_actual_rows[i]
end
if err_msg == nil then
err_msg = 'Row ' .. tostring(i) .. ' did not match.'
@@ -415,10 +432,10 @@ function Screen:expect(expected, attr_ids, ...)
if err_msg ~= nil then
return (
err_msg..'\nExpected:\n |'..table.concat(msg_expected_rows, '\n |')..'\n'
- ..'Actual:\n |'..table.concat(actual_rows, '\n |')..'\n\n'..[[
+ ..'Actual:\n |'..table.concat(msg_actual_rows, '\n |')..'\n\n'..[[
To print the expect() call that would assert the current screen state, use
screen:snapshot_util(). In case of non-deterministic failures, use
-screen:redraw_debug() to show all intermediate screen states. ]])
+screen:redraw_debug() to show all intermediate screen states.]])
end
end
@@ -625,7 +642,7 @@ between asynchronous (feed(), nvim_input()) and synchronous API calls.
if err then
if eof then err = err..'\n\n'..eof[2] end
- busted.fail(err, 3)
+ busted.fail(err .. '\n\nSnapshot:\n' .. self:_print_snapshot(), 3)
elseif did_warn then
if eof then print(eof[2]) end
local tb = debug.traceback()
@@ -1245,7 +1262,7 @@ end
-- Generates tests. Call it where Screen:expect() would be. Waits briefly, then
-- dumps the current screen state in the form of Screen:expect().
--- Use snapshot_util({},true) to generate a text-only (no attributes) test.
+-- Use snapshot_util({}) to generate a text-only (no attributes) test.
--
-- @see Screen:redraw_debug()
function Screen:snapshot_util(attrs, ignore, request_cb)
@@ -1301,15 +1318,22 @@ end
-- Returns the current screen state in the form of a screen:expect()
-- keyword-args map.
function Screen:get_snapshot(attrs, ignore)
- attrs = attrs or self._default_attr_ids
if ignore == nil then
ignore = self._default_attr_ignore
end
local attr_state = {
- ids = {},
- ignore = ignore,
- mutable = true, -- allow _row_repr to add missing highlights
+ ids = {},
+ ignore = ignore,
+ mutable = true, -- allow _row_repr to add missing highlights
}
+ if attrs == nil then
+ attrs = self._default_attr_ids
+ elseif isempty(attrs) then
+ attrs = nil
+ attr_state.ids = nil
+ else
+ attr_state.modified = true
+ end
if attrs ~= nil then
for i, a in pairs(attrs) do
@@ -1317,11 +1341,22 @@ function Screen:get_snapshot(attrs, ignore)
end
end
if self._options.ext_linegrid then
- attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids)
+ attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {})
end
local lines = self:render(true, attr_state, true)
+ for i, row in ipairs(lines) do
+ local count = 1
+ while i < #lines and lines[i + 1] == row do
+ count = count + 1
+ table.remove(lines, i + 1)
+ end
+ if count > 1 then
+ lines[i] = lines[i] .. '*' .. count
+ end
+ end
+
local ext_state = self:_extstate_repr(attr_state)
for k, v in pairs(ext_state) do
if isempty(v) then
@@ -1377,7 +1412,7 @@ local function fmt_ext_state(name, state)
end
end
-function Screen:print_snapshot(attrs, ignore)
+function Screen:_print_snapshot(attrs, ignore)
local kwargs, ext_state, attr_state = self:get_snapshot(attrs, ignore)
local attrstr = ""
if attr_state.modified then
@@ -1393,17 +1428,23 @@ function Screen:print_snapshot(attrs, ignore)
table.insert(attrstrs, " "..keyval.." = "..dict..";")
end
attrstr = (", attr_ids={\n"..table.concat(attrstrs, "\n").."\n}")
+ elseif isempty(attrs) then
+ attrstr = ', attr_ids={}'
end
- print( "\nscreen:expect{grid=[[")
- print(kwargs.grid)
- io.stdout:write( "]]"..attrstr)
+ local result = 'screen:expect{grid=[[\n' .. kwargs.grid .. '\n]]' .. attrstr
for _, k in ipairs(ext_keys) do
if ext_state[k] ~= nil and not (k == "win_viewport" and not self.options.ext_multigrid) then
- io.stdout:write(", "..k.."="..fmt_ext_state(k, ext_state[k]))
+ result = result .. ', ' .. k .. '=' .. fmt_ext_state(k, ext_state[k])
end
end
- print("}\n")
+ result = result .. '}'
+
+ return result
+end
+
+function Screen:print_snapshot(attrs, ignore)
+ print('\n' .. self:_print_snapshot(attrs, ignore) .. '\n')
io.stdout:flush()
end
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 4ef7565ec5..e1358a0335 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -12,7 +12,7 @@ describe('screen', function()
helpers.nvim_prog,
'-u', 'NONE',
'-i', 'NONE',
- '-N',
+ '-n',
'--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler',
'--cmd', 'colorscheme vim',
'--embed',
@@ -30,19 +30,9 @@ describe('screen', function()
end)
it('default initial screen', function()
- screen:expect([[
+ screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
{1:[No Name] }|
|
]])
@@ -125,17 +115,7 @@ local function screen_tests(linegrid)
command('set laststatus=2')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
{1:[No Name] }|
|
]])
@@ -143,17 +123,7 @@ local function screen_tests(linegrid)
feed('<c-l>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
{1:[No Name] }|
|
]], reset=true}
@@ -161,17 +131,10 @@ local function screen_tests(linegrid)
command('split')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:[No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:[No Name] }|
|
]])
@@ -179,17 +142,10 @@ local function screen_tests(linegrid)
feed('<c-l>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:[No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:[No Name] }|
|
]], reset=true}
@@ -202,17 +158,10 @@ local function screen_tests(linegrid)
command('sp')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:[No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:[No Name] }|
|
]])
@@ -223,17 +172,10 @@ local function screen_tests(linegrid)
command('resize 8')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
{1:[No Name] }|
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{3:[No Name] }|
|
]])
@@ -245,34 +187,20 @@ local function screen_tests(linegrid)
command('vsp')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{1:[No Name] }{3:[No Name] [No Name] }|
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:[No Name] }|
|
]])
insert('hello')
screen:expect([[
hell^o │hello │hello |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
hello |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:[No Name] [+] }|
|
]])
@@ -288,17 +216,10 @@ local function screen_tests(linegrid)
insert('hello')
screen:expect([[
hell^o │hello │hello |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
hello |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{3:[No Name] [+] }|
|
]])
@@ -308,33 +229,17 @@ local function screen_tests(linegrid)
screen:expect([[
{4: }{5:4}{4:+ [No Name] }{2: + [No Name] }{3: }{4:X}|
hell^o2 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
|
]])
command('tabprevious')
screen:expect([[
{2: }{6:4}{2:+ [No Name] }{4: + [No Name] }{3: }{4:X}|
hell^o │hello │hello |
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
- {0:~ }│{0:~ }│{0:~ }|
+ {0:~ }│{0:~ }│{0:~ }|*5
{1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
hello |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{3:[No Name] [+] }|
|
]])
@@ -345,34 +250,14 @@ local function screen_tests(linegrid)
screen:expect([[
{4: [No Name] }{2: [No Name] }{3: }{4:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
|
]])
feed(':echo "'..string.rep('x\\n', 11)..'"<cr>')
screen:expect([[
{1: }|
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
+ x |*11
|
{7:Press ENTER or type command to continue}^ |
]])
@@ -381,34 +266,13 @@ local function screen_tests(linegrid)
screen:expect([[
{4: [No Name] }{2: [No Name] }{3: }{4:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
|
]])
feed(':echo "'..string.rep('x\\n', 12)..'"<cr>')
screen:expect([[
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
- x |
+ x |*12
|
{7:Press ENTER or type command to continue}^ |
]])
@@ -417,17 +281,7 @@ local function screen_tests(linegrid)
screen:expect([[
{4: [No Name] }{2: [No Name] }{3: }{4:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
|
]])
@@ -439,17 +293,7 @@ local function screen_tests(linegrid)
command('vsplit')
screen:expect([[
^foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
+ foo │foo |*11
{1:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -457,17 +301,8 @@ local function screen_tests(linegrid)
feed('<PageDown>')
screen:expect([[
^foo │foo |
- foo │foo |
- foo │foo |
- foo │foo |
- bar │foo |
- bar │foo |
- bar │foo |
- bar │foo |
- bar │foo |
- bar │foo |
- bar │foo |
- bar │foo |
+ foo │foo |*3
+ bar │foo |*8
{1:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -475,17 +310,8 @@ local function screen_tests(linegrid)
screen:expect([[
{4: }{5:2}{4:+ [No Name] }{2: + [No Name] }{3: }{4:X}|
^foo |
- foo |
- foo |
- foo |
- bar |
- bar |
- bar |
- bar |
- bar |
- bar |
- bar |
- bar |
+ foo |*3
+ bar |*8
|
]])
end)
@@ -497,17 +323,7 @@ local function screen_tests(linegrid)
screen:expect([[
{2: + [No Name] }{4: [No Name] }{3: }{4:X}|
hell^o |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
|
]])
@@ -515,17 +331,7 @@ local function screen_tests(linegrid)
screen:expect([[
{4: + [No Name] }{2: [No Name] }{3: }{4:X}|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
|
]])
end)
@@ -538,16 +344,7 @@ local function screen_tests(linegrid)
line 1 |
line 2 |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
{2:-- INSERT --} |
]])
end)
@@ -563,17 +360,7 @@ local function screen_tests(linegrid)
screen:expect([[
0123^456 |
789 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*11
1,5 All |
]])
end)
@@ -584,18 +371,7 @@ local function screen_tests(linegrid)
feed(':ls')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
:ls^ |
]])
end)
@@ -604,15 +380,7 @@ local function screen_tests(linegrid)
feed(':ls<cr>')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
{1: }|
:ls |
1 %a "[No Name]" line 1 |
@@ -789,9 +557,7 @@ local function screen_tests(linegrid)
feed('iresize')
screen:expect([[
resize^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{2:-- INSERT --} |
]])
end)
@@ -821,17 +587,14 @@ local function screen_tests(linegrid)
screen:expect([[
{2: + [No Name] }{3: }|
resiz^e |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
screen:try_resize(30, 6)
screen:expect([[
{2: + [No Name] }{3: }|
resiz^e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
eq(29, meths.get_var('echospace'))
@@ -840,15 +603,7 @@ local function screen_tests(linegrid)
it('messages from the same Ex command as resize are visible #22225', function()
feed(':set columns=20 | call<CR>')
screen:expect([[
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ |*9
{1: }|
{8:E471: Argument requi}|
{8:red} |
@@ -858,27 +613,12 @@ local function screen_tests(linegrid)
feed('<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
|
]])
feed(':set columns=0<CR>')
screen:expect([[
- |
- |
- |
- |
- |
+ |*5
{1: }|
{8:E594: Need a}|
{8:t least 12 c}|
@@ -892,18 +632,7 @@ local function screen_tests(linegrid)
feed('<CR>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
|
]])
end)
@@ -915,15 +644,7 @@ local function screen_tests(linegrid)
feed(':ls<CR>')
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
{1: }|
:ls |
1 %a "[No Name]" line 1 |
@@ -932,18 +653,7 @@ local function screen_tests(linegrid)
feed('<F1>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
TEST |
]])
end)
@@ -956,35 +666,13 @@ local function screen_tests(linegrid)
feed('ifooj')
screen:expect([[
foo^j |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
{2:-- INSERT --} |
]])
feed('k')
screen:expect([[
fo^o |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
|
]])
end)
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index dc7ef666bd..1e8af4225a 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -32,10 +32,7 @@ describe('search highlighting', function()
screen:expect([[
some ^text |
more text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
/text |
]])
end)
@@ -46,11 +43,7 @@ describe('search highlighting', function()
feed("gg/text")
screen:expect{grid=[[
{6:+-- 2 lines: some text·················}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
/text^ |
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 8, linecount = 2, sum_scroll_delta = 0};
@@ -279,22 +272,16 @@ describe('search highlighting', function()
screen:expect([[
{2: } |
{2:^ } |
- {2: } |
- {2: } |
- {2: } |
- {2: } |
+ {2: } |*4
/^ |
]])
-- Test that highlights are preserved after moving the cursor.
feed("j")
screen:expect([[
- {2: } |
- {2: } |
+ {2: } |*2
{2:^ } |
- {2: } |
- {2: } |
- {2: } |
+ {2: } |*3
/^ |
]])
@@ -306,21 +293,15 @@ describe('search highlighting', function()
screen:expect([[
{2: }|
{2:^ }|
- {2: }|
- {2: }|
- {2: }|
- {2: }|
+ {2: }|*4
^/ |
]])
feed("j")
screen:expect([[
- {2: }|
- {2: }|
+ {2: }|*2
{2:^ }|
- {2: }|
- {2: }|
- {2: }|
+ {2: }|*3
^/ |
]])
end)
@@ -349,8 +330,7 @@ describe('search highlighting', function()
{3:foo} bar baz │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
bar baz {2:foo} │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
bar {2:foo} baz │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
- {1:~ }│{MATCH:.*}|
- {1:~ }│{MATCH:.*}|
+ {1:~ }│{MATCH:.*}|*2
{5:[No Name] [+] }{3:term }|
/foo^ |
]])
@@ -368,10 +348,7 @@ describe('search highlighting', function()
screen:expect([[
the first {3:li}ne │the first {2:li}ne |
in a {2:li}ttle file │in a {2:li}ttle file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/li^ |
]])
@@ -380,10 +357,7 @@ describe('search highlighting', function()
screen:expect([[
the first {2:li}ne │the first {2:li}ne |
in a {3:li}ttle file │in a {2:li}ttle file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/li^ |
]])
@@ -391,10 +365,7 @@ describe('search highlighting', function()
screen:expect([[
the first {3:li}ne │the first {2:li}ne |
in a {2:li}ttle file │in a {2:li}ttle file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/li^ |
]])
@@ -402,10 +373,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a {3:lit}tle file │in a {2:lit}tle file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/lit^ |
]])
@@ -413,10 +381,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a {2:^lit}tle file │in a {2:lit}tle file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/lit |
]])
@@ -424,10 +389,7 @@ describe('search highlighting', function()
screen:expect([[
the {3:fir}st line │the {2:fir}st line |
in a little file │in a little file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/fir^ |
]])
@@ -436,10 +398,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a li{3:ttle} file │in a li{2:ttle} file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/ttle^ |
]])
@@ -448,10 +407,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a {2:^lit}tle file │in a {2:lit}tle file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
|
]])
eq('lit', eval('@/'))
@@ -461,10 +417,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a ^little file │in a little file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
:noh |
]])
@@ -472,20 +425,14 @@ describe('search highlighting', function()
screen:expect([[
the {3:first} line │the {2:first} line |
in a little file │in a little file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/first^ |
]])
feed('<esc>')
screen:expect([[
the first line │the first line |
in a ^little file │in a little file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
|
]])
@@ -507,30 +454,21 @@ describe('search highlighting', function()
screen:expect([[
the {2:fi}rst line │the {2:fi}rst line |
in a little {2:^fi}le │in a little {2:fi}le |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/fi |
]])
feed('//')
screen:expect([[
the {3:fi}rst line │the {2:fi}rst line |
in a little {2:fi}le │in a little {2:fi}le |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
//^ |
]])
feed('<C-g>')
screen:expect([[
the {2:fi}rst line │the {2:fi}rst line |
in a little {3:fi}le │in a little {2:fi}le |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
//^ |
]])
feed('<Esc>')
@@ -541,10 +479,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a little {3:file} │in a little {2:file} |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/file^ |
]])
feed('<Esc>')
@@ -557,10 +492,7 @@ describe('search highlighting', function()
screen:expect([[
the {3:first} line │the {2:first} line |
in a little file │in a little file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/first^ |
]])
feed('<Esc>')
@@ -570,10 +502,7 @@ describe('search highlighting', function()
screen:expect([[
the first line │the first line |
in a {3:little} file │in a {2:little} file |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
/little^ |
]])
feed('<Esc>')
@@ -590,10 +519,7 @@ describe('search highlighting', function()
screen:expect([[
not the {3:mat}ch you're looking for |
the {2:mat}ch is here |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
/mat/e^ |
]])
@@ -602,10 +528,7 @@ describe('search highlighting', function()
screen:expect([[
not the {2:mat}ch you're looking for |
the {3:mat}ch is here |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
/mat/e^ |
]])
@@ -613,10 +536,7 @@ describe('search highlighting', function()
screen:expect([[
not the {2:mat}ch you're looking for |
the {2:ma^t}ch is here |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
/mat/e |
]])
end)
@@ -628,8 +548,7 @@ describe('search highlighting', function()
screen:expect([[
|
a repeated {2:^line } |
- {2:a} repeated {2:line } |
- {2:a} repeated {2:line } |
+ {2:a} repeated {2:line } |*2
{2:a} repeated line |
{1:~ }|
{4:search hit BOTTOM, continuing at TOP} |
@@ -675,10 +594,7 @@ describe('search highlighting', function()
screen:expect{grid=[[
very {5:spec^ial}{2: te}{6:xt} |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{4:search hit BOTTOM, continuing at TOP} |
]], win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 11, linecount = 2, sum_scroll_delta = 0};
@@ -688,21 +604,14 @@ describe('search highlighting', function()
feed("zf4j")
screen:expect{grid=[[
{8:^+-- 2 lines: very special text·········}|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{4:search hit BOTTOM, continuing at TOP} |
]]}
command("%foldopen")
screen:expect([[
very {5:spec^ial}{2: te}{6:xt} |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{4:search hit BOTTOM, continuing at TOP} |
]])
@@ -710,10 +619,7 @@ describe('search highlighting', function()
screen:expect([[
very spec{2:^ial te}xt |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:call clearmatches() |
]])
@@ -723,10 +629,7 @@ describe('search highlighting', function()
screen:expect([[
very {5:spec}{7:^ial}{2: te}xt |
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
:syntax keyword MyGroup special |
]])
end)
@@ -737,11 +640,7 @@ describe('search highlighting', function()
feed(':%g@a/b')
screen:expect([[
{3:a/b}/c |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
:%g@a/b^ |
]])
end)
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index b12e79bd42..bf2830f2f0 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -38,16 +38,7 @@ describe('Signs', function()
{1:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}a |
{1:𠜎̀́̂̃̄̅}b |
{2: }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
|
]])
end)
@@ -64,15 +55,7 @@ describe('Signs', function()
{2: }b |
{1:>>}c |
{2: }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
end)
@@ -85,16 +68,7 @@ describe('Signs', function()
a |
b |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
|
]])
end)
@@ -115,8 +89,7 @@ describe('Signs', function()
{1:>>}b |
{2: }c |
{2: } |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{4:[No Name] [+] }|
{2: }{3:a }|
{1:>>}b |
@@ -145,15 +118,7 @@ describe('Signs', function()
{2: }{6: 2 }{8:b }|
{2: }{7: 3 }c |
{1:>>}{7: 4 }{8:^ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- Check that 'statuscolumn' correctly applies numhl
@@ -172,16 +137,7 @@ describe('Signs', function()
{1:>>}a |
{1:>>}b |
{8:>>}{3:^c }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
|
]])
feed('k')
@@ -189,16 +145,7 @@ describe('Signs', function()
{1:>>}a |
{8:>>}{3:^b }|
{1:>>}c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
|
]])
command('set nocursorline')
@@ -206,16 +153,7 @@ describe('Signs', function()
{1:>>}a |
{1:>>}^b |
{1:>>}c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
|
]])
command('set cursorline cursorlineopt=line')
@@ -223,16 +161,7 @@ describe('Signs', function()
{1:>>}a |
{1:>>}{3:^b }|
{1:>>}c |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*10
|
]])
command('set cursorlineopt=number')
@@ -243,15 +172,7 @@ describe('Signs', function()
{8:>>}^b |
{1:>>}c |
{5: } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- Check that 'statuscolumn' cursorline/signcolumn highlights are the same (#21726)
@@ -282,15 +203,7 @@ describe('Signs', function()
{8:XX}{1:>>}{6: 2 }b |
{1:>>}WW{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- With the default setting, we get the sign with the top id.
@@ -300,15 +213,7 @@ describe('Signs', function()
{1:>>}{6: 2 }b |
WW{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- "auto:3" accommodates all the signs we defined so far.
@@ -318,15 +223,7 @@ describe('Signs', function()
{8:XX}{1:>>}{2: }{6: 2 }b |
{8:XX}{1:>>}WW{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- Check "yes:9".
@@ -336,15 +233,7 @@ describe('Signs', function()
{8:XX}{1:>>}{2: }{6: 2 }b |
{8:XX}{1:>>}WW{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- Check "auto:N" larger than the maximum number of signs defined in
@@ -355,33 +244,17 @@ describe('Signs', function()
{8:XX}{1:>>}{2: }{6: 2 }b |
{8:XX}{1:>>}WW{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]]}
-- line deletion deletes signs.
+ command('3move1')
command('2d')
screen:expect([[
- {1:>>}{8:XX}{2: }{6: 1 }a |
- {8:XX}{1:>>}WW{6: 2 }^c |
- {2: }{6: 3 } |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {1:>>}{8:XX}{6: 1 }a |
+ {8:XX}{1:>>}{6: 2 }^b |
+ {2: }{6: 3 } |
+ {0:~ }|*10
|
]])
end)
@@ -396,15 +269,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- should support up to 8 signs at minimum
@@ -414,15 +279,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- should keep the same sign size when signs are not exceeding
@@ -435,15 +292,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- should resize itself when signs are exceeding minimum but
@@ -456,15 +305,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- should not increase size because sign with existing id is moved
@@ -476,15 +317,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
command('sign place 4 line=1 name=pietSearch buffer=1')
@@ -499,15 +332,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
end)
@@ -525,15 +350,7 @@ describe('Signs', function()
{6: 2 }b |
{6: 3 }c |
{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
-- single column with 1 sign with text and one sign without
@@ -543,15 +360,7 @@ describe('Signs', function()
{2: }{6: 2 }b |
{2: }{6: 3 }c |
{2: }{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
end)
@@ -569,15 +378,7 @@ describe('Signs', function()
{8: 2 }b |
{6: 3 }c |
{6: 4 }^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
end)
@@ -588,12 +389,7 @@ describe('Signs', function()
feed(':sign place<cr>')
screen:expect([[
{1:>>} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
{4: }|
:sign place |
{9:--- Signs ---} |
@@ -606,18 +402,7 @@ describe('Signs', function()
feed('<cr>')
screen:expect([[
{1:>>}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*12
|
]])
end)
@@ -635,15 +420,7 @@ describe('Signs', function()
{2: }^c |
{2: }d |
>>e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
command('sign unplace 10002')
@@ -652,15 +429,7 @@ describe('Signs', function()
^c |
d |
e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*9
|
]])
end)
@@ -679,13 +448,7 @@ describe('Signs', function()
{2: }c |
{2: }d |
>>e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
|
]])
command('sign unplace 10002')
@@ -696,13 +459,7 @@ describe('Signs', function()
c |
d |
e |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
|
]])
end)
diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua
index d18e19e5b2..cc39790dca 100644
--- a/test/functional/ui/spell_spec.lua
+++ b/test/functional/ui/spell_spec.lua
@@ -125,8 +125,7 @@ describe("'spell'", function()
Not |
and her^e |
and here. |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
-- Undo also updates the next line (go to command line to remove message)
@@ -137,8 +136,7 @@ describe("'spell'", function()
Not |
and here^. |
{2:and} here. |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
-- Folding an empty line does not remove Cap in next line
@@ -149,8 +147,7 @@ describe("'spell'", function()
Not |
{10:^+-- 2 lines: and here.·························································}|
{2:and} here. |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
-- Folding the end of a sentence does not remove Cap in next line
@@ -161,9 +158,7 @@ describe("'spell'", function()
{2:another} missing cap her^e |
{10:+-- 2 lines: Not·······························································}|
{2:and} here. |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
-- Cap is correctly applied in the first row of a window
@@ -172,10 +167,7 @@ describe("'spell'", function()
{2:another} missing cap her^e |
{10:+-- 2 lines: Not·······························································}|
{2:and} here. |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
-- Adding an empty line does not remove Cap in "mod_bot" area
@@ -186,8 +178,7 @@ describe("'spell'", function()
{2:another} missing cap here |
{10:+-- 2 lines: Not·······························································}|
{2:and} here. |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
-- Multiple empty lines does not remove Cap in the line after
@@ -220,9 +211,7 @@ describe("'spell'", function()
test test test test$ |
|
{2:end} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{9:-- INSERT --} |
]])
feed('x')
@@ -231,9 +220,7 @@ describe("'spell'", function()
test test test test$ |
|
{2:end} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{9:-- INSERT --} |
]])
end)
@@ -251,10 +238,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:spelin^g}{7: }{8:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed(']s')
@@ -262,10 +246,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:speling}{7: }{8:^mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed(']s')
@@ -273,10 +254,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:^speling}{7: }{8:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{6:search hit BOTTOM, continuing at TOP} |
]])
exec('echo ""')
@@ -287,10 +265,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} {1:func}({5:void}); |
{7:// I am a }{8:^speling}{7: }{8:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed('[s')
@@ -298,10 +273,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} {1:^func}({5:void}); |
{7:// I am a }{8:speling}{7: }{8:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
curbufmeths.del_extmark(ns, id)
@@ -311,10 +283,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} ^func({5:void}); |
{7:// I am a }{8:speling}{7: mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed('[s')
@@ -322,10 +291,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:^speling}{7: mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{6:search hit TOP, continuing at BOTTOM} |
]])
exec('echo ""')
@@ -334,10 +300,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:^speling}{7: }{8:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed(']s')
@@ -345,10 +308,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:speling}{7: }{8:^mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
-- "noplainbuffer" shouldn't change spellchecking behavior with syntax enabled
@@ -359,10 +319,7 @@ describe("'spell'", function()
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
{7:// I am a }{8:^speling}{7: }{8:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
-- no spellchecking with "noplainbuffer" and syntax disabled
@@ -371,10 +328,7 @@ describe("'spell'", function()
#include <stdbool.h> |
bool func(void); |
// I am a ^speling mistakke |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed(']s')
@@ -382,10 +336,7 @@ describe("'spell'", function()
#include <stdbool.h> |
bool func(void); |
// I am a ^speling mistakke |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{6:search hit BOTTOM, continuing at TOP} |
]])
exec('echo ""')
@@ -395,10 +346,7 @@ describe("'spell'", function()
#include <{1:stdbool}.h> |
{1:bool} {1:func}(void); |
// I am a {1:^speling} {1:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
feed('[s')
@@ -406,10 +354,7 @@ describe("'spell'", function()
#include <{1:stdbool}.h> |
{1:bool} {1:^func}(void); |
// I am a {1:speling} {1:mistakke} |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua
index 6eaf15cfad..74a7e3607f 100644
--- a/test/functional/ui/statuscolumn_spec.lua
+++ b/test/functional/ui/statuscolumn_spec.lua
@@ -451,9 +451,7 @@ describe('statuscolumn', function()
{4:wrapped 1 15}{5:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{4:wrapped 2 15}{5:aaaaaaaaaaaaaaaaaaa }|
{1:virtual-1 15}END |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
-- Also test virt_lines when 'cpoptions' includes "n"
@@ -562,19 +560,9 @@ describe('statuscolumn', function()
it('clicks and highlights work with control characters', function()
meths.set_option_value('statuscolumn', '\t%#NonText#\1%0@MyClickFunc@\t\1%T\t%##\1', {})
screen:expect{grid=[[
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
+ {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |*4
{1:^I}{0:^A^I^A^I}{1:^A}^aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
- {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |
+ {1:^I}{0:^A^I^A^I}{1:^A}aaaaa |*8
|
]], attr_ids={
[0] = {foreground = Screen.colors.Blue, bold = true}; -- NonText
@@ -702,8 +690,7 @@ describe('statuscolumn', function()
---------8 aaaaa |
virt |
---------9 aaaaa |
- ~ |
- ~ |
+ ~ |*2
|
]])
end)
@@ -718,11 +705,7 @@ describe('statuscolumn', function()
[No Name] [+] |
:1set stc=%^l |
:2 |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
[Command Line] |
: |
]])
@@ -749,9 +732,7 @@ describe('statuscolumn', function()
screen:expect([[
aaaaa |
^aaaaa |
- aaaaa |
- aaaaa |
- aaaaa |
+ aaaaa |*3
|
]])
-- width correctly estimated with "w_nrwidth_line_count" when setting 'nu'
diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua
index 182e0cdadf..a88c03f565 100644
--- a/test/functional/ui/statusline_spec.lua
+++ b/test/functional/ui/statusline_spec.lua
@@ -66,11 +66,7 @@ for _, model in ipairs(mousemodels) do
meths.set_option_value('statusline', '\t%#NonText#\1%0@MyClickFunc@\t\1%T\t%##\1', {})
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:^I}{0:^A^I^A^I}{1:^A }|
|
]]}
@@ -178,11 +174,7 @@ for _, model in ipairs(mousemodels) do
command('vsplit')
screen:expect{grid=[[
^ │ |
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
- {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|*5
{1:Clicky stuff Clicky stuff}|
|
]]}
@@ -241,39 +233,16 @@ describe('global statusline', function()
it('works', function()
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
{2:[No Name] 0,0-1 All}|
|
]])
feed('i<CR><CR>')
screen:expect([[
- |
- |
+ |*2
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*11
{2:[No Name] [+] 3,1 All}|
{3:-- INSERT --} |
]])
@@ -283,9 +252,7 @@ describe('global statusline', function()
command('vsplit | split | vsplit | vsplit | wincmd l | split | 2wincmd l | split')
screen:expect([[
│ │ │^ |
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~ }│{1:~}│{1:~ }|*3
{1:~ }├────────────────┤{1:~}│{1:~ }|
{1:~ }│ │{1:~}│{1:~ }|
{1:~ }│{1:~ }│{1:~}│{1:~ }|
@@ -293,9 +260,7 @@ describe('global statusline', function()
{1:~ }│{1:~ }│{1:~}│ |
────────────────────┴────────────────┴─┤{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
{2:[No Name] 0,0-1 All}|
|
]])
@@ -305,39 +270,14 @@ describe('global statusline', function()
command('set laststatus=1')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
0,0-1 All |
]])
command('set laststatus=3')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
{2:[No Name] 0,0-1 All}|
|
]])
@@ -346,9 +286,7 @@ describe('global statusline', function()
command('set laststatus=2')
screen:expect([[
│ │ │^ |
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~ }│{1:~}│{1:~ }|*3
{1:~ }│{4:< Name] 0,0-1 }│{1:~}│{1:~ }|
{1:~ }│ │{1:~}│{1:~ }|
{1:~ }│{1:~ }│{1:~}│{1:~ }|
@@ -356,9 +294,7 @@ describe('global statusline', function()
{1:~ }│{1:~ }│{1:~}│ |
{4:<No Name] 0,0-1 All < Name] 0,0-1 <}│{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
{4:[No Name] 0,0-1 All <No Name] 0,0-1 All}|
|
]])
@@ -366,9 +302,7 @@ describe('global statusline', function()
command('set laststatus=3')
screen:expect([[
│ │ │^ |
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~ }│{1:~}│{1:~ }|*3
{1:~ }├────────────────┤{1:~}│{1:~ }|
{1:~ }│ │{1:~}│{1:~ }|
{1:~ }│{1:~ }│{1:~}│{1:~ }|
@@ -376,9 +310,7 @@ describe('global statusline', function()
{1:~ }│{1:~ }│{1:~}│ |
────────────────────┴────────────────┴─┤{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
{2:[No Name] 0,0-1 All}|
|
]])
@@ -386,9 +318,7 @@ describe('global statusline', function()
command('set laststatus=0')
screen:expect([[
│ │ │^ |
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~ }│{1:~}│{1:~ }|*3
{1:~ }│{4:< Name] 0,0-1 }│{1:~}│{1:~ }|
{1:~ }│ │{1:~}│{1:~ }|
{1:~ }│{1:~ }│{1:~}│{1:~ }|
@@ -396,19 +326,14 @@ describe('global statusline', function()
{1:~ }│{1:~ }│{1:~}│ |
{4:<No Name] 0,0-1 All < Name] 0,0-1 <}│{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*4
0,0-1 All |
]])
command('set laststatus=3')
screen:expect([[
│ │ │^ |
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
- {1:~ }│{1:~ }│{1:~}│{1:~ }|
+ {1:~ }│{1:~ }│{1:~}│{1:~ }|*3
{1:~ }├────────────────┤{1:~}│{1:~ }|
{1:~ }│ │{1:~}│{1:~ }|
{1:~ }│{1:~ }│{1:~}│{1:~ }|
@@ -416,9 +341,7 @@ describe('global statusline', function()
{1:~ }│{1:~ }│{1:~}│ |
────────────────────┴────────────────┴─┤{1:~ }|
│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*3
{2:[No Name] 0,0-1 All}|
|
]])
@@ -460,11 +383,7 @@ describe('global statusline', function()
feed('L')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
────────────────────────────────────────────────────────────|
0000;<control>;Cc;0;BN;;;;;N;NULL;;;; |
0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;;; |
@@ -479,11 +398,7 @@ describe('global statusline', function()
feed('j')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
────────────────────────────────────────────────────────────|
0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;;; |
0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
@@ -499,11 +414,7 @@ describe('global statusline', function()
screen:expect([[
{3: }{5:2}{3: t/f/f/bigfile.txt }{4: }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
────────────────────────────────────────────────────────────|
0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
0003;<control>;Cc;0;BN;;;;;N;END OF TEXT;;;; |
@@ -518,11 +429,7 @@ describe('global statusline', function()
screen:expect([[
{3: }{5:2}{3: t/f/f/bigfile.txt }{4: }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
────────────────────────────────────────────────────────────|
0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;;; |
0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
@@ -537,11 +444,7 @@ describe('global statusline', function()
screen:expect([[
{3: }{5:2}{3: t/f/f/bigfile.txt }{4: }|
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
────────────────────────────────────────────────────────────|
0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
0003;<control>;Cc;0;BN;;;;;N;END OF TEXT;;;; |
@@ -579,22 +482,14 @@ it('statusline is redrawn with :resize from <Cmd> mapping #19629', function()
feed('<Up>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
{1:[No Name] }|
- |
- |
+ |*2
]])
feed('<Down>')
screen:expect([[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
{1:[No Name] }|
|
]])
@@ -614,11 +509,7 @@ it('showcmdloc=statusline does not show if statusline is too narrow', function()
command('1vsplit')
screen:expect([[
^ │ |
- {0:~}│{0:~ }|
- {0:~}│{0:~ }|
- {0:~}│{0:~ }|
- {0:~}│{0:~ }|
- {0:~}│{0:~ }|
+ {0:~}│{0:~ }|*5
{1:< }{2:[No Name] }|
|
]])
@@ -668,8 +559,7 @@ it('statusline is redrawn on various state changes', function()
screen:expect([[
^ |
~ |
- |
- |
+ |*2
]])
feed('qQ')
screen:expect([[
@@ -682,8 +572,7 @@ it('statusline is redrawn on various state changes', function()
screen:expect([[
^ |
~ |
- |
- |
+ |*2
]])
-- Visual mode change #23932
@@ -765,12 +654,10 @@ it("shows correct ruler in cmdline with no statusline", function()
command '1wincmd w'
screen:expect [[
^ |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:[No Name] 1longlonglong }|
│ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
3longlonglong |
]]
-- Window 2 is current. It has no statusline, so cmdline should show its
@@ -778,24 +665,20 @@ it("shows correct ruler in cmdline with no statusline", function()
command '2wincmd w'
screen:expect [[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[No Name] 1longlonglong }|
^ │ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
2longlonglong |
]]
-- Window 3 is current. Cmdline should again show its ruler.
command '3wincmd w'
screen:expect [[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:[No Name] 1longlonglong }|
│^ |
- {1:~ }│{1:~ }|
- {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|*2
3longlonglong |
]]
end)
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua
index 1391985823..c3406067bc 100644
--- a/test/functional/ui/syntax_conceal_spec.lua
+++ b/test/functional/ui/syntax_conceal_spec.lua
@@ -45,15 +45,9 @@ describe('Screen', function()
it("double characters.", function()
screen:expect([[
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
+ {1:∧} |*6
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -61,15 +55,10 @@ describe('Screen', function()
it('double characters and move the cursor one line up.', function()
feed("k")
screen:expect([[
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
+ {1:∧} |*5
^&& |
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -78,14 +67,9 @@ describe('Screen', function()
feed("gg")
screen:expect([[
^&& |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
+ {1:∧} |*5
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -95,13 +79,9 @@ describe('Screen', function()
screen:expect([[
{1:∧} |
^&& |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
+ {1:∧} |*4
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -109,15 +89,9 @@ describe('Screen', function()
it('double characters and then move the cursor to the beginning of the file and back to the end of the file.', function()
feed("ggG")
screen:expect([[
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
+ {1:∧} |*6
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]])
end)
@@ -128,15 +102,9 @@ describe('Screen', function()
command("let &conceallevel=1")
command("syn keyword kLambda lambda conceal cchar=λ")
screen:expect([[
- {1:λ} |
- {1:λ} |
+ {1:λ} |*2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]])
end) -- Keyword
@@ -152,15 +120,9 @@ describe('Screen', function()
it('initially and conceal it.', function()
command("syn region rText start='<r>' end='</r>' conceal cchar=R")
screen:expect([[
- {1:R} |
- {1:R} |
+ {1:R} |*2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]])
end)
@@ -170,15 +132,9 @@ describe('Screen', function()
-- be replaced with cchar.
command("syn region rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-")
screen:expect([[
- {1: } a region of text {1:-} |
- {1: } a region of text {1:-} |
+ {1: } a region of text {1:-} |*2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]])
end)
@@ -187,15 +143,11 @@ describe('Screen', function()
command("syn region rText contains=rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-")
insert("<r> A region with <r> a nested <r> nested region.</r> </r> </r>\n")
screen:expect([[
- {1: } a region of text {1:-} |
- {1: } a region of text {1:-} |
+ {1: } a region of text {1:-} |*2
{1: } A region with {1: } a nested {1: } nested region.{1:-} |
{1:-} {1:-} |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -211,15 +163,9 @@ describe('Screen', function()
it("and turn on implicit concealing", function()
screen:expect([[
- {1:-} |
- {1:-} |
+ {1:-} |*2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*6
|
]])
end)
@@ -230,29 +176,19 @@ describe('Screen', function()
insert("<i> italian text </i>\n")
command("syn region iText start='<i>' end='</i>' cchar=*")
screen:expect([[
- {1:-} |
- {1:-} |
- <i> italian text </i> |
- <i> italian text </i> |
+ {1:-} |*2
+ <i> italian text </i> |*2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
command("syntax conceal on")
command("syn region iText start='<i>' end='</i>' cchar=*")
screen:expect([[
- {1:-} |
- {1:-} |
- {1:*} |
- {1:*} |
+ {1:-} |*2
+ {1:*} |*2
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -266,28 +202,14 @@ describe('Screen', function()
command("syn match Foo /foobar/ conceal cchar=&")
screen:expect([[
{1:&&&}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
|
]])
feed("i")
-- cursor should stay in place, not jump to column 16
screen:expect([[
{1:&&&}^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*8
{4:-- INSERT --} |
]])
end)
@@ -311,10 +233,7 @@ describe('Screen', function()
+ With cchar |
|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -327,10 +246,7 @@ describe('Screen', function()
{1:C} |
|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -343,10 +259,7 @@ describe('Screen', function()
{1:C} |
|
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -355,14 +268,9 @@ describe('Screen', function()
command("let &conceallevel=3")
screen:expect([[
// No Conceal |
- |
- |
- |
+ |*3
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
|
]])
end)
@@ -375,15 +283,10 @@ describe('Screen', function()
command("set cole=2")
feed('5Ofoo barf bar barf eggs<esc>')
screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
foo barf bar barf egg^s |
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
@@ -398,18 +301,14 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
|
{2:[No Name] [+] }|
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*3
{3:[No Name] [+] }|
|
]])
feed('<c-w>w')
screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*3
|
{3:[No Name] [+] }|
foo {1:b} bar {1:b} eggs |
@@ -423,29 +322,20 @@ describe('Screen', function()
it('in insert mode', function()
feed('i')
screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
foo barf bar barf egg^s |
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:-- INSERT --} |
]])
feed('<up>')
screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*3
foo barf bar barf egg^s |
foo {1:b} bar {1:b} eggs |
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:-- INSERT --} |
]])
end)
@@ -455,70 +345,45 @@ describe('Screen', function()
feed('gg')
screen:expect([[
^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
feed('i')
screen:expect([[
^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:-- INSERT --} |
]])
feed('<esc>')
screen:expect([[
^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
feed('v')
screen:expect([[
^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:-- VISUAL --} |
]])
feed('<esc>')
screen:expect([[
^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
@@ -529,42 +394,27 @@ describe('Screen', function()
feed('gg')
screen:expect([[
^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
feed('i')
screen:expect([[
^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:-- INSERT --} |
]])
feed('<esc>')
screen:expect([[
^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
@@ -572,28 +422,18 @@ describe('Screen', function()
feed('v')
screen:expect([[
^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
{4:-- VISUAL --} |
]])
feed('<esc>')
screen:expect([[
^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -601,15 +441,10 @@ describe('Screen', function()
it('and open line', function()
feed('o')
screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*5
^ |
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{4:-- INSERT --} |
]])
end)
@@ -618,15 +453,10 @@ describe('Screen', function()
command('set cocu=i')
feed('o')
screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*5
^ |
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{4:-- INSERT --} |
]])
end)
@@ -639,12 +469,9 @@ describe('Screen', function()
^foo barf bar barf eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -655,12 +482,9 @@ describe('Screen', function()
foo barf bar barf eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/^ |
]])
@@ -669,12 +493,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo barf bar barf eggs {3:x} |
foo {1:b} bar {1:b} eggs {5:x}y |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/x^ |
]])
@@ -683,12 +504,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs x |
foo barf bar barf eggs {3:xy} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/xy^ |
]])
@@ -697,12 +515,9 @@ describe('Screen', function()
foo barf bar barf eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/^ |
]])
end)
@@ -717,12 +532,9 @@ describe('Screen', function()
foo barf bar barf eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/^ |
]])
@@ -731,12 +543,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs {3:x} |
foo {1:b} bar {1:b} eggs {5:x}y |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/x^ |
]])
@@ -745,12 +554,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs {3:xy} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/xy^ |
]])
@@ -759,12 +565,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/^ |
]])
@@ -773,12 +576,9 @@ describe('Screen', function()
^foo barf bar barf eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -789,12 +589,9 @@ describe('Screen', function()
^foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
@@ -805,12 +602,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/^ |
]])
@@ -819,12 +613,9 @@ describe('Screen', function()
foo {1:b} bar {1:b} eggs |
foo barf bar barf eggs {3:x} |
foo {1:b} bar {1:b} eggs {5:x}y |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/x^ |
]])
@@ -833,12 +624,9 @@ describe('Screen', function()
foo barf bar barf eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
/^ |
]])
@@ -847,12 +635,9 @@ describe('Screen', function()
^foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs x |
foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]])
end)
@@ -865,40 +650,23 @@ describe('Screen', function()
feed(':3<cr>o a<Esc>ggV')
screen:expect{grid=[[
^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
a |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*5
{4:-- VISUAL LINE --} |
]]}
feed(string.rep('j', 15))
screen:expect{grid=[[
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
+ {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |*8
^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
{4:-- VISUAL LINE --} |
]]}
feed(string.rep('k', 15))
screen:expect{grid=[[
^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*2
a |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*5
{4:-- VISUAL LINE --} |
]]}
end)
@@ -918,11 +686,7 @@ describe('Screen', function()
bbb |
ccc |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]]}
@@ -940,11 +704,7 @@ describe('Screen', function()
bbb |
^ccc |
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]]}
eq({{2, 0, {{'c', 0, 3}, {' ', 0, 50}}}, {3, 0, {{' ', 0, 53}}}}, grid_lines)
@@ -965,11 +725,7 @@ describe('Screen', function()
bbb |
ccc |
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]]}
@@ -987,11 +743,7 @@ describe('Screen', function()
bbb |
^ccc |
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*5
|
]]}
eq({{2, 0, {{'c', 0, 3}, {' ', 0, 50}}}}, grid_lines)
@@ -1067,13 +819,7 @@ describe('Screen', function()
screen:expect{grid=[[
^c |
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*7
|
]]}
end)
diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua
index befdb7c5d1..8f40e1db61 100644
--- a/test/functional/ui/tabline_spec.lua
+++ b/test/functional/ui/tabline_spec.lua
@@ -30,9 +30,7 @@ describe('ui/ext_tabline', function()
}
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]], condition=function()
eq({ id = 2 }, event_curtab)
@@ -42,9 +40,7 @@ describe('ui/ext_tabline', function()
command("tabNext")
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]], condition=function()
eq({ id = 1 }, event_curtab)
@@ -59,9 +55,7 @@ describe('ui/ext_tabline', function()
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]], condition=function()
eq({ id = 1}, event_curbuf)
@@ -77,9 +71,7 @@ describe('ui/ext_tabline', function()
}
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]], condition=function()
eq({ id = 2 }, event_curbuf)
@@ -107,16 +99,14 @@ describe("tabline", function()
screen:expect{grid=[[
{1:asdf }|
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
command('set tabline=jkl')
screen:expect{grid=[[
{1:jkl }|
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
end)
@@ -136,8 +126,7 @@ describe("tabline", function()
screen:expect{grid=[[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^1 |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
assert_alive()
@@ -145,32 +134,27 @@ describe("tabline", function()
screen:expect{grid=[[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^2 |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
meths.input_mouse('left', 'press', '', 0, 0, 0)
screen:expect{grid=[[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^1 |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
meths.input_mouse('left', 'press', '', 0, 0, 39)
screen:expect{grid=[[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^2 |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
|
]]}
meths.input_mouse('left', 'press', '', 0, 0, 40)
screen:expect{grid=[[
tab^1 |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]}
end)
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index 3201135b67..79903fd42f 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -28,8 +28,7 @@ describe("'wildmenu'", function()
feed(':sign <Tab>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1:define}{2: jump list > }|
:sign define^ |
]]}
@@ -37,8 +36,7 @@ describe("'wildmenu'", function()
feed('<Tab>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:define }{1:jump}{2: list > }|
:sign jump^ |
]]}
@@ -46,8 +44,7 @@ describe("'wildmenu'", function()
feed('<Tab>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:define jump }{1:list}{2: > }|
:sign list^ |
]]}
@@ -56,8 +53,7 @@ describe("'wildmenu'", function()
feed('<Tab><Tab><Tab><Tab>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:define jump list > }|
:sign ^ |
]]}
@@ -66,9 +62,7 @@ describe("'wildmenu'", function()
feed('<Space>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
:sign ^ |
]]}
@@ -78,8 +72,7 @@ describe("'wildmenu'", function()
feed(':sign <Esc>')
screen:expect{grid=[[
|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{1:define}{2: jump list > }|
:sign define^ |
]]}
@@ -89,9 +82,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect{grid=[[
^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*3
|
]]}
end)
@@ -100,17 +91,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
define jump list > |
:sign define^ |
]])
feed('<C-E>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign ^ |
]])
end)
@@ -119,17 +107,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
define jump list > |
:sign define^ |
]])
feed('<tab><C-Y>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign jump^ |
]])
end)
@@ -139,8 +124,7 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
define jump list > |
:sign define^ |
]])
@@ -154,16 +138,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
define jump list > |
:sign define^ |
]])
feed('<space>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
[No Name] |
:sign define ^ |
]])
@@ -174,8 +156,7 @@ describe("'wildmenu'", function()
feed(':j<Tab><Tab><Tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
join jumps |
:j^ |
]])
@@ -183,8 +164,7 @@ describe("'wildmenu'", function()
feed('<BS><Tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
! # & < = > @ > |
:!^ |
]])
@@ -225,8 +205,7 @@ describe("'wildmenu'", function()
feed([[:sign <Tab>]]) -- Invoke wildmenu.
screen:expect{grid=[[
|
- ~ |
- ~ |
+ ~ |*2
define jump list > |
:sign define^ |
]]}
@@ -282,21 +261,16 @@ describe("'wildmenu'", function()
feed('<tab>') -- trigger wildmode full
screen:expect([[
[No Name] |
- |
- |
+ |*2
:set wildm |
- wildmenu wildmode |
- wildmenu wildmode |
+ wildmenu wildmode |*2
:set wildmenu^ |
]])
feed('<Esc>')
screen:expect([[
[No Name] |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
|
]])
end)
@@ -311,18 +285,13 @@ describe("'wildmenu'", function()
feed(':sign u<tab>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
:sign un^ |
]])
feed('<tab>') -- trigger wildmode list
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
|
:sign un |
undefine unplace |
@@ -331,11 +300,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
|
]])
@@ -343,8 +308,7 @@ describe("'wildmenu'", function()
feed(':sign un<tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
|
:sign un |
undefine unplace |
@@ -355,11 +319,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
|
]])
end)
@@ -372,8 +332,7 @@ describe("'wildmenu'", function()
feed(':sign u<tab>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
|
:sign u |
undefine unplace |
@@ -382,8 +341,7 @@ describe("'wildmenu'", function()
feed('<tab>') -- trigger wildmode longest
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
|
:sign u |
undefine unplace |
@@ -392,11 +350,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*5
|
]])
end)
@@ -409,8 +363,7 @@ describe("'wildmenu'", function()
feed('<c-d>')
screen:expect([[
|
- ~ |
- ~ |
+ ~ |*2
|
:set wildm |
wildmenu wildmode |
@@ -418,8 +371,7 @@ describe("'wildmenu'", function()
]])
feed('<c-d>')
screen:expect([[
- |
- |
+ |*2
:set wildm |
wildmenu wildmode |
:set wildm |
@@ -429,10 +381,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
[No Name] |
|
]])
@@ -457,8 +406,7 @@ describe("'wildmenu'", function()
feed(':syntax <f2>')
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:case}{3: clear cluster > }|
:syntax case^ |
]]}
@@ -471,17 +419,14 @@ describe("'wildmenu'", function()
feed ':syntax <tab>'
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:syntax c^ |
]]}
feed '<tab>'
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{3:case clear cluster > }|
:syntax c^ |
]]}
@@ -489,9 +434,7 @@ describe("'wildmenu'", function()
feed '<tab>'
screen:expect{grid=[[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:syntax cc^ |
]]}
end)
@@ -522,9 +465,7 @@ describe('command line completion', function()
feed(':!<tab><bs>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:!Xtest-functional-viml-compl-dir^ |
]])
end)
@@ -535,8 +476,7 @@ describe('command line completion', function()
feed(':!echo $XTEST_<tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:XTEST_1}{3: XTEST_2 }|
:!echo $XTEST_1^ |
]])
@@ -552,8 +492,7 @@ describe('command line completion', function()
feed(':!echo $XTEST_<tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2:XTEST_1AaあB}{3: XTEST_2 }|
:!echo $XTEST_1AaあB^ |
]])
@@ -567,18 +506,14 @@ describe('command line completion', function()
feed(':sign unpla<S-Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:sign unplace^ |
]])
feed('<Space>buff<Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:sign unplace buffer=^ |
]])
end)
@@ -590,9 +525,7 @@ describe('command line completion', function()
feed(':sign <S-Tab>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
:sign unplace^ |
]])
end)
@@ -636,45 +569,35 @@ describe('ui/ext_wildmenu', function()
feed(':sign <tab>')
screen:expect{grid=[[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign define^ |
]], wildmenu_items=expected, wildmenu_pos=0}
feed('<tab>')
screen:expect{grid=[[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign jump^ |
]], wildmenu_items=expected, wildmenu_pos=1}
feed('<left><left>')
screen:expect{grid=[[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign ^ |
]], wildmenu_items=expected, wildmenu_pos=-1}
feed('<right>')
screen:expect{grid=[[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign define^ |
]], wildmenu_items=expected, wildmenu_pos=0}
feed('a')
screen:expect{grid=[[
|
- ~ |
- ~ |
- ~ |
+ ~ |*3
:sign definea^ |
]]}
end)
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua
index 78bbcd3a63..65fd5d31f5 100644
--- a/test/functional/ui/winbar_spec.lua
+++ b/test/functional/ui/winbar_spec.lua
@@ -38,16 +38,7 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*10
|
]])
-- winbar is excluded from the heights returned by winheight() and getwininfo()
@@ -62,16 +53,7 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars+++++++++++++++++++++++++++++++++++++++++++++}|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*10
|
]])
end)
@@ -81,16 +63,7 @@ describe('winbar', function()
screen:expect([[
{5:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*10
|
]])
end)
@@ -155,16 +128,13 @@ describe('winbar', function()
command('belowright vsplit | split | split | set winbar=')
screen:expect([[
│^ |
- {3:~ }│{3:~ }|
- {3:~ }│{3:~ }|
+ {3:~ }│{3:~ }|*2
{3:~ }│{4:[No Name] }|
{3:~ }│ |
- {3:~ }│{3:~ }|
- {3:~ }│{3:~ }|
+ {3:~ }│{3:~ }|*2
{3:~ }│{2:[No Name] }|
{3:~ }│ |
- {3:~ }│{3:~ }|
- {3:~ }│{3:~ }|
+ {3:~ }│{3:~ }|*2
{2:[No Name] [No Name] }|
|
]])
@@ -211,15 +181,7 @@ describe('winbar', function()
{1:Hello, I am a ruler: 2,11 }|
just some |
random tex^t |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*9
|
]]}
feed 'b'
@@ -227,15 +189,7 @@ describe('winbar', function()
{1:Hello, I am a ruler: 2,8 }|
just some |
random ^text |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*9
|
]]}
feed 'k'
@@ -243,15 +197,7 @@ describe('winbar', function()
{1:Hello, I am a ruler: 1,8 }|
just so^me |
random text |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*9
|
]]}
end)
@@ -261,15 +207,7 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*9
{4:[No Name] }|
|
]])
@@ -295,14 +233,7 @@ describe('winbar', function()
{10: }{11:4}{10: [No Name] }{1: [No Name] }{2: }{10:X}|
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*8
{4:[No Name] }|
|
]])
@@ -330,9 +261,7 @@ describe('winbar', function()
line i |
line sin(theta) |
line 8 |
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
|
]])
eq({5, 1}, meths.win_get_cursor(0))
@@ -348,9 +277,7 @@ describe('winbar', function()
{7:li}^ne i |
line sin(theta) |
line 8 |
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
{1:-- VISUAL --} |
]])
eq({6, 2}, meths.win_get_cursor(0))
@@ -366,9 +293,7 @@ describe('winbar', function()
line i |
line sin(theta) |
line 8 |
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
{1:-- VISUAL --} |
]])
eq({1, 2}, meths.win_get_cursor(0))
@@ -383,15 +308,11 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
{4:[No Name] }|
{1:Set Up The Bars }|
|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*3
{2:[No Name] }|
|
]])
@@ -402,15 +323,11 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
{4:[No Name] }|
{1:Set Up The Bars }|
|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*2
{2:[No Name] }|
|
]])
@@ -419,15 +336,11 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
+ {3:~ }|*2
{4:[No Name] }|
{1:Set Up The Bars }|
|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
{2:[No Name] }|
|
]])
@@ -438,17 +351,13 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
+ {3:~ }|*2
{4:[No Name] }|
{1:Set Up The Bars }|
|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*2
{2:[No Name] }|
- |
- |
- |
+ |*3
]])
eq(3, meths.get_option_value('cmdheight', {}))
@@ -456,15 +365,11 @@ describe('winbar', function()
screen:expect([[
{1:Set Up The Bars }|
^ |
- {3:~ }|
- {3:~ }|
+ {3:~ }|*2
{4:[No Name] }|
{1:Set Up The Bars }|
|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
{2:[No Name] }|
|
]])
@@ -500,15 +405,8 @@ describe('winbar', function()
{1:bar }|
^ |
{3:~ }{8: }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }{9:~ }{3: }|*6
+ {3:~ }|*3
|
]]}
meths.set_option_value('winbar', 'floaty bar', { scope = 'local', win = win.id })
@@ -517,14 +415,8 @@ describe('winbar', function()
^ |
{3:~ }{1:floaty bar }{3: }|
{3:~ }{8: }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }{9:~ }{3: }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }{9:~ }{3: }|*5
+ {3:~ }|*3
|
]]}
end)
@@ -537,8 +429,7 @@ describe('winbar', function()
screen:expect([[
{1:foo }│ |
^ │{3:~ }|
- {3:~ }│{3:~ }|
- {3:~ }│{3:~ }|
+ {3:~ }│{3:~ }|*2
{4:[No Name] }{2:[No Name] }|
|
]])
@@ -547,8 +438,7 @@ describe('winbar', function()
screen:expect([[
│{1:foo }|
{3:~ }│^ |
- {3:~ }│{3:~ }|
- {3:~ }│{3:~ }|
+ {3:~ }│{3:~ }|*2
{2:[No Name] }{4:[No Name] }|
|
]])
@@ -558,8 +448,7 @@ describe('winbar', function()
screen:expect([[
{1:foo }│^ |
│{3:~ }|
- {3:~ }│{3:~ }|
- {3:~ }│{3:~ }|
+ {3:~ }│{3:~ }|*2
{2:[No Name] }{4:[No Name] }|
|
]])
@@ -571,14 +460,7 @@ describe('winbar', function()
^ |
{4:[No Name] }|
|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*8
{2:[No Name] }|
|
]])
@@ -589,12 +471,7 @@ describe('winbar', function()
{4:[No Name] }|
{1:a }|
|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*6
{2:[No Name] }|
|
]])
@@ -641,13 +518,7 @@ describe('local winbar with tabs', function()
screen:expect([[
{4: [No Name] }{1: [No Name] }{2: }{4:X}|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*7
|
]])
command('tabnext')
@@ -655,12 +526,7 @@ describe('local winbar with tabs', function()
{1: [No Name] }{4: [No Name] }{2: }{4:X}|
{1:foo }|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*6
|
]]}
end)
@@ -675,11 +541,7 @@ describe('local winbar with tabs', function()
some |
goofy |
tex^t |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*5
|
]]}
@@ -688,13 +550,7 @@ describe('local winbar with tabs', function()
screen:expect{grid=[[
{4: + [No Name] }{1: [No Name] }{2: }{4:X}|
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*7
|
]]}
@@ -705,10 +561,7 @@ describe('local winbar with tabs', function()
some |
goofy |
tex^t |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*4
|
]]}
end)
@@ -730,8 +583,7 @@ it('winbar works properly when redrawing is postponed #23534', function()
screen:expect([[
{1:(winbar) }|
^ |
- {0:~ }|
- {0:~ }|
+ {0:~ }|*2
{2:(statusline) }|
|
]])
diff --git a/test/functional/vimscript/api_functions_spec.lua b/test/functional/vimscript/api_functions_spec.lua
index 0a7e7c1137..66136de1d1 100644
--- a/test/functional/vimscript/api_functions_spec.lua
+++ b/test/functional/vimscript/api_functions_spec.lua
@@ -182,10 +182,7 @@ describe('eval-API', function()
{1:call} {2:bufnr}{3:(}{4:'%'}{3:)} |
{1:call} {2:nvim_input}{3:(}{4:'typing...'}{3:)} |
{1:call} not_a_function{3:(}{4:42}{3:^)} |
- {5:~ }|
- {5:~ }|
- {5:~ }|
- {5:~ }|
+ {5:~ }|*4
|
]])
end)
diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua
index bb28938708..de5c32fb6c 100644
--- a/test/functional/vimscript/execute_spec.lua
+++ b/test/functional/vimscript/execute_spec.lua
@@ -114,8 +114,7 @@ describe('execute()', function()
feed(':echo execute("hi ErrorMsg")<CR>')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{2: }|
|
ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red |
@@ -187,30 +186,21 @@ describe('execute()', function()
feed([[:call Test1()<cr>]])
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
ABCD |
]])
feed([[:call Test2()<cr>]])
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
1234ABCD |
]])
feed([[:call Test3()<cr>]])
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
1234ABCDXZYZ |
]])
@@ -231,10 +221,7 @@ describe('execute()', function()
feed([[:call Test5()<cr>]])
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*4
1234ABCD |
]])
@@ -273,9 +260,7 @@ describe('execute()', function()
command('let g:mes = execute("echon 42", "")')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
42 |
]])
eq('42', eval('g:mes'))
@@ -295,9 +280,7 @@ describe('execute()', function()
command('let g:mes = execute("echon 42")')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]])
eq('42', eval('g:mes'))
@@ -305,9 +288,7 @@ describe('execute()', function()
command('let g:mes = execute("echon 13", "silent")')
screen:expect{grid=[[
^ |
- ~ |
- ~ |
- ~ |
+ ~ |*3
|
]], unchanged=true}
eq('13', eval('g:mes'))
diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua
index e1179d29cc..b8ac99437d 100644
--- a/test/functional/vimscript/input_spec.lua
+++ b/test/functional/vimscript/input_spec.lua
@@ -89,9 +89,7 @@ describe('input()', function()
command('redraw!')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo}^ |
]])
end)
@@ -100,17 +98,13 @@ describe('input()', function()
feed([[:call input(1, 2)<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}2^ |
]])
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}^ |
]])
end)
@@ -120,25 +114,19 @@ describe('input()', function()
feed([[:echo input(opts)<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}2^ |
]])
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}^ |
]])
feed('<Esc>')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:3} |
]])
end)
@@ -148,33 +136,25 @@ describe('input()', function()
feed([[:echo inputdialog(opts)<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Bar^ |
]])
command('mode')
screen:expect{grid=[[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Bar^ |
]], reset=true}
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Ba^ |
]])
command('mode')
screen:expect{grid=[[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Ba^ |
]], reset=true}
end)
@@ -183,9 +163,7 @@ describe('input()', function()
feed([[:call input({})<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
^ |
]])
end)
@@ -245,9 +223,7 @@ describe('input()', function()
feed('(())')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{RBP1:(}{RBP2:()}{RBP1:)}^ |
]])
end)
@@ -294,9 +270,7 @@ describe('inputdialog()', function()
command('redraw!')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo}^ |
]])
end)
@@ -305,17 +279,13 @@ describe('inputdialog()', function()
feed([[:call inputdialog(1, 2)<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}2^ |
]])
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}^ |
]])
end)
@@ -325,25 +295,19 @@ describe('inputdialog()', function()
feed([[:echo input(opts)<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}2^ |
]])
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:1}^ |
]])
feed('<Esc>')
screen:expect([[
^ |
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:3} |
]])
end)
@@ -353,33 +317,25 @@ describe('inputdialog()', function()
feed([[:echo input(opts)<CR>]])
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Bar^ |
]])
command('mode')
screen:expect{grid=[[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Bar^ |
]], reset=true}
feed('<BS>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Ba^ |
]])
command('mode')
screen:expect{grid=[[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{T:Foo>}Ba^ |
]], reset=true}
end)
@@ -388,9 +344,7 @@ describe('inputdialog()', function()
feed(':echo inputdialog({})<CR>')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
^ |
]])
end)
@@ -441,9 +395,7 @@ describe('inputdialog()', function()
feed('(())')
screen:expect([[
|
- {EOB:~ }|
- {EOB:~ }|
- {EOB:~ }|
+ {EOB:~ }|*3
{RBP1:(}{RBP2:()}{RBP1:)}^ |
]])
end)
diff --git a/test/functional/vimscript/json_functions_spec.lua b/test/functional/vimscript/json_functions_spec.lua
index a9dab8431c..c12bcf5099 100644
--- a/test/functional/vimscript/json_functions_spec.lua
+++ b/test/functional/vimscript/json_functions_spec.lua
@@ -467,19 +467,18 @@ describe('json_decode() function', function()
'[1, {"d": {"b": 3, "a": 1, "c": 4, "a": 2, "c": 4}}]')
sp_decode_eq({1, {a={}, d={_TYPE='map', _VAL={{'b', 3}, {'a', 1}, {'c', 4}, {'a', 2}, {'c', 4}}}}},
'[1, {"a": [], "d": {"b": 3, "a": 1, "c": 4, "a": 2, "c": 4}}]')
- end)
-
- it('parses dictionaries with empty keys to special maps', function()
- sp_decode_eq({_TYPE='map', _VAL={{'', 4}}},
- '{"": 4}')
- sp_decode_eq({_TYPE='map', _VAL={{'b', 3}, {'a', 1}, {'c', 4}, {'d', 2}, {'', 4}}},
- '{"b": 3, "a": 1, "c": 4, "d": 2, "": 4}')
sp_decode_eq({_TYPE='map', _VAL={{'', 3}, {'a', 1}, {'c', 4}, {'d', 2}, {'', 4}}},
'{"": 3, "a": 1, "c": 4, "d": 2, "": 4}')
sp_decode_eq({{_TYPE='map', _VAL={{'', 3}, {'a', 1}, {'c', 4}, {'d', 2}, {'', 4}}}},
'[{"": 3, "a": 1, "c": 4, "d": 2, "": 4}]')
end)
+ it('parses dictionaries with empty keys', function()
+ eq({[""] = 4}, funcs.json_decode('{"": 4}'))
+ eq({b = 3, a = 1, c = 4, d = 2, [""] = 4},
+ funcs.json_decode('{"b": 3, "a": 1, "c": 4, "d": 2, "": 4}'))
+ end)
+
it('parses dictionaries with keys with NUL bytes to special maps', function()
sp_decode_eq({_TYPE='map', _VAL={{{_TYPE='string', _VAL={'a\n', 'b'}}, 4}}},
'{"a\\u0000\\nb": 4}')
@@ -577,6 +576,8 @@ describe('json_encode() function', function()
eq('{}', eval('json_encode({})'))
eq('{"d": []}', funcs.json_encode({d={}}))
eq('{"d": [], "e": []}', funcs.json_encode({d={}, e={}}))
+ -- Empty keys are allowed per JSON spec (and Vim dicts, and msgpack).
+ eq('{"": []}', funcs.json_encode({['']={}}))
end)
it('cannot dump generic mapping with generic mapping keys and values',
diff --git a/test/functional/vimscript/match_functions_spec.lua b/test/functional/vimscript/match_functions_spec.lua
index 9f168c913a..3f3205ba81 100644
--- a/test/functional/vimscript/match_functions_spec.lua
+++ b/test/functional/vimscript/match_functions_spec.lua
@@ -148,9 +148,7 @@ describe('matchaddpos()', function()
}}, funcs.getmatches())
screen:expect([[
^a{1:b}cdef |
- {2:~ }|
- {2:~ }|
- {2:~ }|
+ {2:~ }|*3
|
]], {[1] = {foreground = Screen.colors.Red}, [2] = {bold = true, foreground = Screen.colors.Blue1}})
end)
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua
index 90aab48d61..272f81d775 100644
--- a/test/functional/vimscript/system_spec.lua
+++ b/test/functional/vimscript/system_spec.lua
@@ -193,18 +193,7 @@ describe('system()', function()
feed(':call system("echo")<cr>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
:call system("echo") |
]])
end)
@@ -250,18 +239,7 @@ describe('system()', function()
or 'yes') .. '")<cr>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
]] .. (is_os('win')
and [[
:call system("for /L %I in (1,0,2) do @echo y") |]]
@@ -270,18 +248,7 @@ describe('system()', function()
feed('foo<c-c>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
Type :qa and press <Enter> to exit Nvim |
]])
end)
@@ -293,18 +260,7 @@ describe('system()', function()
or 'yes') .. '")<cr>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
]] .. (is_os('win')
and [[
:call system("for /L %I in (1,0,2) do @echo y") |]]
@@ -313,18 +269,7 @@ describe('system()', function()
feed('foo<c-c>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
-- INSERT -- |
]])
end)
@@ -477,18 +422,7 @@ describe('systemlist()', function()
feed(':call systemlist("echo")<cr>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
:call systemlist("echo") |
]])
end)
@@ -497,35 +431,13 @@ describe('systemlist()', function()
feed(':call systemlist("yes | xargs")<cr>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
:call systemlist("yes | xargs") |
]])
feed('<c-c>')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ ~ |*12
Type :qa and press <Enter> to exit Nvim |
]])
end)
diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua
index a58cd6ae7f..93d88f6338 100644
--- a/test/functional/vimscript/timer_spec.lua
+++ b/test/functional/vimscript/timer_spec.lua
@@ -133,9 +133,7 @@ describe('timers', function()
screen:expect([[
^ITEM 1 |
ITEM 2 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
nvim_async("command", "let g:cont = 1")
@@ -144,8 +142,7 @@ describe('timers', function()
^ITEM 1 |
ITEM 2 |
ITEM 3 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -155,8 +152,7 @@ describe('timers', function()
^ITEM 1 |
ITEM 2 |
ITEM 3 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]], unchanged=true}
end)
@@ -244,10 +240,7 @@ describe('timers', function()
feed(":good")
screen:expect([[
|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
+ {0:~ }|*4
:good^ |
]])
command('let g:val = 1')
diff --git a/test/helpers.lua b/test/helpers.lua
index d4ea8b27a3..0ced3ec163 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -149,9 +149,9 @@ end
--- Retries for 1 second in case of filesystem delay.
---
---@param pat (string) Lua pattern to match lines in the log file
----@param logfile (string) Full path to log file (default=$NVIM_LOG_FILE)
----@param nrlines (number) Search up to this many log lines
----@param inverse (boolean) Assert that the pattern does NOT match.
+---@param logfile? (string) Full path to log file (default=$NVIM_LOG_FILE)
+---@param nrlines? (number) Search up to this many log lines
+---@param inverse? (boolean) Assert that the pattern does NOT match.
function module.assert_log(pat, logfile, nrlines, inverse)
logfile = logfile or os.getenv('NVIM_LOG_FILE') or '.nvimlog'
assert(logfile ~= nil, 'no logfile')
@@ -376,6 +376,19 @@ function module.is_os(s)
)
end
+function module.is_arch(s)
+ local machine = luv.os_uname().machine
+ if s == 'arm64' or s == 'aarch64' then
+ return machine == 'arm64' or machine == 'aarch64'
+ end
+
+ if s == 'x86' or s == 'x86_64' or s == 'amd64' then
+ return machine == 'x86_64'
+ end
+
+ return machine == s
+end
+
local function tmpdir_get()
return os.getenv('TMPDIR') and os.getenv('TMPDIR') or os.getenv('TEMP')
end
diff --git a/test/old/testdir/runnvim.vim b/test/old/testdir/runnvim.vim
index 2db60d05b3..3ccb9988cf 100644
--- a/test/old/testdir/runnvim.vim
+++ b/test/old/testdir/runnvim.vim
@@ -7,6 +7,8 @@ function s:logger.on_exit(id, data, event)
call add(self.d_events, [a:event, ['']])
endfunction
+let s:logger.env = #{VIMRUNTIME: $VIMRUNTIME}
+
" Replace non-printable chars by special sequence, or "<%x>".
let s:escaped_char = {"\n": '\n', "\r": '\r', "\t": '\t'}
function! s:escape_non_printable(char) abort
diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim
index fd94f4a7b2..89a38bcf51 100644
--- a/test/old/testdir/test_diffmode.vim
+++ b/test/old/testdir/test_diffmode.vim
@@ -1083,18 +1083,19 @@ endfunc
func Test_diff_with_cursorline_breakindent()
CheckScreendump
- call writefile([
- \ 'hi CursorLine ctermbg=red ctermfg=white',
- \ 'set noequalalways wrap diffopt=followwrap cursorline breakindent',
- \ '50vnew',
- \ 'call setline(1, [" "," "," "," "])',
- \ 'exe "norm 20Afoo\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abar\<Esc>"',
- \ 'vnew',
- \ 'call setline(1, [" "," "," "," "])',
- \ 'exe "norm 20Abee\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abaz\<Esc>"',
- \ 'windo diffthis',
- \ '2wincmd w',
- \ ], 'Xtest_diff_cursorline_breakindent', 'D')
+ let lines =<< trim END
+ hi CursorLine ctermbg=red ctermfg=white
+ set noequalalways wrap diffopt=followwrap cursorline breakindent
+ 50vnew
+ call setline(1, [' ', ' ', ' ', ' '])
+ exe "norm! 20Afoo\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abar\<Esc>"
+ vnew
+ call setline(1, [' ', ' ', ' ', ' '])
+ exe "norm! 20Abee\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abaz\<Esc>"
+ windo diffthis
+ 2wincmd w
+ END
+ call writefile(lines, 'Xtest_diff_cursorline_breakindent', 'D')
let buf = RunVimInTerminal('-S Xtest_diff_cursorline_breakindent', {})
call term_sendkeys(buf, "gg0")
@@ -1110,11 +1111,30 @@ func Test_diff_with_cursorline_breakindent()
call StopVimInTerminal(buf)
endfunc
+func Test_diff_breakindent_after_filler()
+ CheckScreendump
+
+ let lines =<< trim END
+ set laststatus=0 diffopt+=followwrap breakindent
+ call setline(1, ['a', ' ' .. repeat('c', 50)])
+ vnew
+ call setline(1, ['a', 'b', ' ' .. repeat('c', 50)])
+ windo diffthis
+ norm! G$
+ END
+ call writefile(lines, 'Xtest_diff_breakindent_after_filler', 'D')
+ let buf = RunVimInTerminal('-S Xtest_diff_breakindent_after_filler', #{rows: 8, cols: 45})
+ call VerifyScreenDump(buf, 'Test_diff_breakindent_after_filler', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_diff_with_syntax()
CheckScreendump
let lines =<< trim END
- void doNothing() {
+ void doNothing() {
int x = 0;
char *s = "hello";
return 5;
@@ -1122,7 +1142,7 @@ func Test_diff_with_syntax()
END
call writefile(lines, 'Xprogram1.c', 'D')
let lines =<< trim END
- void doSomething() {
+ void doSomething() {
int x = 0;
char *s = "there";
return 5;
@@ -1131,7 +1151,7 @@ func Test_diff_with_syntax()
call writefile(lines, 'Xprogram2.c', 'D')
let lines =<< trim END
- edit Xprogram1.c
+ edit Xprogram1.c
diffsplit Xprogram2.c
END
call writefile(lines, 'Xtest_diff_syntax', 'D')
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim
index fef7c6a9bc..33b8d55982 100644
--- a/test/old/testdir/test_listdict.vim
+++ b/test/old/testdir/test_listdict.vim
@@ -456,6 +456,25 @@ func Test_dict_func_remove()
call CheckLegacyAndVim9Failure(lines, 'E716:')
let lines =<< trim END
+ let d = {'a-b': 55}
+ echo d.a-b
+ END
+ call CheckScriptFailure(lines, 'E716: Key not present in Dictionary: "a"')
+
+ let lines =<< trim END
+ vim9script
+ var d = {'a-b': 55}
+ echo d.a-b
+ END
+ call CheckScriptFailure(lines, 'E716: Key not present in Dictionary: "a"')
+
+ let lines =<< trim END
+ var d = {'a-b': 55}
+ echo d.a-b
+ END
+ call CheckDefFailure(lines, 'E1004: White space required before and after ''-''')
+
+ let lines =<< trim END
let d = {1: 'a', 3: 'c'}
call remove(d, [])
END
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim
index d69828dc2e..2bba86fe99 100644
--- a/test/old/testdir/test_options.vim
+++ b/test/old/testdir/test_options.vim
@@ -950,8 +950,10 @@ endfunc
func Test_set_one_column()
let out_mult = execute('set all')->split("\n")
let out_one = execute('set! all')->split("\n")
- " one column should be two to four times as many lines
- call assert_inrange(len(out_mult) * 2, len(out_mult) * 4, len(out_one))
+ call assert_true(len(out_mult) < len(out_one))
+ call assert_equal(out_one[0], '--- Options ---')
+ let options = out_one[1:]->mapnew({_, line -> line[2:]})
+ call assert_equal(sort(copy(options)), options)
endfunc
func Test_set_values()
diff --git a/test/unit/formatc.lua b/test/unit/formatc.lua
index 6bb58c68c3..ce9cb81f4a 100644
--- a/test/unit/formatc.lua
+++ b/test/unit/formatc.lua
@@ -209,7 +209,7 @@ local C_keywords = set { -- luacheck: ignore
-- Very primitive C formatter that tries to put "things" inside braces on one
-- line. This is a step done after preprocessing the C source to ensure that
--- the duplicate line detecter can more reliably pick out identical declarations.
+-- the duplicate line detector can more reliably pick out identical declarations.
--
-- an example:
-- struct mystruct
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index 0bd6b85570..e56f8d5058 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -212,7 +212,7 @@ local function cimport(...)
-- give each #pragma pack an unique id, so that they don't get removed
-- if they are inserted into the set
-- (they are needed in the right order with the struct definitions,
- -- otherwise luajit has wrong memory layouts for the sturcts)
+ -- otherwise luajit has wrong memory layouts for the structs)
if line:match('#pragma%s+pack') then
--- @type string
line = line .. ' // ' .. pragma_pack_id
@@ -800,7 +800,12 @@ local function cppimport(path)
return cimport(Paths.test_source_path .. '/test/includes/pre/' .. path)
end
-cimport('./src/nvim/types.h', './src/nvim/main.h', './src/nvim/os/time.h', './src/nvim/os/fs.h')
+cimport(
+ './src/nvim/types_defs.h',
+ './src/nvim/main.h',
+ './src/nvim/os/time.h',
+ './src/nvim/os/fs.h'
+)
local function conv_enum(etab, eval)
local n = tonumber(eval)
diff --git a/test/unit/statusline_spec.lua b/test/unit/statusline_spec.lua
index c8dc4f84e3..ffcfec18ef 100644
--- a/test/unit/statusline_spec.lua
+++ b/test/unit/statusline_spec.lua
@@ -33,7 +33,7 @@ describe('build_stl_str_hl', function()
output_buffer,
buffer_byte_size,
to_cstr(pat),
- NULL,
+ -1,
0,
fillchar,
maximum_cell_count,