aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/wildmode_spec.lua
Commit message (Collapse)AuthorAge
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
* refactor(tests): again yet more global highlight definitionsbfredl2024-08-14
|
* fix(highlight): add `StatusLineTerm`/`StatusLineTermNC` to `:color vim` (#29313)Evgeni Chasnovski2024-06-14
| | | | | | | | | | | | | | | Problem: both `StatusLineTerm`/`StatusLineTermNC` are now explicitly used, but `:color vim` does not set them to the values used in Vim. This might be fine if `:color vim` is treated as "the state of default color scheme prior the big update", but it seems to be better treated as "Vim's default color scheme" (how it is documented in its header). Solution: add `StatusLineTerm`/`StatusLineTermNC` definitions to 'runtime/colors/vim.lua'. Use explicit foreground colors ('Whte'/'Black') instead of `guifg=bg` used in source, as the latter caused some problems in the past (if `Normal` is not defined, `nvim_set_hl()` can't recognize `'bg'` as the foreground value). Also realign the rest of the background conditional highlight groups.
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* refactor(tests): all screen tests should use highlightsbfredl2024-03-23
| | | | | | | | | | | | | | | | | | | | | | | This is the first installment of a multi-PR series significantly refactoring how highlights are being specified. The end goal is to have a base set of 20 ish most common highlights, and then specific files only need to add more groups to that as needed. As a complicating factor, we also want to migrate to the new default color scheme eventually. But by sharing a base set, that future PR will hopefully be a lot smaller since a lot of tests will be migrated just simply by updating the base set in place. As a first step, fix the anti-pattern than Screen defaults to ignoring highlights. Highlights are integral part of the screen state, not something "extra" which we only test "sometimes". For now, we still allow opt-out via the intentionally ugly screen._default_attr_ids = nil The end goal is to get rid of all of these eventually (which will be easier as part of the color scheme migration)
* test: don't use minimal timeout for "intermediate" flag (#27620)zeertzjq2024-02-25
| | | | | | With "intermediate" flag, only using minimal timeout is too short and may lead to failures. Also remove the fallback timeout in screen:expect_unchanged(), as having a different fallback timeout than screen:expect() is confusing.
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: typing for helpers.methsLewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
| | | | | | This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
* vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security] use-after-free with wildmenu Solution: properly clean up the wildmenu when exiting Fix wildchar/wildmenu/pum memory corruption with special wildchar's Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a memory corruption if using wildmenu+pum, or wrong states if only using wildmenu. This is due to the code only using one single place inside the cmdline process loop to perform wild menu clean up (by checking `end_wildmenu`) but there are other odd situations where the loop could have exited and we need a post-loop clean up just to be sure. If the clean up was not done you would have a stale popup menu referring to invalid memory, or if not using popup menu, incorrect status line (if `laststatus=0`). For example, if you hit `<Esc>` two times when it's wildchar, there's a hard-coded behavior to exit command-line as a failsafe for user, and if you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean up code would not have hit because of specialized `<C-\>` handling. Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also used for 'wildchar'/'wildcharm'. Currently they don't behave properly, and also have potentially memory unsafe behavior as the logic is currently not accounting for this situation and try to do both. (Previous patch that addressed this: vim/vim#11677) Also, correctly document Escape key behavior (double-hit it to escape) in wildchar docs as it's previously undocumented. In addition, block known invalid chars to be set in `wildchar` option, such as Ctrl-C and `<CR>`. This is just to make it clear to the user they shouldn't be set, and is not required for this bug fix. closes: vim/vim#13361 https://github.com/vim/vim/commit/8f4fb007e4d472b09ff6bed9ffa485e0c3093699 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* test: simplify platform detection (#21020)dundargoc2022-11-22
| | | | | Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`.
* feat(messages)!: graduate the 'msgsep' featurebfredl2022-10-05
| | | | | | | The old behaviour (e.g. via `set display-=msgsep`) will not be available. Assuming that messages always are being drawn on msg_grid (or not drawn at all, and forwarded to `ext_messages` enabled UI) will allows some simplifcations and enhancements moving forward.
* fix(cmdline): do not trigger completion at wrong time (#19920)zeertzjq2022-08-24
| | | Cherry-picked from Vim patches 8.2.4339, 9.0.0238.
* refactor(tests): introduce testprg()Justin M. Keyes2022-06-25
| | | | | | Also: - Add a describe('shell :!') section to system_spec. - Make the test for #16271 work on systems without powershell.
* Merge pull request #13428 from janlazo/nvim-8.0.1525Jan Edmund Lazo2020-12-01
|\ | | | | vim-patch:8.0.{858,953,1525}
| * test/wildmode_spec: override $PS1Jan Edmund Lazo2020-12-01
| | | | | | | | | | User config may set $PS1 for a colored prompt. It breaks the screen tests.
* | ex_getln: add secret charmBjörn Linse2020-12-01
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in to this secret world using set wildchar=0 " already the default, but remove if non-zero existing config: set wildcharm=0 now you can map 'wildmode' just like any mode: cnoremap <tab> <c-z> function! Spacey() return getcmdline()[-1:] == "/" ? "\<bs>" : "" endfunc cnoremap <expr> / wildmenumode() ? Spacey()."/<c-z>" : "/" Possibly asked questions: What about backwards compatibility? ==== Just do nothing and your existing 'wildchar' and 'wildcharm' will keep working. Doesn't `<c-z>` mean suspend? ==== Not in cmdline mode. If it would then the recommended wildcharm would not have been `<c-z>` to start with. My config relies on `:<c-z>` being a synonym to `:<nop>`! ==== just no.
* Merge pull request #11746 from Billy4195/add_wildmenu_keyMatthieu Coudron2020-03-28
|\ | | | | [RFC] Wildmenu support C-E and C-Y as popupmenu
| * ex_getln.c: wildmenu add cancel and apply opsBilly Su2020-01-23
| |
* | wildmode: fix wildmode=longest,full with pum #11690akovaski2020-01-21
|/ | | | | | With "wildmode=longest,full" + wildoptions=pum, wildmode should show popupmenu after Tab-Tab, not the horizontal wildmenu. Fixes #11622
* fixup! test/wildmode_spec: fix flaky testJustin M. Keyes2019-09-04
|
* test/wildmode_spec: fix flaky testJustin M. Keyes2019-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | a00eb23c27da fixed one race, but not this one: [ ERROR ] test/functional/ui/wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity test/functional/ui/screen.lua:587: Row 1 did not match. Expected: |* | | | | | |define jump list > | |:sign define^ | Actual: |*0: !terminal_output! | | | | | |define jump list > | |:sign define^ | 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. stack traceback: test/functional/ui/screen.lua:587: in function '_wait' test/functional/ui/screen.lua:370: in function 'expect' test/functional/ui/wildmode_spec.lua:22: in function 'expect_stay_unchanged' test/functional/ui/wildmode_spec.lua:92: in function <test/functional/ui/wildmode_spec.lua:84>
* test/wildmode_spec: fix flaky testJustin M. Keyes2019-09-03
| | | | | | | | | | | | | | | | | | | | | | [ ERROR ] test/functional\ui\wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity test\functional\ui\screen.lua:587: Row 1 did not match. Expected: |*:sign | |*define place | |*jump undefine | |*list unplace | |*:sign ^ | Actual: |*0: !terminal | |* | |*^ | |*~ | |* | stack traceback: test\functional\ui\screen.lua:587: in function '_wait' test\functional\ui\screen.lua:370: in function 'expect' test/functional\ui\wildmode_spec.lua:22: in function 'expect_stay_unchanged' test/functional\ui\wildmode_spec.lua:103: in function <test/functional\ui\wildmode_spec.lua:84>
* test: use shell-test (avoid system shell)Justin M. Keyes2019-09-01
|
* test: don't detach screen just to change the sizeBjörn Linse2019-06-03
|
* Add testJit Yao Yap2019-06-03
|
* test: avoid some boilerplateJustin M. Keyes2019-06-03
|
* [RDY] Fix wildmode=list,full and display+=msgsep interaction (#10103)Jit2019-06-02
| | | | * Fix wildmode=list and display+=msgsep interaction * Add test to check ext_messages behaviour is unchanged
* test: remove use of require('test.helpers')Justin M. Keyes2019-05-18
| | | | | | The test.functional.helpers and test.unit.helpers modules now include all of the public functions from test.helpers, so there is no need to separately require('test.helpers').
* ui/terminal: make terminal state redraw like any other stateBjörn Linse2019-05-14
| | | | | | | | | | | | | | | | | | | Previously, ordinary redraws were missing from terminal mode. Instead, there was an async callback that invoked update_screen() on terminal data regardless of mode (as if :redraw! was invoked by a timer). This created some issues: - async changes to an unrelated ordinary buffer were not always redrawn in terminal mode - screen cursor position was not properly updated in terminal mode (partial fix, will be properly fixed in a follow up PR) - ad-hoc logic was needed for interaction with special states such as inccommand or horizontal wildmenu. Instead redraw terminal mode just like any other state. This disables forced redraws in cmdline mode, which were inconisent which async changes to normal buffers (which are not redrawn in cmdline mode).
* Merge #9686 'win/Lua: monkey-patch os.getenv()'Justin M. Keyes2019-03-16
|\ | | | | | | fixes #9681
| * Fix environment variable on Windowserw72019-03-06
|/ | | | | | | Since uv_os_setenv uses SetEnvironmentVariableW, _wenviron is no updated. As a result, inconsistency occurs in completion of environment variable names. Change to use GetEnvironmentStaringsW instead of _wenviron to solve it.
* test: multibyte env var names #9655Justin M. Keyes2019-03-03
|
* multigrid: add multigrid screen testsUtkarsh Maheshwari2018-12-31
|
* tests: improve robustness of immediate successes in screen testsBjörn Linse2018-10-15
|
* tests: introduce screen:expect{...} formBjörn Linse2018-08-27
|
* wildmenu: close before redrawing statusline (#8453)Alexander Karle2018-06-02
| | | Fixes #8385
* test: win: emulate yes with for loopJan Edmund Lazo2018-02-19
|
* test: win: enable ui/wildmode_spec.luaJan Edmund Lazo2018-02-19
|
* Merge #7454 'ui: ext_wildmenu'Justin M. Keyes2017-10-31
|\ | | | | | | | | closes #6168 ref #5686
| * ui: allow external ui to draw wildmenuDongdong Zhou2017-10-29
|/ | | | | Co-authored-by: Björn Linse <bjorn.linse@gmail.com> Updated docs and tests.
* input: skip dialogs if no UI is activeJustin M. Keyes2017-08-06
| | | | | | | Treat dialogs in the same way as "silent mode" (`nvim -es`). References #1984 References #3901
* clint: allow starting brace after `enum`Justin M. Keyes2017-08-06
|
* terminal: block redraw during c_CTRL-DJustin M. Keyes2017-08-05
| | | | | | | | Unlike the normal wildmenu, the CTRL-D wild-list is not restored by statusline redraw. (Semantics: ^D is controlled by 'wildoptions' option, so it's in the "wild..." family.) TODO: externalize the c_CTRL-D wild-list.
* win_redr_status(): skip if wildmenu is showingJustin M. Keyes2017-08-05
| | | | | | | | | | | | This might be too coarse, but it passes all tests ... A more nuanced approach might be: only skip the windows whose statuslines are overwritten by the wildmenu. Closes #2255 Closes #7108 vim-patch:8.0.0710 N/A because of the changes in this commit.
* Use vim_strchr(s, c) when c may be NUL (#6656)James McCoy2017-05-03
| | | | | | | | | | | As part of the refactoring in #5119, some vim_strchr() were changed to strchr(). However, vim_strchr() behaves differently than strchr() when c is NUL, returning NULL instead of a pointer to the NUL. Revert the strchr() calls where it isn't known whether c is NUL, since this causes a semantic change the surrounding code doesn't expect. In the case of #6650, this led to a heap overrun. Closes #6650