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: 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:
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: 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>
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: 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: 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: 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.
Problem:
:messages history include the "search hit BOTTOM, continuing at TOP" message,
which is noise.
Solution:
Set msg_hist_off before giving the warning and reset it after warning.
Call `vim.treesitter.language.add()` before `get_helptags` (which
triggers filetype=help). And do this in the main routine, instead of
each gen/validate task.
Problem:
The builtin terminfo defs don't include xterm-ghostty, so features like
`kTerm_set_underline_style` are missing when building without unibilium.
Solution:
- Add ghostty to `gen_terminfo.lua`.
- Note: The ncurses defs are somewhat different than what ghostty ships.
- Special-case ghostty in `terminfo_from_builtin`.
Problem: :helpclose incorrectly accepts a range and a count.
Solution: Remove EX_COUNT and EX_RANGE from the command definition.
(Doug Kearns)
closes: vim/vim#189174c141bae3b
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: Vim9: comparing partial with function fails.
Solution: Support this comparison. Avoid a crash. (closesvim/vim#9909)
Add more test cases.
ed0c62e7b1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when using null_function for a partial.
Solution: Don't call fname_trans_sid() with NULL. (closesvim/vim#9908)
673bcb10eb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When waiting for a character is interrupted by receiving channel
data and the first character of a mapping was typed, the mapping
times out. (Ramel Eshed)
Solution: When dealing with channel data don't return from mch_inchar().
cda7764d8e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Accessing beyond allocated memory when using the cmdline window in
Ex mode.
Solution: Use "*" instead of "'<,'>" for Visual mode.
c6fdb15d42
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using "'<,'>" in Ex mode may compare unrelated pointers.
Solution: Set eap->cmd to "+" only later.
48ce135e6d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using invalid pointer with "V:" in Ex mode.
Solution: Correctly handle the command being changed to "+".
f50808ed13
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Visual range does not work before command modifiers.
Solution: Move Visual range to after command modifiers.
c75bca3ee9
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when buffer gets deleted inside charconvert during save
Solution: Check for `b_saving` inside `can_unload_buffer()`, so we don’t try to
unload a buffer while it’s still being saved (glepnir).
closes: vim/vim#18901fe1c57cd2c
Co-authored-by: glepnir <glephunter@gmail.com>