vim-patch:8.2.0695: Vim9: cannot define a function inside a function
Problem: Vim9: cannot define a function inside a function.
Solution: Initial support for :def inside :def.
04b1269783
vim-patch:8.2.0725: Vim9: cannot call a function declared later in Vim9 script
Problem: Vim9: cannot call a function declared later in Vim9 script.
Solution: Make two passes through the script file.
09689a0284
vim-patch:8.2.0734: Vim9: leaking memory when using :finish
Problem: Vim9: leaking memory when using :finish.
Solution: Do not check for next line in third pass.
04816717df
vim-patch:8.2.0753: Vim9: expressions are evaluated in the discovery phase
Problem: Vim9: expressions are evaluated in the discovery phase.
Solution: Bail out if an expression is not a constant. Require a type for
declared constants.
32e351179e
vim-patch:8.2.0818: Vim9: using a discovery phase doesn't work well
Problem: Vim9: using a discovery phase doesn't work well.
Solution: Remove the discovery phase, instead compile a function only when
it is used. Add :defcompile to compile def functions earlier.
822ba24743
vim-patch:8.2.0819: compiler warning for unused variable
Problem: Compiler warning for unused variable.
Solution: Remove the variable.
f40e51a880
vim-patch:8.2.0822: Vim9: code left over from discovery phase
Problem: Vim9: code left over from discovery phase.
Solution: Remove the dead code.
2eec37926d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Get E967 when using text property in quickfix window. (Sergey
Vlasov)
Solution: Do not add an extra NUL and compute the text length correctly.
(closesvim/vim#11513)
2f7bfe66a1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Alloc/free of buffer for each quickfix entry is inefficient.
Solution: Use a shared grow array. (Yegappan Lakshmanan, closesvim/vim#11365)
975a665d48
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Quickfix listing does not handle very long messages.
Solution: Use a growarray instead of a fixed size buffer. (Yegappan
Lakshmanan, closesvim/vim#11357)
f8412c9d7c
Override Test_very_long_error_line() with a rewrite that doesn't use
deferred delete and string interpolation.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem:
The "force" flag of win_close() complicates the code and adds edge cases
where it is not clear what the correct behavior should be.
The "free_buf" flag of win_close() is passed on to float windows when
closing the last window of a tabpage, which doesn't make much sense.
Solution:
Remove the "force" flag and always close float windows as if :close! is
used when closing the last window of a tabpage, and set the "free_buf"
flag for a float window based on whether its buffer can be freed.
As 'hidden' is on by default, this change shouldn't affect many people.
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: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any.
4f1b083be4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Filetype autocmd may cause freed memory access.
Solution: Set the quickfix-busy flag while filling the buffer.
d0fab10ed2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using one window for executing autocommands is insufficient.
Solution: Use up to five windows for executing autocommands.
e76062c078
N/A patches for version.c:
vim-patch:9.0.0966: some compilers don't allow a declaration after a label
Problem: Some compilers don't allow a declaration after a label.
Solution: Move the declaration to the start of the block. (John Marriott)
f86490ed4f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Some source files are too big.
Solution: Move buffer and window related functions to evalbuffer.c and
evalwindow.c. (Yegappan Lakshmanan, closesvim/vim#4898)
261f346f81
* fix(PVS/V009): start file with special comment
* fix(PVS/V501): identical sub-expressions for comparison
* fix(PVS/V560): part of conditional expression is always true/false
* fix(PVS/V593): review expression of type A = B < C
* fix(PVS/V614): potentially uninitialized variable used
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().
Problem: The find_tags() function is much too long.
Solution: Refactor the function. (Yegappan Lakshmanan, closesvim/vim#9869)
2f87a99b6e
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
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: Lambda for option that is a function may be garbage collected.
Solution: Set a reference in the funcref. (Yegappan Lakshmanan,
closesvim/vim#9330)
6ae8fae869
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Enable and fix bugprone-misplaced-widening-cast warning.
Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
Problem: MS-Windows: No error message if vimgrep pattern is not matching.
Solution: Give an error message. (Christian Brabandt, closesvim/vim#9245,
closesvim/vim#8762)
0b226f60be
Co-authored-by: Christian Brabandt <cb@256bit.org>
If the call to `qf_setup_state()` in `qf_init_ext()` fails, control flow jumps
to label `qf_init_end` where a call to `qf_update_buffer()` is made with
`old_last` as a function call argument.
Prior to this patch, `old_last` would not yet have been initialized to its
default value of `NULL`, resulting in `qf_update_buffer()` attempting to compare
against its uninitialized value (quickfix.c:3882) then later forwarding it to
`qf_fill_buffer()` where the address is dereferenced and repeatedly read from/
written to for performing core qflist operations.
Depending on what the default value of `old_last` was, the results may range
from a best case scenario of neovim terminating with SIGSEGV from an attempt to
dereference an invalid pointer (quickfix.c:4056) to memory corruption if it
contained some other value that results in `qfp` being initialized from
`old_last->qf_next` (after which it is subsequently written to and read from in
a fairly arbitrary fashion).
Though extremely unlikely, it's possible for there to be security considerations
as a user can ensure that the next call to `qf_setup_state()` fails.
This patch ensures that `old_last` is NULL-assigned before control flow jumps to
`qf_init_end`.
Closes#20639.
Problem: Using freed memory when location list changed in autocmd.
Solution: Return QF_ABORT and handle it. (Yegappan Lakshmanan,
closesvim/vim#10993)
6d24a51b94
Problem: Using freed memory when using 'quickfixtextfunc' recursively.
Solution: Do not allow for recursion.
d6c67629ed
Cherry-pick Test_qflist_statusmsg() from patch 8.2.4617.
This was used in the past with assumption that curwin/curbuf
is "special" but this has not been true since basically forever
at this point.
Reduce NOT_VALID/CLEAR panic in options.lua . These should not
be set if an effect of the option is causing something
which by itself invokes redraw_later().