| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
Problem:
nvim_buf_del_extmark error if buffer is destroyed before timer stops
Solution:
check nvim_buf_is_valid.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: Currently vim.hl.range only allows one timed highlight.
Creating another one, removes the old one.
Solution: vim.hl.range now returns a timer and a function. The timer
keeps track of how much time is left in the highlight and the function
allows you to clear it, letting the user decide what to do with old
highlights.
|
|
|
| |
Ref #33278
|
| |
|
|
|
|
| |
Re-enable these after release.
|
|
|
|
|
|
|
|
| |
Problem:
- `:lua vim.env.<Tab>` does not show completion of environment variables
- Meanwhile, `:let $<Tab>` does show completion of environment variables
Solution:
- Fix it
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`:lua vim.lsp.c<tab>` does not list vim.lsp.completion in the completion
list after 24cea4c7f7417c7fe99a98a0487f51dd68c4f409.
Solution:
- Always include `vim.lsp._submodule` keys in candidates.
- Fixes `vim.lsp.c<tab>` -> `vim.lsp.completion`.
- Eager-load `vim.lsp.completion` to get its completion.
- Fixes `vim.lsp.completion.g<tab>` -> `vim.lsp.completion.get`.
|
| |
|
|
|
|
|
|
|
| |
Problem: Error messages that cause a vim.ui_attach() namespace to
detach are not visible in the message history. Decoration
provider and vim.ui_attach error messages are dissimilar.
Solution: Emit vim.ui_attach() errors as an actual message in addition
to logging it. Adjust error message format.
|
|
|
|
|
|
|
|
|
| |
Problem: Message kind logic for emitting an error message is convoluted
and still results in emitting an unfinished message earlier than
wanted.
Solution: Ensure emsg_multiline() always sets the kind wanted by the caller
and doesn't isn't unset to logic for emitting the source message.
Caller is responsible for making sure multiple message chunks are
not emitted as multiple events by setting `msg_ext_skip_flush`...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
## Problem
The pattern used to match indentation is wrong as can be seen in
```lua
-- current pattern doesn't match starting space
print(vim.inspect((" xyz"):match("(^%s+)%S")))
-- nil
-- instead, it matches characters `^ ` in text
print(vim.inspect(("x^ yz"):match("(^%s+)%S")))
-- "^ "
-- indentation could've been matched by, however not required
print(vim.inspect((" xyz"):match("^(%s+)%S")))
-- " "
```
## Solution
We don't even need to modify `base_indent` at every line. If every line's indentation is calculated by the previous line's indentation (which already has starting indentation) added to the starting indentation, we see that indentation is multiplied on every line.
Hence, we only add the starting line indentation to every line.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
On Windows, treesitter query files are not recognized as such when
opened from inside their directory, because the full path returned from
fnamemodify(_, ':p') contains backslashes, while the filetype patterns
expect forward slashes.
Solution:
Normalize the result of fnamemodify(_, ':p') before trying to match it
to filetype patterns.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Unpaired marks are shown with `filter.extmarks == true`, which
should only return visible highlights. Misleading `end_col`
included in `inspect_pos()` for unpaired mark; it is set to
`start_col + 1` which would be a visible highlight, which it is
not. Custom "is_here" filter used to get extmarks overlapping a
position.
Solution: Exclude unpaired highlight extmarks with `filter.extmarks == true`.
Set `end_col` to `start_col` for an unpaired mark. Supply
appropriate arguments to nvim_buf_get_extmarks() to return
overlapping extmarks; exclude marks whose end is at `{row, col}`
with `filter.extmarks == true`.
|
|
|
|
|
|
|
|
| |
Problem:
The `lua/` tests dir is for Lua stdlib tests. It is not for anything
that randomly happens to be implemented with Lua.
Solution:
Move `lua/runtime_spec.lua` to `editor/runtime_spec.lua`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Test may fail because it matches a Lua table address, and the following
whitespace may differ depending on the stringified address length:
test/functional/lua/loop_spec.lua:233: Row 3 did not match.
Expected:
|{3: }|
|{9:Error executing callback:} |
|*{9:uv_idle_t: 0x{MATCH:%w+}} |
|{6:Press ENTER or type command to continue}^ |
Actual:
|{3: }|
|{9:Error executing callback:} |
|*{9:uv_idle_t: 0xd4c2820a00} |
|{6:Press ENTER or type command to continue}^ |
Solution:
Match a variable amount of whitespace.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Given that `vim.snippet.expand()` sets temporary `<tab>`/`<s-tab>`
keymaps there is no way to build "smart-tab" functionality where `<tab>`
chooses the next completion candidate if the popup menu is visible.
Solution:
Set the keymap permanent in `_defaults`.
The downside of this approach is that users of multiple snippet engine's
need to adapt their keymaps to handle all their engines that are in use.
For example:
vim.keymap.set({ 'i', 's' }, "<Tab>", function()
if foreign_snippet.active() then
return "<Cmd>lua require('foreign_snippet').jump()<CR>"
elseif vim.snippet.active({ direction = 1 }) then
return "<Cmd>lua vim.snippet.jump(1)<CR>"
else
return key
end
end, { expr = true })
Upside is that using `vim.keymap.set` to override keymaps is a well
established pattern and `vim.snippet.expand` calls made by nvim itself
or plugins have working keymaps out of the box.
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
|
|
|
|
|
|
|
| |
Problem: yi' don't highlight last character since
https://github.com/neovim/neovim/commit/8ce504820af04194a41acbe1f4c61cf12bd5feb5.
Solution: Always use `opts.inclusive=true`, since calculation of `"]`
(`b_op_end`) have taken `inclusive` into account.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
When multiple diagnostics appear on a single line, the virtual lines for
all diagnostics except the first were rendered with progressively fewer
columns.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
**Problem:** Some weird languages have different comment syntax
depending on the location in the code, and we do not have a way to
determine the correct `commentstring` for these special cases.
**Solution:** Allow queries to specify `commentstring` values in
metadata, allowing users/`nvim-treesitter` to provide a better
commenting experience without hugely increasing the scope of the code in
core.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Sourcing buffer lines is too complicated.
Solution: Simplify the code. Make it possible to source Vim9 script lines.
(Yegappan Lakshmanan, closes vim/vim#9974)
https://github.com/vim/vim/commit/85b43c6cb7d56919e245622f4e42db6d8bee4194
This commit changes the behavior of sourcing buffer lines to always have
a script ID, although sourcing the same buffer always produces the same
script ID.
vim-patch:9.1.0372: Calling CLEAR_FIELD() on the same struct twice
Problem: Calling CLEAR_FIELD() on the same struct twice.
Solution: Remove the second CLEAR_FIELD(). Move the assignment of
cookie.sourceing_lnum (zeertzjq).
closes: vim/vim#14627
https://github.com/vim/vim/commit/f68517c1671dfedcc1555da50bc0b3de6d2842f6
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Indenting text is a common task in plugins/scripts for
presentation/formatting, yet vim has no way of doing it (especially
"dedent", and especially non-buffer text).
Solution:
Introduce `vim.text.indent()`. It sets the *exact* indentation because
that's a more difficult (and thus more useful) task than merely
"increasing the current indent" (which is somewhat easy with a `gsub()`
one-liner).
|
|
|
|
|
|
|
|
| |
Problem: When setting an option, mapping etc. from Lua without -V1, the
script ID is set to SID_LUA even if there already is a script
ID assigned by :source.
Solution: Don't set script ID to SID_LUA if it is already a Lua script.
Also add _editor.lua to ignorelist to make script context more
useful when using vim.cmd().
|
|
|
|
|
|
|
|
|
| |
Problem:
luv callback `vim.uv.new_timer():start(0, 0, function() error() end)`
causes SIGSEGV, since `xstrdup` gets NULL from `lua_tostring`.
Similar to: https://github.com/neovim/neovim/commit/a5b1b83a2693ffa7a5a0a22b3693d36ea60051be
Solution:
Check NULL before `xstrdup`.
|
| |
|
| |
|
|
|
|
|
|
| |
Problem: Error thrown when for invalid line number which may be accessed
in an `on_detach` callback at which point line count is
intentionally set to 0.
Solution: Move empty memline check to before line number check.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`vim.tbl_get(tbl, nil, 1)` returns `tbl` itself. In this case, `keys` is not
empty, but `ipairs` skips the iteration:
local keys = { nil, 1 }
assert(#keys == 2)
for i, k in ipairs(keys) do
assert(false, 'unreachable')
end
Solution:
Use `select("#", ...)` and `select(i, ...)` to ensure consistency for count and
iteration.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Problem: `cmdline_show` is emitted unnecessarily each event
loop iteration, because `cmdline_was_last_drawn` is never set.
Solution: Keep track of whether the cmdline was last drawn to avoid
unnecessarily emitting cmdline_show. Set `redraw_state` to
emit `cmdline_pos` when emitting `CursorMovedC`. Only emit
`cmdline_pos` when cmdline was last drawn.
|
| |
|
|
|
|
|
|
| |
Problem: nlua_call_ref_ctx() does not pop the return value in fast
context that did not error.
Solution: Fall through to end; calling nlua_call_pop_retval().
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
`vim.hl.on_yank()` has a "timeout" behavior but this is not available for
`vim.hl.range()`.
Solution:
Add `timeout` arg to `vim.hl.range()`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: filetype: setting bash filetype is backwards incompatible
Solution: revert patch v9.1.0965, detect bash scripts again as sh
filetype
This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.
related: vim/vim#16309
https://github.com/vim/vim/commit/727c567a0934643e2d6e1dd92d4e636b17d9067f
Co-authored-by: Christian Brabandt <cb@256bit.org>
vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously
Problem: tests: shaderslang was removed from test_filetype erroneously
(Christian Clason, after v9.1.1030)
Solution: restore the test
https://github.com/vim/vim/commit/1d2867df0c5dfa3d2444229f9e4b23d6ff935956
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns
NULL in `nlua_luv_thread_common_cfpcall`.
Crash stack trace:
- `_platform_strlen` → `xstrdup` (memory.c:469)
- `nlua_luv_thread_common_cfpcall` (executor.c:281)
Solution:
Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
|
|
|
|
|
|
|
|
|
|
|
| |
Making this opt-out (on by default) was the wrong choice from the
beginning. It is too visually noisy to be enabled by default.
BREAKING CHANGE: Users must opt-in to the diagnostic virtual text
handler by adding
vim.diagnostic.config({ virtual_text = true })
to their config.
|
|
|
|
|
|
| |
Problem: If a (vim.ui_attach) cmdline_hide callback triggers a redraw,
it may cause cmdline_show events for an already exited cmdline.
Solution: Avoid emitting cmdline_show event when ccline.cmdbuff is
already NULL. Unset ccline.cmdbuff before emitting cmdline_hide.
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
| |
Problem:
vim.fs.dir(), vim.fs.find() do not follow symlinks.
Solution:
- Add "follow" flag.
- Enable it by default.
|
|
|
|
|
| |
This is needed to replace the nvim-lspconfig function is_descendant that
some lspconfg configurations still use.
|
| |
|