| Commit message (Collapse) | Author | Age |
... | |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: Wrong curswant when clicking on empty line or with vsplits.
Solution: Don't check for ScreenCols[] before the start of the window
and handle empty line properly.
closes: vim/vim#13132
https://github.com/vim/vim/commit/03cd697d635f1b0e7ffe21cf8244a8fb755f2ddb
|
|\
| |
| | |
fix(float): trigger winnew event when float window create
|
| | |
|
| | |
|
|\ \
| |/
|/| |
fix(float): add fixed option
|
| | |
|
|\ \
| |/
|/| |
fix(float): don't trigger au event when enter is false
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
Problem: Now way to show text at the bottom part of floating window
border (a.k.a. "footer").
Solution: Allows `footer` and `footer_pos` config fields similar to
`title` and `title_pos`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the messy things when changing a non-current buffer is
not about the buffer, it is about windows. In particular, it is about
`curwin`.
When editing a non-current buffer which is displayed in some other
window in the current tabpage, one such window will be "borrowed" as the
curwin. But this means if two or more non-current windows displayed the buffers,
one of them will be treated differenty. this is not desirable.
In particular, with nvim_buf_set_text, cursor _column_ position was only
corrected for one single window. Two new tests are added: the test
with just one non-current window passes, but the one with two didn't.
Two corresponding such tests were also added for nvim_buf_set_lines.
This already worked correctly on master, but make sure this is
well-tested for future refactors.
Also, nvim_create_buf no longer invokes autocmds just because you happened
to use `scratch=true`. No option value was changed, therefore OptionSet
must not be fired.
|
|
|
|
|
|
|
| |
Problem: A double-width char in a floating window causes an extra
space to be drawn to the left of its boundary.
Solution: Only reset skipstart at the first column.
Fix #24775
|
| |
|
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: famiu <famiuhaque@protonmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: After neovim/neovim@846a056, only the ruler for current floating or
last window without a statusline is drawn in the cmdline. This means that if the
current window is not one of these, but has no statusline, its ruler will not be
drawn anymore.
Solution: Make `showmode()` draw the ruler of the current window or the last
window in the cmdline if it has no statusline. This also maintains the
previously restored floating window case (`float->w_status_height` should be 0).
This behaviour should again match Vim, but without the overdraw it seems to do
to achieve the same effect; it calls `showmode()` to draw the ruler for the last
window without a statusline, then may draw over it in `showruler()` (which is
now `show_cursor_info_later()` in Nvim) to show the ruler for the current
window..? It's very confusing.
Also update the logic in `win_redr_ruler()` to mirror the check done in
`showmode()`, so that the ruler doesn't potentially draw over the long
ins-completion mode message in some cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Ruler not drawn correctly when using 'rulerformat'.
Solution: Adjust formatting depending on whether the ruler is drawn in the
statusline or the command line. (Sean Dewar, closes vim/vim#12246)
https://github.com/vim/vim/commit/fc8a601c3251c0388a88c1235b18c529385f7196
This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls
`win_redr_ruler()` with `curwin` now if it's floating, rather than the last
window if there's no statusline (which usually already shares its right side
with that of the editor).
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
|
|\
| |
| | |
fix(api): do not re-apply win_config.style when missing
|
| | |
|
|\ \
| | |
| | | |
fix(highlight): use winhl=Foo:Bar even when Bar is empty
|
| |/
| |
| |
| | |
fixes #22906
|
|/
|
|
|
|
|
|
| |
Problem:
Codebase inconsistently binds vim.api onto a or api.
Solution:
Use api everywhere. a as an identifier is too short to have at the
module level.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Clamp for height in floating windows enforced no more than
editor height - 1, disallowing full editor height floating windows when
using cmdheight=0
Solution: Clamp to full height, removing the -1. Tested to give the
intended results with cmdheight=0, 1, or more than 1. This also
inadvertently fixes a rendering error with cmdheight >1 where the
bottom border would be overlapped by the cmdline.
|
|
|
|
|
|
|
| |
Semi-regression. The "ruler" behavior for a floating window
was never really specified but in practice followed the users
cursor movements in normal mode in a focused float, which seems
like a reasonable behavior to now specify.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
scroll_delta contains how much the top line of a window moved since the
last time win_viewport was emitted. It is expected to be used to
implement smooth scrolling. For this purpose it only counts "virtual" or
"displayed" so folds should count as one line. Because of this it
adds extra information that cannot be computed from the topline
parameter.
Fixes #19227
|
| |
|
|
|
| |
Just setcursor_mayforce(true) is enough as Nvim uses msg_grid.
|
|
|
|
|
|
|
|
| |
(#21921)" (#21979)
This reverts commit 0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3.
> 'bufhidden' option exists. I don't think we should assume autoclosing
windows are fine just because 'hidden' is set.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Resolve #21726.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 < 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' }, '<MouseMove>', 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 '<MouseMove>'
end, { expr = true })
```
|
|
|
| |
fix(ui): set stc to emtpy in floatwin with minimal style
|
| |
|
|
|
|
| |
It is not safe to remove the float grid when autocommands can still be
triggered, as autocommands may use the float grid.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
add "title" and "title_pos" keys to win config dict.
|
| |
|
|
|
|
|
| |
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
| |
fixes #20106
fixes #20229
|