<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/ui/float_spec.lua, branch usermarks</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>revert: "refactor(win_close): remove "force", don't pass on "free_buf" (#21921)" (#21979)</title>
<updated>2023-01-24T10:31:07+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2023-01-24T10:31:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=c6ab8dfc15e0f6f1a805ce2145e2b4f0072b33d1'/>
<id>c6ab8dfc15e0f6f1a805ce2145e2b4f0072b33d1</id>
<content type='text'>
This reverts commit 0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3.

&gt; 'bufhidden' option exists. I don't think we should assume autoclosing
windows are fine just because 'hidden' is set.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3.

&gt; 'bufhidden' option exists. I don't think we should assume autoclosing
windows are fine just because 'hidden' is set.</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(win_close): remove "force", don't pass on "free_buf" (#21921)</title>
<updated>2023-01-23T10:55:11+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2023-01-23T10:55:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3'/>
<id>0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3</id>
<content type='text'>
Problem:
The "force" flag of win_close() complicates the code and adds edge cases
where it is not clear what the correct behavior should be.
The "free_buf" flag of win_close() is passed on to float windows when
closing the last window of a tabpage, which doesn't make much sense.

Solution:
Remove the "force" flag and always close float windows as if :close! is
used when closing the last window of a tabpage, and set the "free_buf"
flag for a float window based on whether its buffer can be freed.
As 'hidden' is on by default, this change shouldn't affect many people.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
The "force" flag of win_close() complicates the code and adds edge cases
where it is not clear what the correct behavior should be.
The "free_buf" flag of win_close() is passed on to float windows when
closing the last window of a tabpage, which doesn't make much sense.

Solution:
Remove the "force" flag and always close float windows as if :close! is
used when closing the last window of a tabpage, and set the "free_buf"
flag for a float window based on whether its buffer can be freed.
As 'hidden' is on by default, this change shouldn't affect many people.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(statuscolumn): fix sign column highlights (#21727)</title>
<updated>2023-01-11T01:52:11+00:00</updated>
<author>
<name>luukvbaal</name>
<email>31730729+luukvbaal@users.noreply.github.com</email>
</author>
<published>2023-01-11T01:52:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=93d99aefd314bc4abfc54c0c29a4de84b6fcc823'/>
<id>93d99aefd314bc4abfc54c0c29a4de84b6fcc823</id>
<content type='text'>
Resolve #21726.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Resolve #21726.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(float): open float relative to mouse #21531</title>
<updated>2023-01-10T10:22:41+00:00</updated>
<author>
<name>Sebastian Lyng Johansen</name>
<email>seblyng98@gmail.com</email>
</author>
<published>2023-01-10T10:22:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=870ca1de52b240926b88f01afa697cd9b119bdac'/>
<id>870ca1de52b240926b88f01afa697cd9b119bdac</id>
<content type='text'>
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line &lt; col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '&lt;MouseMove&gt;', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '&lt;MouseMove&gt;'
    end, { expr = true })
    ```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line &lt; col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '&lt;MouseMove&gt;', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '&lt;MouseMove&gt;'
    end, { expr = true })
    ```</pre>
</div>
</content>
</entry>
<entry>
<title>fix(ui): set stc to empty in floatwin with minimal style (#21720)</title>
<updated>2023-01-10T09:36:48+00:00</updated>
<author>
<name>Raphael</name>
<email>glephunter@gmail.com</email>
</author>
<published>2023-01-10T09:36:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=87cfe50944ef2c84de98eb6b124fe312eef31313'/>
<id>87cfe50944ef2c84de98eb6b124fe312eef31313</id>
<content type='text'>
fix(ui): set stc to emtpy in floatwin with minimal style</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix(ui): set stc to emtpy in floatwin with minimal style</pre>
</div>
</content>
</entry>
<entry>
<title>fix(ui): add test case</title>
<updated>2023-01-09T06:17:32+00:00</updated>
<author>
<name>Raphael</name>
<email>glephunter@gmail.com</email>
</author>
<published>2023-01-09T06:17:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e351ab179b3f4dbedd8e959dfcd972178d6a9e16'/>
<id>e351ab179b3f4dbedd8e959dfcd972178d6a9e16</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(win_close): remove float grid after closing buffer (#21551)</title>
<updated>2022-12-27T09:29:05+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2022-12-27T09:29:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=cd6ec1db068f9f4c1900a00b5392e39e59f0a7cb'/>
<id>cd6ec1db068f9f4c1900a00b5392e39e59f0a7cb</id>
<content type='text'>
It is not safe to remove the float grid when autocommands can still be
triggered, as autocommands may use the float grid.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is not safe to remove the float grid when autocommands can still be
triggered, as autocommands may use the float grid.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(float): fix crash with bufpos and non-existent window (#21319)</title>
<updated>2022-12-07T03:36:34+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2022-12-07T03:36:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=ed23cd3e50e778604e45e85bc939271a7759ca1f'/>
<id>ed23cd3e50e778604e45e85bc939271a7759ca1f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test: add more tests for float window bufpos (#21318)</title>
<updated>2022-12-07T02:18:12+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2022-12-07T02:18:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=eab71e7875782144ca6c62269fc6f333bc061001'/>
<id>eab71e7875782144ca6c62269fc6f333bc061001</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(tests): only get the color map once, even for multiple test files</title>
<updated>2022-11-27T10:51:10+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2022-11-27T09:33:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=942f26279d373fcdebcb41363e526a2871b09a71'/>
<id>942f26279d373fcdebcb41363e526a2871b09a71</id>
<content type='text'>
Problem: test/functional/ui/screen.lua would be reloaded for each
*_spec.lua file, which causes an extra nvim session to be started
to get the color map each time.

solution: Mark screen.lua as a preloaded file, but defer the
loading of the color map to the first time Screen object is initialised.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: test/functional/ui/screen.lua would be reloaded for each
*_spec.lua file, which causes an extra nvim session to be started
to get the color map each time.

solution: Mark screen.lua as a preloaded file, but defer the
loading of the color map to the first time Screen object is initialised.
</pre>
</div>
</content>
</entry>
</feed>
