aboutsummaryrefslogtreecommitdiff
path: root/test/functional/autocmd
Commit message (Collapse)AuthorAge
* feat: add autocommand event when search wraps around (#8487)Alejandro Exojo2021-12-10
|
* feat: trigger ModeChanged for terminal modesMagnus Groß2021-11-18
|
* test(dirchanged): add tests for DirChanged pattern "auto"zeertzjq2021-10-17
|
* refactor(dirchanged): tab -> tabpagezeertzjq2021-10-17
| | | | Match Vim's behavior.
* vim-patch:8.1.0604: autocommand test fails on MS-Windowszeertzjq2021-10-17
| | | | | | Problem: Autocommand test fails on MS-Windows. Solution: Use pathcmp() instead of strcmp() to check if a directory differs. https://github.com/vim/vim/commit/9eb76af451ddd8eaad0cd5dd629f18c4f4035171
* vim-patch:8.1.0602: DirChanged is also triggered when directory didn't changezeertzjq2021-10-17
| | | | | | | Problem: DirChanged is also triggered when the directory didn't change. (Daniel Hahler) Solution: Compare the current with the new directory. (closes vim/vim#3697) https://github.com/vim/vim/commit/2caad3fbbdbf1486a176c9f6bfbc3d9be90e09f7
* refactor(tests): remove redir_exec #15718Justin M. Keyes2021-09-19
| | | | | | | | | | | Problem - `redir_exec` is obsolete, but it keeps getting used in new tests because people copy existing tests. - Disadvantages of `redir_exec`: - Captures extra junk before the actual error/message that we _want_ to test. - Does not fail on error, unlike e.g. `command()`. Solution - Use new functions like `nvim_exec` and `pcall_err`.
* test: reorg #15698Justin M. Keyes2021-09-17
| | | | | | | | | | | | | | | | | | | | Problem: Subdirectories like "visual", "insert", "normal" encourage people to separate *related* tests for no good reason. Typically the _mode_ is not the relevant topic of a test (and when it is, _then_ create an appropriate describe() or it()). Solution: - Delete the various `test/functional/<mode>/` subdirectories, move their tests to more meaningful topics. - Rename `…/normal/` to `…/editor/`. - Move or merge `…/visual/*` and `…/insert/*` tests into here where appropriate. - Rename `…/eval/` to `…/vimscript/`. - Move `…/viml/*` into here also. * test(reorg): insert/* => editor/mode_insert_spec.lua * test(reorg): cmdline/* => editor/mode_cmdline_spec.lua * test(reorg): eval core tests => eval_spec.lua
* feat(terminal): TermClose: set exit code in v:event.status #15406Gregory Anders2021-08-20
| | | Closes #4713
* Fix `<afile>` getting prepended with a slash on WinClosed (#14515)Ghjuvan Lacambre2021-06-26
| | | | | | It is wrong to assume that you can't shorten a path if it's in `/`: you can always shorten it by removing the forward slash. Closes #14512
* Merge pull request #13205 from romgrk/add-bufmodified-autocmdBjörn Linse2020-11-09
|\ | | | | Implement BufModifiedSet autocmd
| * test: update BufModifiedSet to be paranoidRom Grk2020-11-09
| |
| * test: fix BufModifiedSetRom Grk2020-11-07
| |
| * tests: add functional test for BufModifiedSetRom Grk2020-11-07
| |
* | Add v:event flag on DirChanged signaling switching window (#13153)Andrea Cedraro2020-11-07
|/ | | Closes #9909
* my fight with the linter (tome II)Rom Grk2020-11-06
|
* tests: separate scroll test for horizontal/vertical scrollRom Grk2020-10-31
|
* tests: make scroll tests passRom Grk2020-10-30
|
* tests: add functional test for WinScrolledRom Grk2020-10-28
|
* tests: add test for Scroll autocmdRom Grk2020-10-24
|
* Add v:event.visual during `TextYankPost` (#12382)Christian Clason2020-06-03
| | | | | | | | | * propagate visual selection to textyankpost event * adapt tests * add docs * also adapt oldtest
* tabpage: "tabnext #" switches to previous tab #11734butwerenotthereyet2020-01-20
|
* Merge #11735 ':tabs : show # for previous tabpage'Justin M. Keyes2020-01-19
|\
| * tabpage: :tabs indicates previous tabpage's curwinWe're Yet2020-01-19
| |
* | WinClosed: sort auevents.lua; improve testsJustin M. Keyes2020-01-18
| | | | | | | | | | - test: reduce verbosity, condense redundancy, improve readability - auevents.lua: keep events sorted by name. ref afd1d412fa91
* | autocmd: WinClosed exposes window id as <afile>notomo2020-01-18
| |
* | autocmd: add WinClosed eventMarcos ALMEIDA2020-01-18
|/ | | | | | - only fire once, just before freeing mem - trigger when on a different buffer - avoid recursive calls in another tab
* API: include invalid buffer/window/tabpage in error message (#11712)Daniel Hahler2020-01-14
|
* tabpage: disallow go-to-previous in cmdline-win #11692butwerenotthereyet2020-01-09
| | | | | | | | | | | | | | After cbc8d72fde4b19176028490934ff7a447afe523c when editing the command in the command editing window (q:, q/, q?) it was possible to switch to the previous tab. Doing so put Nvim in a bad state. Moreover, switching tabs via the other available mechanisms (gt, gT, <C-W>gt, <C-W>gT) is not possible when in the command editing window. Here, the behavior is prevented. It is no longer possible to switch to the previous tab when editing the command in the command editing window. The solution is to share code between gt, gT, and g<Tab>. Specifically, goto_tabpage_lastused now calls through goto_tabpage rather than directly calling goto_tabpage_tp. Doing so works well because all the validation enjoyed by gt and gT is present in goto_tabpage.
* tabpage: track last-used tabpage #11626butwerenotthereyet2020-01-02
| | | | | | | | | In a multi-window scenario, it is possible to return focus to the last accessed window via n_CTRL-W_p. However, in the case of a multi-tab scenario, there was previously no way to return focus to the last accessed *tab*. Here, that ability is added via n_g<tab>. Additionally, the index of the previous tab is exposed via tabpagenr('#'), mirroring the existing functionality of winnr('#').
* API: deprecate nvim_command_outputJustin M. Keyes2019-12-02
|
* doc: fix typosBrian Wignall2019-11-27
| | | | close #11459
* autocmds: TermEnter, TermLeave #8550Usama Hameed2019-09-14
| | | fix #8428
* test: Rename meth_pcall to pcall_errJustin M. Keyes2019-09-06
| | | | | | | - Rename `meth_pcall`. - Make `pcall_err` raise an error if the function does not fail. - Add `vim.pesc()` to treat a string as literal where a Lua pattern is expected.
* tests: use runtime from build for doc/tags with :help (#10479)Daniel Hahler2019-08-28
| | | | | | | | | | | | This is better practice in general, and allows to remove the "helptags ALL" hacks. Ref: https://github.com/neovim/neovim/issues/8824 Ref: https://github.com/neovim/neovim/commit/f1b67c3453c * Makefile: fix dependencies with regard to helptags - use the file as the main target to avoid unnecessary triggering - use "make oldtest" on Travis to ensure it gets built
* tests: fix flaky "TermClose … fast-exiting terminal job stops"Justin M. Keyes2019-08-05
| | | | | | | | | | | | | | This extra retry() was removed (at my suggestion) in 5b94a2977a22, but it is probably needed: jobwait(…, timeout=0) could return while channel_process_exit_cb() is still queued (so TermClose event didn't fire yet). 20:46:21,288 INFO - not ok 547 - TermClose event triggers when fast-exiting terminal job stops 20:46:21,288 INFO - # test/functional/autocmd/termclose_spec.lua @ 20 20:46:21,288 INFO - # Failure message: ./test/functional/helpers.lua:98: Vim:E121: Undefined variable: g:test_termclose 20:46:21,288 INFO - # stack traceback: 20:46:21,288 INFO - # ./test/functional/helpers.lua:98: in function 'eval' 20:46:21,288 INFO - # test/functional/autocmd/termclose_spec.lua:25: in function <test/functional/autocmd/termclose_spec.lua:20>
* :doautocmd : Never show "No matching autocommands" #10689Justin M. Keyes2019-08-05
| | | | | | | | The message is useless, it doesn't even mention the event name. vim_dev discussion: https://groups.google.com/forum/#!msg/vim_dev/RTbq58TMq9w/Xr4rSoUTCgAJ ref: https://github.com/vim/vim/issues/4300
* TextYankPost: spurious/too-early dispatch during delete #10392Jit2019-07-29
| | | | | | Problem: delete-with-register dispatches TextYankPost before updating yank registers Solution: Add flag to op_yank(). Fixes #10225
* Fix missing CursorHoldI events (#3758)Daniel Hahler2019-07-16
| | | Fixes https://github.com/neovim/neovim/issues/3757.
* tests: fix flaky "TermClose event triggers when fast-exiting terminal job ↵Daniel Hahler2019-07-02
| | | | | | | | | | | stops" (#10377) [ ERROR ]...neovim/neovim/test/functional/autocmd/termclose_spec.lua @ TermClose event triggers when fast-exiting terminal job stops test/functional/helpers.lua:96: Vim(call):E900: Invalid channel id stack traceback: test/functional/helpers.lua:96: in function 'request' test/functional/helpers.lua:254: in function 'command' ...neovim/neovim/test/functional/autocmd/termclose_spec.lua:23: in function <...neovim/neovim/test/functional/autocmd/termclose_spec.lua:20>
* messages: use proper multiline error message for rpcrequest and API wrappersBjörn Linse2019-05-26
|
* refactor: introduce XFREE_CLEAR()Justin M. Keyes2019-05-25
| | | | | | | | | | | | | | | Unfortunately we cannot indiscriminately replace xfree() with XFREE_CLEAR(), because comparing pointers after freeing them is a common pattern. Example in `tv_list_remove_items()`: xfree(li); if (li == item2) { break; } Instead we can do it selectively/explicitly. ref #1375
* autocmd: fixes and tests for autocmd window issuesBjörn Linse2019-05-13
| | | | | | - redraw! in an invisible buffer rendered the screen unusable. - storing the autocmd window handle and using it in API function could lead to crashes. Unregister the handle when the window is not active.
* cursormoved: add tests for CursorMovedMarco Hinz2019-03-29
|
* autocmd: do not show empty section after ++once handlers expireJustin M. Keyes2019-03-14
| | | | | | | Problem: If autocmd pattern only contained `++once` handlers, and all of them completed, then there would be an empty group displayed by `:autocmd Foo`. Solution: Delete the pattern if all of its commands were deleted.
* autocmd: rename: "++nested", "++once"Justin M. Keyes2019-03-14
| | | | | Based on feedback from upstream: https://github.com/vim/vim/pull/4100
* TextYankPost: add v:event["inclusive"] #9717Justin M. Keyes2019-03-13
|
* autocmd: rename "once" => "-once" #9713Justin M. Keyes2019-03-11
| | | | | | | - Rename "nested" to "-nested", but continue to support "nested" for backwards-compatibility. - Allow any order: "-once -nested" or "-nested -once". ref https://github.com/neovim/neovim/pull/9706#issuecomment-471295747
* autocmd: introduce "once" featureJustin M. Keyes2019-03-10
| | | | | | | | | | | | | | | | Adds a new feature to :autocmd which sets the handler to be executed at most one times. Before: augroup FooGroup autocmd! autocmd FileType foo call Foo() | autocmd! FooGroup * <buffer> augroup END After: autocmd FileType foo once call Foo()
* events: add "Signal" event #9564Marco Hinz2019-02-04
| | | | | ..which gets triggered when SIGUSR1 is sent to the nvim process. Closes #9562