neovim/test/functional
notomo 0e8186bdd8
fix(lua): highlight.on_yank can close timer in twice #18976
Steps to reproduce:

1. setting `vim.highlight.on_yank`
   ```
   vim.api.nvim_create_autocmd({ "TextYankPost" }, {
     pattern = { "*" },
     callback = function()
       vim.highlight.on_yank({ timeout = 200 })
     end,
   })
   ```
2. repeat typing `yeye` ...
3. causes the following error.
   ```
   Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x01e96970 is already closing
   stack traceback:
           [C]: in function 'close'
           vim/_editor.lua: in function ''
           vim/_editor.lua: in function <vim/_editor.lua:0>
   ```

📝 Test result before fix:

    [----------] Global test environment setup.
    [----------] Running tests from test/functional/lua/highlight_spec.lua
    [ RUN      ] vim.highlight.on_yank does not show errors even if buffer is wiped before timeout: 15.07 ms OK
    [ RUN      ] vim.highlight.on_yank does not show errors even if executed between timeout and clearing highlight: 15.07 ms ERR
    test/helpers.lua:73: Expected objects to be the same.
    Passed in:
    (string) 'Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x02025260 is already closing
    stack traceback:
            [C]: in function 'close'
            vim/_editor.lua: in function ''
            vim/_editor.lua: in function <vim/_editor.lua:0>'
    Expected:
    (string) ''
2022-06-15 19:39:55 -07:00
..
api fix(tests): missing clear() #18927 2022-06-13 04:05:17 -07:00
autocmd test: add a Lua functional test for NoName buffer event order 2022-04-21 19:07:50 +08:00
core fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
editor fix(input): fix macro recording with ALT and special key (#18917) 2022-06-10 17:13:57 +08:00
ex_cmds fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
fixtures fix(lsp): fix multi client handling in code action (#18869) 2022-06-05 16:43:32 +02:00
legacy fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
lua fix(lua): highlight.on_yank can close timer in twice #18976 2022-06-15 19:39:55 -07:00
options feat: cmdheight=0 #16251 2022-06-13 02:40:51 -07:00
plugin fix(lsp): fix multi client handling in code action (#18869) 2022-06-05 16:43:32 +02:00
provider feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009 2022-05-03 06:08:35 -07:00
shada fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
terminal fix(terminal): scrollback delete lines immediately #18832 2022-06-08 17:46:57 -07:00
treesitter fix(tests): unreliable parser_spec #18911 2022-06-09 08:07:54 -07:00
ui fix(ui): do not call showmode() when setting window height (#18969) 2022-06-15 19:41:58 +08:00
vimscript fix(tests): fix some screen.lua warnings 2022-05-21 23:07:34 +02:00
example_spec.lua screen.lua: remove screen:_on_event #11488 2019-12-01 01:06:10 -08:00
helpers.lua fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
preload.lua test/functional/preload.lua: _set_fmode for Windows 2019-09-25 05:47:15 +02:00