| Commit message (Collapse) | Author | Age |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Create mapping to most of the C spec and some POSIX specific functions.
This is more robust than relying files shipped with IWYU.
|
|
|
|
|
|
|
| |
Enable all clang-tidy warnings by default instead of disabling them.
This ensures that we don't miss useful warnings on each clang-tidy
version upgrade. A drawback of this is that it will force us to either
fix or adjust the warnings as soon as possible.
|
|
|
|
|
|
| |
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
|
|
|
|
| |
Biggest change is that uncrustify is silent during linting.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: [security]: FPE in adjust_plines_for_skipcol
Solution: don't divide by zero, return zero
Prevent a floating point exception when calculating w_skipcol (which can
happen with a small window when the number option is set and cpo+=n).
Add a test to verify
https://github.com/vim/vim/commit/cb0b99f0672d8446585d26e998343dceca17d1ce
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
|
|
|
|
|
|
|
| |
Problem: Crash when expanding "~" in substitute causes very long text.
Solution: Limit the text length to MAXCOL.
https://github.com/vim/vim/commit/ab9a2d884b3a4abe319606ea95a5a6d6b01cd73a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
We already have an extensive suite of static analysis tools we use,
which causes a fair bit of redundancy as we get duplicate warnings. PVS
is also prone to give false warnings which creates a lot of work to
identify and disable.
|
| |
|
|
|
|
|
|
| |
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
|
|
|
|
|
|
| |
regext_bt.c and regexp_nfa.c are inlined into regexp.c instead of
included as a header. This makes developer tools like clang-tidy and
clangd be able to understand the code better.
|
|
|
|
|
|
| |
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
|
|
|
|
|
|
| |
- Move vimoption_T to option.h
- option_defs.h is for option-related types
- option_vars.h corresponds to Vim's option.h
- option_defs.h and option_vars.h don't include each other
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: undefined behaviour upper/lower function ptrs
Solution: Fix UBSAN error in regexp and simplify upper/lowercase
modifier code
The implementation of \u / \U / \l / \L modifiers in the substitute
command relies on remembering the state by setting function pointers on
func_all/func_one in the code. The code signature of `fptr_T` is
supposed to return void* (due to C function signatures not being able to
return itself due to type recursion), and the definition of the
functions (e.g. to_Upper) didn't follow this rule, and so the code tries
to cast functions of different signatures, resulting in undefined
behavior error under UBSAN in Clang 17. See vim/vim#12745.
We could just fix `do_Upper`/etc to just return void*, which would fix
the problem. However, these functions actually do not need to return
anything at all. It used to be the case that there was only one pointer
"func" to store the pointer, which is why the function needs to either
return itself or NULL to indicate whether it's a one time or ongoing
modification. However, c2c355df6f094cdb9e599fd395a78c14486ec697
(7.3.873) already made that obsolete by introducing `func_one` and
`func_all` to store one-time and ongoing operations separately, so these
functions don't actually need to return anything anymore because it's
implicit whether it's a one-time or ongoing operation. Simplify the code
to reflect that.
closes: vim/vim#13117
https://github.com/vim/vim/commit/d25021cf036c63d539f845a1ee05b03ea21d61ff
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: buffer-overflow in vim_regsub_both()
Solution: Check remaining space
https://github.com/vim/vim/commit/ced2c7394aafdc90fb7845e09b3a3fee23d48cb1
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: Inconsistent capitalization in error messages.
Solution: Make capitalization consistent. (Doug Kearns)
https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
| |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|
|
|
|
|
|
|
|
|
| |
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.
https://github.com/vim/vim/commit/b171fb179053fa631fec74911b5fb9374cb6a8a1
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.
https://github.com/vim/vim/commit/65a8ed37f7bc61fbe5c612a7b0eb0dfc16ad3e11
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
| |
message.c functions now take const char * as a format. Error message
definitions can be made const.
|
| |
|
|
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
|
|
|
|
| |
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes vim/vim#11833)
https://github.com/vim/vim/commit/f97a295ccaa9803367f3714cdefce4e2283c771d
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
|
|
|
| |
Problem: Incsearch does not detect empty pattern properly.
Solution: Return magic state when skipping over a pattern. (Christian
Brabandt, closes vim/vim#7612, closes vim/vim#6420)
https://github.com/vim/vim/commit/d93a7fc1a98a58f8101ee780d4735079ad99ae35
|
|
|
|
|
|
|
|
|
| |
Problem: Some search tests fail.
Solution: Use a better way to reject searching for the Visual area.
https://github.com/vim/vim/commit/44a4d947bbc2c5ddb2908346a7c61ef93b59a3ca
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.
https://github.com/vim/vim/commit/679d66c2d21dfe03d0f89b9a818b0aaebb4c3b87
Use CheckScriptFailure() instead of v9.CheckScriptFailure().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/459
|
|\
| |
| | |
refactor: replace char_u with char 14: remove `STRLEN` part final
|
| |
| |
| |
| | |
Work on https://github.com/neovim/neovim/issues/459
|
|/
|
|
|
|
|
|
|
|
| |
inefficient (#21198)
Problem: Trying every character position for a match is inefficient.
Solution: Use the start position of the match ignoring "\zs".
https://github.com/vim/vim/commit/01105b37a108022515d364201767f7f111ec4222
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
Problem: Several lines of code are duplicated.
Solution: Move duplicated code to a function. (Yegappan Lakshmanan,
closes vim/vim#5330)
https://github.com/vim/vim/commit/f4140488c72cad4dbf5449dba099cfa7de7bbb22
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, closes vim/vim#10439)
https://github.com/vim/vim/commit/360da40b47a84ee8586c3b5d062f8c64a2ac9cc6
Co-authored-by: Christian Brabandt <cb@256bit.org>
|