| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: vim_strnchr() is strange and unnecessary (after v9.1.1009)
Solution: Remove vim_strnchr() and use memchr() instead. Also remove a
comment referencing an #if that is no longer present.
vim_strnchr() is strange in several ways:
- It's named like vim_strchr(), but unlike vim_strchr() it doesn't
support finding a multibyte char.
- Its logic is similar to vim_strbyte(), but unlike vim_strbyte() it
uses char instead of char_u.
- It takes a pointer as its size argument, which isn't convenient for
all its callers.
- It allows embedded NULs, unlike other "strn*" functions which stop
when encountering a NUL byte.
In comparison, memchr() also allows embedded NULs, and it converts bytes
in the string to (unsigned char).
closes: vim/vim#16579
https://github.com/vim/vim/commit/34e1e8de91ff4a8922d454e3147ea425784aa0a0
|
|
|
| |
Result of `make iwyu` (after some "fixups").
|
|
|
|
|
|
|
| |
Problem:
Casting long to int introduces risk of overflow.
Solution:
Work with all int64_t (long) rather than casting back and forth.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Linematch used to use strchr to navigate a string, however strchr does
not supoprt embedded NULs.
Solution:
Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`.
Also remove heap allocations from `matching_char_iwhite()`
Fixes: #30505
|
|
|
|
|
|
|
|
|
|
|
| |
(#29907)
Problem: E1510 may happen when formatting a message
(after 9.1.0181).
Solution: Only give E1510 when using typval. (zeertzjq)
closes: vim/vim#15391
https://github.com/vim/vim/commit/0dff31576a340b74cec81517912923c38cb28450
|
|
|
| |
Also add test for using printf() and id() with a Blob.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: No test for escaping '<' with shellescape()
Solution: Add a test. Use memcpy() in code to make it easier to
understand. Fix a typo (zeertzjq).
closes: vim/vim#14876
https://github.com/vim/vim/commit/88c8c547d5fc380e5685c2b01ec564ccdf9b259a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: MS-Windows: Compiler warnings
Solution: Resolve size_t to int warnings
closes: vim/vim#14874
A couple of warnings in ex_docmd.c have been resolved by modifying their
function argument types, followed by some changes in various function
call sites. This also allowed removal of some casts to cope with
size_t/int conversion.
https://github.com/vim/vim/commit/51024bbc1a9e298b1fb8f2e465fccb5db409551e
Co-authored-by: Mike Williams <mrmrdubya@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: too many strlen() calls in the regexp engine
Solution: refactor code to retrieve strlen differently, make use
of bsearch() for getting the character class
(John Marriott)
closes: vim/vim#14648
https://github.com/vim/vim/commit/82792db6315f7c7b0e299cdde1566f2932a463f8
Cherry-pick keyvalue_T and its comparison functions from patch 9.1.0256.
vim-patch:9.1.0410: warning about uninitialized variable
vim-patch:9.1.0412: typo in regexp_bt.c in DEBUG code
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: no overflow check for string formatting
Solution: Check message formatting function for overflow.
(Chris van Willegen)
closes: vim/vim#13799
https://github.com/vim/vim/commit/c35fc03dbd47582b256776fb11f11d8ceb24f8f0
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
|
|
|
|
|
| |
Current uses of vim_strup() calls memcpy()/strcpy() before calling vim_strup().
This results in 2 * strlen(string) operations.
We can trivially convert to lowercase while copying the string instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, we needed to always pack an entire msgpack_rpc Object to
a continous memory buffer before sending it out to a channel.
But this is generally wasteful. it is better to just flush
whatever is in the buffer and then continue packing to a new buffer.
This is also done for the UI event packer where there are some extra logic
to "finish" of an existing batch of nevents/ncalls. This doesn't really
stop us from flushing the buffer, just that we need to update the state
machine accordingly so the next call to prepare_call() always will
start with a new event (even though the buffer might contain overflow
data from a large event).
|
| |
|
|
|
|
| |
Problem: Double xmalloc usage led to excess memory allocations.
Solution: Switch to xrealloc to adjust memory as needed, minimizing allocations.
|
|
|
|
|
|
| |
Remove `export` pramgas from defs headers as it causes IWYU to believe
that the definitions from the defs headers comes from main header, which
is not what we really want.
|
| |
|
| |
|
|
|
|
|
| |
Specifically, specify that each initialization should be done on a
separate line.
|
|
|
|
|
|
| |
FUNC_ATTR_* should only be used in .c files with generated headers.
Defining FUNC_ATTR_* as empty in headers causes misuses of them to be
silently ignored. Instead don't define them by default, and only define
them as empty after a .c file has included its generated header.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
|
|
|
|
|
| |
- reduce variable scope
- prefer initialization over declaration and assignment
|
|
|
|
|
|
| |
- reduce variable scope
- prefer initialization over declaration and assignment
- use bool to represent boolean values
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
When the given length is exactly the number of bytes to copy, xmemdupz()
makes the intention clearer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: trim(): hard to use default mask (partly revert v9.0.2040)
Solution: use default mask when it is empty
The default 'mask' value is pretty complex, as it includes many
characters. Yet, if one needs to specify the trimming direction, the
third argument, 'trim()' currently requires the 'mask' value to be
provided explicitly.
Currently, an empty 'mask' will make 'trim()' call return 'text' value
that is passed in unmodified. It is unlikely that someone is using it,
so the chances of scripts being broken by this change are low.
Also, this reverts commit 9.0.2040 (which uses v:none for the default
and requires to use an empty string instead).
closes: vim/vim#13358
https://github.com/vim/vim/commit/8079917447e7436dccc2e4cd4a4a56ae0a4712f2
vim-patch:9.0.2040: trim(): hard to use default mask
Problem: trim(): hard to use default mask
Solution: Use default 'mask' when it is v:none
The default 'mask' value is pretty complex, as it includes many
characters. Yet, if one needs to specify the trimming direction, the
third argument, 'trim()' currently requires the 'mask' value to be
provided explicitly.
'v:none' is already used to mean "use the default argument value" in
user defined functions. See |none-function_argument| in help.
closes: vim/vim#13363
https://github.com/vim/vim/commit/6e6386716f9494ae86027c6d34f657fd03dfec42
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Some unused code in move.c and string.c
Solution: Remove it
closes: vim/vim#13288
https://github.com/vim/vim/commit/580c1fcb4ad85360cd3a361c3c8e37b534153d60
Co-authored-by: dundargoc <gocdundar@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: strange error number
Solution: change error number,
add doc tag for E1507
closes: vim/vim#13270
https://github.com/vim/vim/commit/ea746f9e862092aef3d4e95c64d116759b9fabe0
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Vim9: error codes spread out
Solution: group them together and reserve 100
more for future use
Reserve 100 error codes for future enhancements to the Vim9 class
support
closes: vim/vim#13207
https://github.com/vim/vim/commit/413f83990f15d5d59d27ab741670f527a7a3feb8
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|
|
|
|
|
|
|
|
|
| |
Problem: Wrong order of arguments for error messages
Solution: Reverse order or arguments for e_aptypes_is_null_nr_str
closes: vim/vim#13051
https://github.com/vim/vim/commit/1bd2cb11694690a77e4141bce2e34d9dfb882f1c
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
|
|
|
|
|
|
|
| |
Problem: wrong format specifiers in e_aptypes_is_null_str_nr
Solution: Fix the wrong format specifier
closes: vim/vim#13020
https://github.com/vim/vim/commit/7db89bdc23e53c7bc43af6f1c7281bc69a6a3098
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: issues with formatting positional arguments
Solution: fix them, add tests and documentation
closes: vim/vim#12140
closes: vim/vim#12985
Tentatively fix message_test. Check NULL ptr.
https://github.com/vim/vim/commit/aa90d4f031f73a34aaef5746931ea746849a2231
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: reverse() does not work for a String.
Solution: Implement reverse() for a String. (Yegappan Lakshmanan,
closes vim/vim#12179)
https://github.com/vim/vim/commit/03ff1c2dde7f15eca5c9baa6dafbda9b49bedc3b
vim-patch:9.0.1738: Duplicate code to reverse a string
Problem: Duplicate code to reverse a string
Solution: Move reverse_text() to strings.c and remove string_reverse().
closes: vim/vim#12847
https://github.com/vim/vim/commit/4dd266cb66d901cf5324f09405cfea3f004bd29f
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting
closes: vim/vim#12140
https://github.com/vim/vim/commit/0c6181fec4c362eb9682d5af583341eb20cb1af5
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* perf(rtp): reduce rtp scans
Problem:
Scanning the filesystem is expensive and particularly affects
startuptime.
Solution:
Reduce the amount of redundant directory scans by relying less on glob
patterns and handle vim and lua sourcing lower down.
|
|
|
|
| |
followup to #24109
fix #16150
|
|
|
|
|
|
|
|
| |
Problem: Having utf16idx() rounding up is inconvenient.
Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523)
https://github.com/vim/vim/commit/95707037afa1aeae4f3494dc623a721ceed7fc4e
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|
|
|
|
|
|
|
|
|
| |
Problem: charidx() and utf16idx() result is not consistent with byteidx().
Solution: When the index is equal to the length of the text return the
lenght of the text instead of -1. (Yegappan Lakshmanan,
closes vim/vim#12503)
https://github.com/vim/vim/commit/577922b917e48285a7a312daf7b5bbc6e272939c
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
|
|
|
|
|
|
| |
Problem: Passing -1 for bool is not always rejected.
Solution: Check for error in a better way. (closes vim/vim#12358)
https://github.com/vim/vim/commit/8cf51376b842e0060edf08bd2e5bd9933c552ecf
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Some functions give two error messages.
Solution: Do not give a second error message. (closes vim/vim#12352)
https://github.com/vim/vim/commit/e4098457ab9c94225b1b0e3c5e06b82b75587971
It seems that tv_get_bool() is actually not exactly the same as
tv_get_number(), so change it to a function instead.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
Problem: strcharpart() cannot include composing characters.
Solution: Add the {skipcc} argument.
https://github.com/vim/vim/commit/02b4d9b18a03549b68e364e428392b7a62766c74
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
| |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|