Problem: not possible to generate completion candidates using fuzzy
matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
modes (glepnir)
fixes#15296fixes#15295fixes#15294closes: #16032
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: potential overflow in spell_soundfold_wsal()
Solution: Protect wres from buffer overflow, by checking the
length (Zdenek Dohnal)
Error: OVERRUN (CWE-119):
vim91/src/spell.c:3819: cond_const: Checking "reslen < 254" implies that
"reslen" is 254 on the false branch.
vim91/src/spell.c:3833: incr: Incrementing "reslen". The value of "reslen"
is now 255.
vim91/src/spell.c:3792: overrun-local: Overrunning array "wres" of 254
4-byte elements at element index 254 (byte offset 1019) using index
"reslen - 1" (which evaluates to 254).
3789| {
3790| // rule with '<' is used
3791|-> if (reslen > 0 && ws != NULL && *ws != NUL
3792| && (wres[reslen - 1] == c
3793| || wres[reslen - 1] == *ws))
Error: OVERRUN (CWE-119):
vim91/src/spell.c:3819: cond_const: Checking "reslen < 254" implies that
"reslen" is 254 on the false branch.
vim91/src/spell.c:3833: overrun-local: Overrunning array "wres" of 254
4-byte elements at element index 254 (byte offset 1019) using index
"reslen++" (which evaluates to 254).
3831| {
3832| if (c != NUL)
3833|-> wres[reslen++] = c;
3834| mch_memmove(word, word + i + 1,
3835| sizeof(int) * (wordlen -
(i + 1) + 1));
related: #16163
Signed-off-by: Zdenek Dohnal <zdohnal@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in search.c
Solution: refactor code and remove more strlen() calls,
use explicit variable to remember strlen
(John Marriott)
closes: #14796
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot move to previous/next rare word
(Colin Kennedy)
Solution: Add the ]r and [r motions (Christ van Willegen)
fixes: #14773closes: #14780
Signed-off-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not
set ml_line_textlen in ml_replace_len() if "has_props" is set,
because "len_arg" also includes the size of text properties in
that case. (zeertzjq)
closes: #14183
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: camel-case spelling has issues with digits
Solution: Improve the camCase spell checking by taking digits
and caps into account
Rewrite the conditions to check for word boundaries by taking into
account the presence of digits and all-caps sequences such as acronyms.
closes: #12644closes: #12933
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: dict-completion does not respect region
Solution: respect selected region in dict completion
Set do_region to zero as we don't want a complete dump of the matching
words, we want the code to filter them according to the user's selected
region.
closes: #12792closes: #7025
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: SpellCap highlight not always updated when needed.
Solution: Handle updating line below closed fold and other situations where
only part of the window is redrawn. (Luuk van Baal, closes#12428,
closes#12420)
Problem: The did_set_string_option function is too long.
Solution: Split off functionality to individual functions. (Yegappan
Lakshmanan, Lewis Russell, closes#11904)
Problem: After exiting Insert mode spelling is not checked in the next
line.
Solution: When spelling is enabled redraw the next line after exiting Insert
mode in case the spell highlight needs updating.
Problem: Cannot assign a lambda to an option that takes a function.
Solution: Automatically convert the lambda to a string. (Yegappan
Lakshmanan, closes#9286)
Problem: Greek spell checking uses wrong case folding.
Solution: Fold capital sigma depending on whether it is at the end of a
word or not. (closes#299)
Problem: Invalid memory use when using SpellFileMissing autocmd.
Solution: Add test case. (Dominique Pellé, closes#7036) Fix using a window
that was closed.
Problem: Highlighting for :s wrong when using different separator.
Solution: Use separat argument for search direction and separator. (Rob
Pilling, closes#5665)