<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/lua/highlight_spec.lua, branch tmp</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>fix(lua): highlight.on_yank can close timer in twice #18976</title>
<updated>2022-06-16T02:39:55+00:00</updated>
<author>
<name>notomo</name>
<email>notomo.motono@gmail.com</email>
</author>
<published>2022-06-16T02:39:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=0e8186bdd8699fb20ad70e28813c3603f9ff0ece'/>
<id>0e8186bdd8699fb20ad70e28813c3603f9ff0ece</id>
<content type='text'>
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 &lt;vim/_editor.lua:0&gt;
   ```

📝 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 &lt;vim/_editor.lua:0&gt;'
    Expected:
    (string) ''</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;vim/_editor.lua:0&gt;
   ```

📝 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 &lt;vim/_editor.lua:0&gt;'
    Expected:
    (string) ''</pre>
</div>
</content>
</entry>
<entry>
<title>tests(lua/on_yank): assert conditions that fail correctly #15495</title>
<updated>2021-08-27T11:54:01+00:00</updated>
<author>
<name>notomo</name>
<email>notomo.motono@gmail.com</email>
</author>
<published>2021-08-27T11:54:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=08e223cebb8916f01270b5a332e6202df58609a9'/>
<id>08e223cebb8916f01270b5a332e6202df58609a9</id>
<content type='text'>
The test added in 274a3504a790a799b28ee89c75e29fb4dbdff41f
does not fail if the code changes are reverted.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test added in 274a3504a790a799b28ee89c75e29fb4dbdff41f
does not fail if the code changes are reverted.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lua): verify buffer in highlight.on_yank (#15482)</title>
<updated>2021-08-26T14:37:36+00:00</updated>
<author>
<name>notomo</name>
<email>notomo.motono@gmail.com</email>
</author>
<published>2021-08-26T14:37:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=274a3504a790a799b28ee89c75e29fb4dbdff41f'/>
<id>274a3504a790a799b28ee89c75e29fb4dbdff41f</id>
<content type='text'>
Resolve an issue with deferred clearing of highlight failing if the 
buffer is deleted before the timeout by checking whether the
buffer is valid first.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Resolve an issue with deferred clearing of highlight failing if the 
buffer is deleted before the timeout by checking whether the
buffer is valid first.</pre>
</div>
</content>
</entry>
</feed>
