aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/tui_spec.lua
Commit message (Collapse)AuthorAge
...
* test(tui_spec): don't use nested terminal for resize at startup (#21583)zeertzjq2022-12-29
|
* 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")`.
* test: use isCI to simplify CI detection (#21134)dundargoc2022-11-20
|
* test: fix failing tui_spec.lua tests (#21117)Jakub Łuczyński2022-11-19
| | | | | | | * refactor(test): use exec_lua * fix(test): fix failing tui_spec tests test is failing when path of tty-test does not fit cmdline
* test: introduce skip() #21010dundargoc2022-11-13
| | | | | | | This is essentially a convenience wrapper around the `pending()` function, similar to `skip_fragile()` but more general-purpose. Also remove `pending_win32` function as it can be replaced by `skip(iswin())`.
* feat(pum): pretend 'mousemoveevent' is set when showing right-click menuzeertzjq2022-09-04
|
* feat(tui): recognize sidescroll events (#19992)zeertzjq2022-08-30
| | | | | | Ref https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons This works in xterm and kitty. CSI < 66 ; x ; y M sequence is for ScrollWheelLeft. CSI < 67 ; x ; y M sequence is for ScrollWheelRight.
* feat(tui): allow grid and host to disagree on ambiguous-width chars (#19686)zeertzjq2022-08-09
| | | Note: This only applies to ambiguous-width characters.
* vim-patch:9.0.0071: command overlaps with printed text in scrollback (#19505)zeertzjq2022-07-26
| | | | | | | | | | | | | | Problem: Command overlaps with printed text in scrollback. Solution: Clear until end-of-line and use correct message chunk. (closes vim/vim#10765, closes vim/vim#10764) https://github.com/vim/vim/commit/ecdc82e74e6a7e73d9067ece1d5eac33abfde5ed N/A patches for version.c: vim-patch:9.0.0070: using utfc_ptr2char_len() when length is negative Problem: Using utfc_ptr2char_len() when length is negative. Solution: Check value of length. (closes vim/vim#10760) https://github.com/vim/vim/commit/4dc513a22c017b3061287deac74fa55f70a3214c
* test: improve some input testszeertzjq2022-07-25
|
* Merge pull request #19180 from zeertzjq/tui-kitty-keypadzeertzjq2022-07-07
|\ | | | | feat(tui): recognize keypad keys when using kitty keyboard protocol
| * test: add tests for keypad keys from kitty keyboard protocolzeertzjq2022-07-04
| |
* | fix(tui): resize at startup #17795Javier Lopez2022-07-04
|/ | | | | | | | | | | | | | | | | | * fix(test): screen.lua nil index When actual_rows and expected_rows are different avoid a nil index. * fix(tui): resize at startup The deleted code is not needed after 402b4e8. It caused the condition to false positive when the function was called more than once before startup (first normal mode). Being itself what set the dimension and not the user, locking the size of the screen to an incorrect size. Make got_winch an int to mitigate: tui_grid_resize changing the size of the host terminal between the signal handler and the call to sigwinch_cb. Since the actual signal handler uv__signal_handle doesn't directly call the callback, the event loop does. Fixes #17285 Fixes #15044 Fixes #11330
* 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.
* fix(tui)!: remove `ESC NUL` forced escape (#17198)zeertzjq2022-04-11
| | | | | | | | | | This make Nvim recognize `ESC NUL` as <M-C-Space>, as many terminal emulators (including libvterm) send <M-C-Space> as `ESC NUL`. There is already another unambiguous way to encode a `ESC` key supported by libtermkey: `ESC [ 2 7 u`, which is a `CSI u` sequence. If one still wants to use `ESC NUL` as `ESC`, they can just map <M-C-Space> to <Esc>.
* fix(paste): don't move cursor past the end of pasted text in Normal modezeertzjq2022-03-15
|
* test: make some tests more stable (#16860)zeertzjq2022-01-01
|
* perf: pre-compile embedded Lua source into bytecode (#16631)Gregory Anders2021-12-16
| | | | | | The Lua modules that make up vim.lua are embedded as raw source files into the nvim binary. These sources are loaded by the Lua runtime on startuptime. We can pre-compile these sources into Lua bytecode before embedding them into the binary, which minimizes the size of the binary and improves startuptime.
* test: expect the correct screen in TUI paste: big burst of input (#16656)zeertzjq2021-12-15
|
* fix(tui): end streamed paste correctly when key buffer is emptyzeertzjq2021-12-10
|
* feat(lua): enable stack traces in error output (#16228)Gregory Anders2021-11-06
|
* refactor(tests): use assert_alive() #15546Justin M. Keyes2021-09-01
|
* tests: Take into account magic hyphen. (#13518)Edwin Pujols2020-12-11
| | | | | | | | | | | | | In Lua patterns the hyphen works like a non-greedy version of Vim's `*`. - Use `%-` when you need a literal hyphen. - If you don't need a regular expression at all, use something like ``` string.find(text, pattern, 1, true) ``` so that the pattern is regarded as a plain, non-magical string. See [1] and [2] in the Lua manual. [1]: https://www.lua.org/manual/5.1/manual.html#pdf-Patterns [2]: https://www.lua.org/manual/5.1/manual.html#pdf-string.find
* test: add functional test for segmented response from terminalerw72020-11-20
|
* GHA: Skip tests that fail due to actions/runner#241James McCoy2020-11-13
|
* tests/terminal/tui: wait 1ms to avoid data race in FreeBSDJan Edmund Lazo2020-08-02
|
* edit.c: Ensure undo sync when emulating <Esc>x #11706Matthew Malcomson2020-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After PR #8226 an unmapped META key in insert mode behaves like ESC-<key> (:help i_META). The behaviour does not fully match, since if <Esc>-<key> is pressed manually then since it were pressed manually `gotchars` would be called on the second <key> after insert-mode had already been left. This would mean that `may_sync_undo` (called from `gotchars`) would call `u_sync(FALSE)` on the second key (since we would be in normal mode). This overall means that <Meta-[something]> behaves differently with respect to undo than <Esc>[something] when the [something] makes a change. As an example, under `nvim -u NONE`: ihello<M-.>u leaves the buffer empty, while ihello<Esc>.u leaves the buffer with one instance of `hello`. - Fix by calling u_sync() manually in the new clause under `normalchar:` in `insert_handle_key`. - Update test in tui_spec.lua that accidentally relied on the old behaviour.
* API: rename nvim_execute_lua => nvim_exec_luaJustin M. Keyes2019-12-02
| | | | | | - We already find ourselves renaming nvim_execute_lua in tests and scripts, which suggests "exec" is the verb we actually want. - Add "exec" verb to `:help dev-api`.
* test/Screen:expect: replace "{IGNORE}" with "{MATCH:…}"Justin M. Keyes2019-11-09
| | | | ref #11004
* paste: Select-mode, Visual-mode #11360Justin M. Keyes2019-11-09
| | | fix #11344
* doc: vim.fn, vim.call(), vim.api [ci skip]Justin M. Keyes2019-11-06
|
* terminal: add tests for palette color forwardingBjörn Linse2019-11-03
|
* tests: fix non-controversial misuse of `pending` (#11247)Daniel Hahler2019-10-18
| | | Ref: https://github.com/neovim/neovim/pull/11184
* tests: tui_spec: fix waiting for terminal to be ready (#11232)Daniel Hahler2019-10-15
| | | | | The screen would have '-- TERMINAL --' already initially. Related to flakiness of "TUI FocusGained/FocusLost in terminal-mode".
* tests/ui: remove unnecessary screen:detach()Björn Linse2019-10-13
| | | | | | | | | | | | | It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically.
* tests: tui_spec: improve/merge OptionSet/deferredDaniel Hahler2019-10-04
| | | | Closes https://github.com/neovim/neovim/pull/11129.
* Fix flaky test: tui_spec: increase timeout (#11134)Daniel Hahler2019-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meant to fix: [ ERROR ] test/functional/terminal/tui_spec.lua @ 925: TUI FocusGained/FocusLost in terminal-mode test/functional/ui/screen.lua:587: Row 6 did not match. Expected: |{1:r}eady $ | |[Process exited 0] | | | | | | | |*gained | |{3:-- TERMINAL --} | Actual: |{1:r}eady $ | |[Process exited 0] | | | | | | | |*:terminal | |{3:-- TERMINAL --} | 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/terminal/tui_spec.lua:934: in function <test/functional/terminal/tui_spec.lua:925> I've thought about adding this, but it might not be really relevant, and slows down the tests a bit (and a warning "warning: Screen test succeeded immediately" with another test): ```diff diff --git i/test/functional/terminal/tui_spec.lua w/test/functional/terminal/tui_spec.lua index ada073c4e..4bc2ab4e0 100644 --- i/test/functional/terminal/tui_spec.lua +++ w/test/functional/terminal/tui_spec.lua @@ -818,6 +818,11 @@ describe('TUI FocusGained/FocusLost', function() ..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]') feed_data(":autocmd FocusGained * echo 'gained'\n") feed_data(":autocmd FocusLost * echo 'lost'\n") + -- Wait for autocommand to be registered. + retry(nil, nil, function() + feed_data(":autocmd FocusLost\n") + screen:expect{any=" echo 'lost'"} + end) feed_data("\034\016") -- CTRL-\ CTRL-N end) ```
* tui: improve handle_background_color: short-circuit (#11067)Daniel Hahler2019-09-30
| | | | | | | | * handle_background_color: short-circuit if handled already * Unit tests for handle_background_color * set waiting_for_bg_response to false in tui_terminal_after_startup By then it should have been received.
* paste: fix handling of "<" in cmdline (#11094)Daniel Hahler2019-09-25
| | | Fixes https://github.com/neovim/neovim/issues/11088.
* tui_spec: improve "TUI paste: exactly 64 bytes" (#11086)Daniel Hahler2019-09-24
| | | | | | | | | | | | | | | | | | | | | | | Doing the screen test first might give insights about a possible (flaky?) failure, where it looks like "feed_data" is processed out of order: [ ERROR ] test/functional/terminal/tui_spec.lua @ 561: TUI paste: exactly 64 bytes #10311 test/functional/helpers.lua:388: retry() attempts: 490 test/functional/terminal/tui_spec.lua:66: Expected objects to be the same. Passed in: (table: 0x44042de8) { *[1] = ' endzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' } Expected: (table: 0x41d6e568) { *[1] = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz end' } stack traceback: test/functional/helpers.lua:388: in function 'retry' test/functional/terminal/tui_spec.lua:63: in function 'expect_child_buf_lines' test/functional/terminal/tui_spec.lua:569: in function <test/functional/terminal/tui_spec.lua:561> Ref: https://github.com/neovim/neovim/pull/11083#issuecomment-534375201 Build log: https://travis-ci.org/neovim/neovim/jobs/588749739#L5597
* UIEnter/UILeave: fire for embedder UI, builtin TUIJustin M. Keyes2019-09-12
| | | | | | | | | Before this, --embed UIs (without --headless) would not trigger UIEnter. For TUI, maybe UIEnter isn't useful, but: - It is less "surprising"/special. - Makes documentation simpler. - When TUI becomes a coprocess, it will happen anyway.
* API/nvim_list_uis(): include "chan" field for TUIJustin M. Keyes2019-09-12
| | | | | Even though it's always zero currently, it's less confusing if all UIs have the same fields.
* paste: fix paste in terminal modeBjörn Linse2019-09-11
|
* terminal: fix rgb rendering of palette colorsBjörn Linse2019-09-10
| | | | | | | | | | simplify handling of default colors nvim is always true color internally, remove ui_rgb_attached() check. Fix "runtime termguicolors" test. The test actually reflected broken behavior in (parent) nvim: nvim_ui_set_option("rgb", true) was not respected by existing :terminal instances, so all 16-palette colors became dark blue.
* paste: fix normal-mode paste by different approach #10976Justin M. Keyes2019-09-09
| | | | | | | | Forcing insert-mode after the first paste-chunk seems to work, as an alternative to a9e2bae0eb69 (insert-before-cursor). NB: Dot-repeat needs to match the original action. Since a9e2bae0eb69 changed paste to insert-before-cursor, dot-repeat must also. But that makes dot-repeat unpleasant/unusual.
* paste: insert before cursor alwaysJustin M. Keyes2019-09-08
| | | | | | | | | Inserting "after" the cursor in Normal-mode, for big paste-streams, is not reliable: sometimes the text "after" the cursor ends up in the middle of the pasted text. Maybe the cursor position is not updated? To avoid weird behavior, always paste "before". Maybe nvim_put() or vim.paste() can be fixed more properly later.
* paste: do not clobber msg area for small pastesJustin M. Keyes2019-09-08
|
* paste/cmdline: discard all chunks after first lineJustin M. Keyes2019-09-08
| | | | | | Problem: If multiple paste "chunks" are streamed, chunks after the first line are pasted into the buffer. Solution: Check for cmdline-mode for all chunks in a paste-stream.
* paste: reset 'paste' option immediately #10974Justin M. Keyes2019-09-08
| | | | | | - Workaround #10966: 'paste' option is not always reset. - In any case there's not much reason to wait until phase=3, because pasting in cmdline-mode skips lines after the first line (thus the `:set paste .. :set nopaste` dance happens only ~once).
* update tests for new resize behavior (resize at pager, but not at :!cmd)Björn Linse2019-09-08
|