aboutsummaryrefslogtreecommitdiff
path: root/test/functional/autocmd
Commit message (Collapse)AuthorAge
* fix(terminal): crash if TermClose deletes own buffer #19222Justin M. Keyes2022-07-05
| | | | | | | | - Partially fixes #10386 except for the case where the alternate buffer is the default, empty, first buffer created on startup. #vimlife - TODO: port patches related to `can_unload_buffer`, maybe that fully fixes #10386? vim-patch:8.0.1732: crash when terminal API call deletes the buffer
* 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.
* test: add a Lua functional test for NoName buffer event orderCharlie Groves2022-04-21
|
* vim-patch:8.1.1756: autocommand that splits window messes up window layoutzeertzjq2022-04-21
| | | | | | | | | | | Problem: Autocommand that splits window messes up window layout. Solution: Disallow splitting a window while closing one. In ":all" give an error when moving a window will not work. https://github.com/vim/vim/commit/1417c766f55e5959b31da488417b7d9b141404af Expected error number was changed to E242 in Vim in patch 8.2.1183, and patch 8.2.2420 (which has already been ported) made the test no longer throw E249 in Vim, so just use E242 in the test.
* test: unskip tests skipped in #14661zeertzjq2022-04-13
|
* vim-patch:8.2.4739: accessing freed memory after WinScrolled autocmd event ↵zeertzjq2022-04-12
| | | | | | | | (#18090) Problem: Accessing freed memory after WinScrolled autocmd event. Solution: Check the window pointer is still valid. (closes vim/vim#10156) Remove the argument from may_trigger_winscrolled(). https://github.com/vim/vim/commit/d58862d18f091d3c14fa3647e724ef7eea1ecefa
* test: properly test WinScrolled eventzeertzjq2022-04-12
|
* fix(events): make v:event readonly in more events (#18070)zeertzjq2022-04-11
| | | | | | | This makes v:event readonly in these four events: - ChanInfo - ChanOpen - RecordingLeave - TermClose
* feat(events): support SIGWINCH for Signal event #18029Loong Wang2022-04-10
| | | closes #15411
* fix(autocmd): restore autocmd showing behaviorzeertzjq2022-04-06
|
* fix(aucmd_win): always make aucmd_win the last windowzeertzjq2022-03-23
|
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* fix(aucmd_win): ensure aucmd_win stays floatingSean Dewar2022-02-23
| | | | | | | | | | | | | Nvim uses a floating window for the autocmd window, but in certain situations, it can be made non-floating (`:wincmd J`), which can cause issues due to the previous setup and cleanup logic for a non-floating aucmd_win being removed from aucmd_prepbuf and aucmd_restbuf. This can cause glitchiness and crashes due to the aucmd_win's frame being invalid after closing its tabpage, for example. Ensure aucmd_win cannot be made non-floating. The only place this happens is in win_split_ins if new_wp != NULL.
* feat(events): add DirChangedPrezeertzjq2022-02-11
| | | | | | | | | | | | | In Nvim, like DirChanged, this also triggers when switching windows. This marks Vim patch 8.2.4335 as ported. vim-patch:8.2.4335: no autocommand event triggered before changing directory Problem: No autocommand event triggered before changing directory. (Ronnie Magatti) Solution: Add DirChangedPre. (closes vim/vim#9721) https://github.com/vim/vim/commit/28e8f73ae2d90009fd62cd60f97c2643ba44de68
* vim-patch:8.2.1128: the write message mentions characters, but it's byteszeertzjq2022-02-04
| | | | | | Problem: The write message mentions characters, but it's actually bytes. Solution: Change "C" to "B" and "characters" to "bytes". https://github.com/vim/vim/commit/3f40ce78f5c178d15871bd784ed878c78f0b8a44
* feat(autocmd): populate v:event in RecordingLeave (#16828)Axel Dahlberg2022-01-04
|
* fix: update last cursor on first CursorMoved (#16698)Michael Lingelbach2021-12-18
| | | | | | | | | | | | | | | | | | | | Closes https://github.com/neovim/neovim/issues/16625 https://github.com/neovim/neovim/issues/12923 The first defined CursorMoved autocommand will immediately fire if the cursor has previously moved upon definition of the autocommand. Plugins add dummy autocommands such as: ```lua autocmd CursorMoved * execute '' ``` to avoid this behavior. Instead, when defining a new CursorHold autocommand, force update the last cursor position. See https://github.com/vim/vim/issues/2053
* feat(autocmd): add Recording autocmdsThomas Vigouroux2021-12-18
| | | | | | | | | | | | | | feat(eval): add reg_recorded() This function is used the get the last recorded register. style(Recording): rename handler to match suggestions fix(RecordingLeave): send autocommand earlier This makes the autocommand fire just before setting reg_recorded to reg_recording, this way we clearly show that we are actually just before actually quitting the recording mode.
* 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