Problem: missing out-of-memory checks in cmdexpand.c
Solution: add missing out-of-memory checks, re-order code
(John Marriott)
This commit does the following:
- in cmdline_pum_create() add out-of-memory check call of ALLOC_MULT()
- in expand_cmdline() move check for out-of-memory to cover both
assignments of file_str
- in nextwild() don't free `p2` until after it's last use.
closes: vim/vim#175921be5b375c4
N/A patch:
vim-patch:9.1.1474: missing out-of-memory check in mark.c
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: ml_get error when updating quickfix buffer with nvim_buf_attach
Solution: use correct lnume parameter in changed_lines for append mode
Fix#34610
Problem: On Windows, the value of `term` is overwritten without freeing
the old allocated value, which may lead to a memory leak.
GCC also gives a "incompatible pointer type" warning about
passing `*term` to os_tty_guess_term().
Solution: Don't override the old allocated value, and copy the guessed
value to `term` if its old value is NULL.
Remove unmatchable :normal {mark,register} matches. The arg to :normal
is now handled separately and contained marks and registers are no
longer matched.
closes: vim/vim#17571dcff497373
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
The required space in Vim9 continuation comments (#\ comment) was
accidentally removed in commit 6acca4b as trailing whitespace.
closes: vim/vim#1757399b9847bd8
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: inconsistent range arg for :diffget/diffput
Solution: fix the range specification, place the cursor for :diffput and
:diffget consistently on the last line (Yee Cheng Chin)
Previously, `:<range>diffget` only allowed using 1 or above in the range
value, making it impossible to use the command for a diff block at the
beginning of the file. Fix the range specification so the user can now
use 0 to specify the space before the first line. This allows
`:0,$+1diffget` to work to retrieve all the changes from the other file
instead of missing the first diff block. Also do this for `:diffput`.
Also, make `:diffput` work more similar to `:diffget`. Make it so that
if the cursor is on the last line and a new line is inserted in the
other file, doing `:diffput` will select that diff block below the line,
just like `:diffget` would.
Also clean up the logic a little bit for edge cases and for handling
line matched diff blocks better.
closes: vim/vim#17579d75ab0cbf5
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Problem: Currently our CI is failing due to msvc warning 5287. This
warning tells us that we are performing a binary expression with enums
of two different types. In this case however, this is clearly intended
and valid.
Solution: Suppress warning 5287 on the line this occurs.
Problem: UI buffers may be 'unmodifiable' and use a 'swapfile'.
Solution: Set the 'modifiable' and 'noswapfile' options.
Co-authored-by:phanium <91544758+phanen@users.noreply.github.com>
**Problem:** When enabling document_color multiple times for the same
buffer (or when toggling it on and off), duplicate autocmds are created
since the previous ones are not cleared.
**Solution:** Clear the appropriate buffer-local autocmds when
enabling/disabling document color functionality.
Problem: filetype: bright(er)script files are not recognized
Solution: detect *.bs files as brighterscript filetype and *.brs as
brightscript filetype, include filetype plugins (Riley Bruins)
closes: vim/vim#1756603e5ee25fd
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Problem: too many strlen() calls
Solution: Change expand_env() to return string length
(John Marriott)
This commit does the following changes:
- In expand_env_esc():
- return the length of the returned dst string.
- refactor to remove some calls to STRLEN() and STRCAT()
- add check for out-of-memory condition.
- Change call sites in various source files to use the return value
closes: vim/vim#17561fff0132399
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem:
- Missing some important Vim features
- Since Nvim 0.5, package.path and package.cpath don't include
`'runtimepath'` (thought `require()` can still find modules in
`runtimepath`)
Closes#33938
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: filetype: not all lex files are recognized
Solution: detect *.ll as lex, llvm or lifelines filetype, depending on
the content (Eisuke Kawashima)
closes: vim/vim#1756048295111e5
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Problem:
In LSP configs, the function form of `cmd()` cannot easily get the
resolved root dir (workspace). One of the main use-cases of a dynamic
`cmd()` is to be able to start a new server whose binary may be located
*in the workspace* ([example](https://github.com/neovim/nvim-lspconfig/pull/3912)).
Compare `reuse_client()`, which also receives the resolved config.
Solution:
Pass the resolved config to `cmd()`.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: No ext_messages kind for the :command, :version commands.
:version is emitted as multiple events.
Solution: Assign them the "list_cmd" kind. Use `msg_put*` to properly
format the message as a single event.
Problem:
Cannot enter multiline prompts in a buftype=prompt buffer.
Solution:
- Support shift+enter (`<s-enter>`) to start a new line in the prompt.
- Pasting multiline text via OS paste, clipboard, "xp, etc.
- A/I in editable region works as usual.
- i/a/A/I outside of editable region moves cursor to end of current
prompt.
- Support undo/redo in prompt buffer.
- Support o/O in prompt buffer.
- Expose prompt location as `':` mark.
Problem: Buffer events (specifically on_bytes callbacks) weren't triggered when the
quickfix list was modified, preventing buffer change notifications.
Solution: Add code to send both bytes and lines change notifications after
quickfix buffer updates to properly trigger all attached callbacks.
Problem: The new cert-arr39-c and bugprone-tagged-union-member-count
checks introduced in clang-tidy 20 fail on Neovim's codebase, even
though the code is correct.
Solution: Disable these two checks by modifying the .clang-tidy
configuration file.