Problem: error set by win_set_buf may leak if autocommands immediately close the
new window.
Solution: free the error set by win_set_buf. (prefer nvim_open_win's error as
it's more important and will cause 0 to be returned)
Problem: split_disallowed seemingly exists to prevent issues from changing
frames to accomodate a split window, which doesn't apply to floats.
Solution: remove the restriction for nvim_open_win, but only for floats.
(continue to check b_locked_split though)
NOTE: like before, the buffer we check b_locked_split for may not actually be
the target buffer "buf", as the later call to win_set_buf can fail to switch to
"buf" due to autocommands. (among other things)
Maybe we could attempt to close the new window in that case (or switch to a
different buffer if that also fails), but this is safer. (and simpler)
Fixes#36857 (and possibly some spurious E242s I've observed from extui)
Problem:
VimEnter clears foldinfo, so register_cbs is called again after
VimEnter. The duplicate parser callbacks break incremental fold
computation.
Solution:
Check if the callbacks are already registered.
Problem: After :botright copen and closing the quikfix window, the
cursor ends up in the wrong window. The problem is fr_child
always points to the first (leftmost for FR_ROW, topmost for
FR_COL) child frame. When do :vsplit, the new window is
created on the left, and frame_insert() updates the parent's
fr_child to point to this new left window.
Solution: Create a snapshot before open the quickfix window and restore
it when close it (glepnir).
closes: vim/vim#18961b43f9ded7e
Co-authored-by: glepnir <glephunter@gmail.com>
vim-patch:3a113e04d nsis: add Chinese translation to nsis installer
vim-patch:e1ea10a0a CI: Bump actions/cache from 4 to 5
vim-patch:9.0.1144: reading beyond text
vim-patch:9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
vim-patch:9.1.1977: MS-Windows: missing dependency on optiondefs.h in Make_cyg_ming.mak
vim-patch:9.1.1990: tests: Test_term_gettty() fails when using conpty on Windows
vim-patch:9.1.1997: Missing out-of-memory check in vim9class.c
vim-patch:9.1.1273: Coverity warns about using uninitialized value
vim-patch:8.2.0419: various memory leaks in Vim9 script code
vim-patch:8.2.0881: compiler warning for argument type
vim-patch:8.2.1532: compiler warning for conversion of size_t to long
vim-patch:8.2.1839: Vim9: memory leaks reported in assign test
vim-patch:8.2.2299: Vim9: invalid memory access making error message flaky
vim-patch:8.2.2673: Vim9: script-local funcref can have lower case name
vim-patch:8.2.3132: compiler warns for size_t to colnr_T conversion
vim-patch:8.2.3224: cannot call script-local function after :vim9cmd
Problem: vim.keymap.del has 'modes' as it's first argument while vim.keymap.set
has 'mode' as it's first argument despite both 'mode' and 'modes' taking in the
same type input of String or String[].
Solution: Updated vim.keymap.set docs to refer to it's first argument
as 'modes'.
Problem:
Tests that trigger `os_delay` messages may take 1-3 seconds, wasting
build/CI time, since this serves no purpose in tests.
Solution:
- Introduce `msg_delay` for cases where `os_delay` is being used as
a "UI feature".
- Skip `msg_delay` in tests.
Problem: Outdated query files in `runtimepath` can trigger errors
which are hard to diagnose.
Solution: Add section to `:check treesitter` that lists all query
files in `runtimepath`, sorted by language and query type. Files
are listed in `runtimepath` order so that the first of multiple entry
is typically the one that is used.
Note: Unlike the `nvim-treesitter` health check, this does not try
to parse the queries so will not flag incompatible ones (which would
be much more expensive).
Problem: Converting a funcref to a string leaves out "g:", causing the
meaning of the name depending on the context.
Solution: Prepend "g:" for a global function.
c4ec338fb8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Chapter 2: Fix missing "R" after 1e3e1ba067c79a when using register from insert
mode. While at it, consistently use upper case letter for CTRL-R in the
new-tutor.
related: vim/vim#18950757b42ab07
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Not enough tests for :setlocal omnifunc (after 9.1.1991).
Solution: Move the last :new after :setlocal. Also test with 'complete'
(zeertzjq).
closes: vim/vim#18958cedb1a3171
Problem: :setlocal changes effective global 'omnifunc' (Maxim Kim)
Solution: Don't change global callback when using :setlocal (zeertzjq).
fixes: vim/vim#18948closes: vim/vim#189513e82b0ebfe
Problem: gcc.vim interprets "make: *** [Makefile" in the error message
"make: *** [Makefile:2: all] Error 1" as a valid filename.
Solution: Add pattern to extract the filename correctly. Note that this
doesn't remove the dangling "]" from the output ("all]").
closes: vim/vim#18956bd5e882a91
Problem: The logic for generating backup file names is duplicated in
`buf_write_make_backup` and difficult to reuse.
Solution: Extract name generation logic into `buf_get_backup_name`.
Problem:
The q keymap is already set in open_floating_preview, so maparg('q') is not empty.
Solution:
Add a health.style check before setting the q keymap.
Problem: Invalid memory access in Ex mode with global command.
Solution: Make sure the cursor is on a valid line. (closesvim/vim#7238)
3b6d57f2ce
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When fuzzy is enabled and the prefix is not empty,
items are not sorted by fuzzy score before calling fn.complete.
Solution: Use matchfuzzypos to get the scores and sort the items
by fuzzy score before calling fn.complete.
By simplifying the way range is supported, we can fix a couple issues as
well as making it less complex and more efficient:
* For non-range LSP servers, don't send requests on WinScrolled. The
semantic tokens module has been reworked to only send one active
request at a time, as it was before range support was added. If range
is not supported, then send_request() only fires if there's been a
change to the buffer's document version.
* Cache the server's support of range and delta requests when attaching
to a buffer to save the lookup on each request.
* Range requests always use the visible window, so just use that for the
`range` param when sending requests when range is supported by the
server. This reduces the API surface area of send_request().
* Debounce the WinScrolled autocmd requests in the same the way requests
are debounced when the buffer contents are changing. Should allow
scrolling via mouse wheel or holding down "j" or "k" work a bit
smoother.
The previous iteration of range support allowed multiple active requests
to be in progress simultaneously. However, a bug was preventing any but
the most recent request to actually apply to the client's highlighting
state so that complexity was unused. It was effectively only using one
active request at a time but was just using range requests on
WinScrolled events instead of a full (or delta) request when the
document version changed.
Problem: Vim9: class_name definition can be improved
Solution: Use string_T to store class_name, avoid using STRLEN() calls,
simplify code, remove unused definition of struct
oc_newmember_S (John Marriott)
Use struct string_T to store the field class_name in struct class_T,
which means we can just use the .length field in struct string_T
instead of measuring it.
In addition:
1. In eval.c use string_T to store class_name and s in function
class_tv2string().
2. In vim9type.c change some calls from ga_concat() to ga_concat_len()
where the length is known.
3. In vim9class.c remove unused struct definition oc_newmember_S.
Change some calls from ga_concat() to ga_concat_len() where the
length is known.
4. In scriptfile.c use string_T to store type_name, class_name and
es_name in function estack_sfile().
5. In function estack_sfile() simplify construction of the grow array ga
and change some calls from ga_concat() to ga_concat_len() when the
length is known.
closes: vim/vim#189252019321e0b
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: vim9 no class identifiers in stack dumps
Solution: Prefix class members in stack traces with the class name
followed by a dot.
closes: vim/vim#12866closes: vim/vim#120780ffc17aa47
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
claims to be a "data-only" plugin, in fact it still provides some
user-facing commands because they haven't been upstreamed to Nvim.
Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
restart`, `:lsp start` and `:lsp stop` respectively.
Co-authored-by: glepnir <glephunter@gmail.com>
Problem:
CursorLine background check used global `normal_bg`, ignoring 'winhighlight'.
Solution:
Use `bg_attr` to get window-local Normal background instead.