Problem: buffer-overflow in vim_regsub_both()
Solution: Check remaining space
ced2c7394a
The change to do_sub() looks confusing. Maybe it's an overflow check?
Then the crash may not be applicable to Nvim because of different casts.
The test also looks confusing. It seems to source itself recursively.
Also don't call strlen() twice on evaluation result.
N/A patches for version.c:
vim-patch:9.0.1849: CI error on different signedness in ex_cmds.c
vim-patch:9.0.1853: CI error on different signedness in regexp.c
Co-authored-by: Christian Brabandt <cb@256bit.org>
ml_get_buf() takes a third parameters to indicate whether the
caller wants to mutate the memline data in place. However
the vast majority of the call sites is using this function
just to specify a buffer but without any mutation. This makes
it harder to grep for the places which actually perform mutation.
Solution: Remove the bool param from ml_get_buf(). it now works
like ml_get() except for a non-current buffer. Add a new
ml_get_buf_mut() function for the mutating use-case, which can
be grepped along with the other ml_replace() etc functions which
can modify the memline.
problem: breakcheck might run arbitrary lua code, which might require
modules and thus invoke runtime path calculation recursively.
solution: Block the use of breakcheck when expanding glob patterns
inside 'runtimepath'
fixes#23012
Problem: Vim9: leaking memory when using continuation line.
Solution: Keep a pointer to the continuation line in evalarg_T. Centralize
checking for a next command.
b171fb1790
Omit eval_next_line(): Vim9 script only.
vim-patch:8.2.1050: missing change in struct
Problem: Missing change in struct.
Solution: Add missing change.
65a8ed37f7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closesvim/vim#11833)
f97a295cca
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Incsearch does not detect empty pattern properly.
Solution: Return magic state when skipping over a pattern. (Christian
Brabandt, closesvim/vim#7612, closesvim/vim#6420)
d93a7fc1a9
Problem: Some search tests fail.
Solution: Use a better way to reject searching for the Visual area.
44a4d947bb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Accessing invalid memory when a regular expression checks the
Visual area while matching in a string.
Solution: Do not try matching the Visual area in a string.
679d66c2d2
Use CheckScriptFailure() instead of v9.CheckScriptFailure().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Trying every character position for a match is inefficient.
Solution: Use the start position of the match ignoring "\zs".
01105b37a1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Several lines of code are duplicated.
Solution: Move duplicated code to a function. (Yegappan Lakshmanan,
closesvim/vim#5330)
f4140488c7
Using sizeof seems better than ARRAY_SIZE for vim_snprintf().
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.
Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
Problem: No error if engine selection atom is not at the start.
Solution: Give an error. (Christian Brabandt, closesvim/vim#10439)
360da40b47
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: New regexp engine does not give an error for "\%v".
Solution: Check for a value argument. (issue vim/vim#10079)
91ff3d4f52
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: no check for space before #comment.
Solution: Add space checks.
2c5ed4e330
Omit ends_excmd2(): the same as ends_excmd() in legacy Vim script.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Varargs does not work for replacement function of substitute().
Solution: Check the varargs flag of the function. (closesvim/vim#11142)
48db5dafec
Problem: The funcexe_T struct members are not named consistently.
Solution: Prefix "fe_" to all the members.
851f86b951
Omit fe_check_type: always NULL in legacy Vim script.
This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text
The logic for inline virtual text is going to be different in nvim than
text property based text in vim, but this refactor is still useful,
as calculation of displayed linesize is going to be stateful in a
similar way.
Problem: Profiling functionality is spread out.
Solution: Put profiling functionality in profiling.c. (Yegappan Lakshmanan,
closesvim/vim#4666)
fa55cfc69d
Move proftime_T to types.h for now to avoid recursive #include.