Age | Commit message (Collapse) | Author |
|
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: <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)
closes: #14095
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: upper-case of ß should be U+1E9E (CAPITAL LETTER SHARP S)
(fenuks)
Solution: Make gU, ~ and g~ convert the U+00DF LATIN SMALL LETTER SHARP S (ß)
to U+1E9E LATIN CAPITAL LETTER SHARP S (ẞ), update tests
(glepnir)
This is part of Unicode 5.1.0 from April 2008, so should be fairly safe
to use now and since 2017 is part of the German standard orthography,
according to Wikipedia:
https://en.wikipedia.org/wiki/Capital_%E1%BA%9E#cite_note-auto-12
There is however one exception: UnicodeData.txt for U+00DF
LATIN SMALL LETTER SHARP S does NOT define U+1E9E LATIN CAPITAL LETTER
SHARP S as its upper case version. Therefore, toupper() won't be able
to convert from lower sharp s to upper case sharp s (the other way
around however works, since U+00DF is considered the lower case
character of U+1E9E and therefore tolower() works correctly for the
upper case version).
fixes: #5573
closes: #14018
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: qsort() comparison functions should be transitive
Solution: Do not subtract values, but rather use explicit comparisons
Improve qsort() comparison functions
There has been a recent report on qsort() causing out-of-bounds read &
write in glibc for non transitive comparison functions
https://www.qualys.com/2024/01/30/qsort.txt
Even so the bug is in glibc's implementation of the qsort() algorithm,
it's bad style to just use substraction for the comparison functions,
which may cause overflow issues and as hinted at in OpenBSD's manual
page for qsort(): "It is almost always an error to use subtraction to
compute the return value of the comparison function."
So check the qsort() comparison functions and change them to be safe.
closes: #13980
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: is*() and to*() function may be unsafe
Solution: Add SAFE_* macros and start using those instead
(Keith Thompson)
Use SAFE_() macros for is*() and to*() functions
The standard is*() and to*() functions declared in <ctype.h> have
undefined behavior for negative arguments other than EOF. If plain char
is signed, passing an unchecked value from argv for from user input
to one of these functions has undefined behavior.
Solution: Add SAFE_*() macros that cast the argument to unsigned char.
Most implementations behave sanely for negative arguments, and most
character values in practice are non-negative, but it's still best
to avoid undefined behavior.
The change from #13347 has been omitted, as this has already been
separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a
(v9.0.2054)
fixes: #13332
closes: #13347
Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Unicode tables outdated
Solution: Update Unicode tables to v15.1 (released 23.09.2023)
closes: #13311
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: cannot complete option values
Solution: Add completion functions for several options
Add cmdline tab-completion for setting string options
Add tab-completion for setting string options on the cmdline using
`:set=` (along with `:set+=` and `:set-=`).
The existing tab completion for setting options currently only works
when nothing is typed yet, and it only fills in with the existing value,
e.g. when the user does `:set diffopt=<Tab>` it will be completed to
`set diffopt=internal,filler,closeoff` and nothing else. This isn't too
useful as a user usually wants auto-complete to suggest all the possible
values, such as 'iblank', or 'algorithm:patience'.
For set= and set+=, this adds a new optional callback function for each
option that can be invoked when doing completion. This allows for each
option to have control over how completion works. For example, in
'diffopt', it will suggest the default enumeration, but if `algorithm:`
is selected, it will further suggest different algorithm types like
'meyers' and 'patience'. When using set=, the existing option value will
be filled in as the first choice to preserve the existing behavior. When
using set+= this won't happen as it doesn't make sense.
For flag list options (e.g. 'mouse' and 'guioptions'), completion will
take into account existing typed values (and in the case of set+=, the
existing option value) to make sure it doesn't suggest duplicates.
For set-=, there is a new `ExpandSettingSubtract` function which will
handle flag list and comma-separated options smartly, by only suggesting
values that currently exist in the option.
Note that Vim has some existing code that adds special handling for
'filetype', 'syntax', and misc dir options like 'backupdir'. This change
preserves them as they already work, instead of converting to the new
callback API for each option.
closes: #13182
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
|
|
Problem: Various Typos
Solution: Fix Typos
This is a collection of typo related commits.
closes: #12753
closes: #13016
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes #12104)
|
|
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
|
|
Problem: Cannot use setcellwidths() below 0x100.
Solution: Also accept characters between 0x80 and 0x100. (Ken Takata,
closes #11834)
|
|
Problem: Coverity warns for ignoring return value.
Solution: Break out of loop if function fails.
|
|
Problem: Cannot read back what setcellwidths() has done.
Solution: Add getcellwidths(). (Kota Kato, closes #11837)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11813)
|
|
Problem: Screen is not redrawn after using setcellwidths().
Solution: Redraw the screen when the cell widths have changed. (Yasuhiro
Matsumoto, closes #11800)
|
|
Problem: Unicode range for Apple SF symbols is outdated.
Solution: Update to SF Symbols 4. (Yee Cheng Chin, closes #11474)
|
|
Problem: Spacing-combining characters handled as composing, causing text to
take more space than expected.
Solution: Handle characters marked with "Mc" not as composing.
(closes #11282
|
|
Problem: Unicode tables are outdated.
Solution: Update to Unicode release 15. (Christian Brabandt, closes #11220)
|
|
Problem: Clang static analyzer gives warnings.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #11043)
|
|
Problem: Error message for list argument could be clearer.
Solution: Include the argument number. (Yegappan Lakshmanan, closes #11027)
|
|
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL.
|
|
Problem: Checking character options is duplicated and incomplete.
Solution: Move checking to check_chars_options(). (closes #10863)
|
|
Problem: Use of set_chars_option() is confusing.
Solution: Add "apply" argument to store the result or not. Merge similar
code.
|
|
Problem: 'fillchars' cannot have window-local values.
Solution: Make 'fillchars' global-local. (closes #5206)
|
|
Problem: Clang on MS-Windows produces warnings.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10546)
|
|
Problem: Can add invalid bytes with :spellgood.
Solution: Check for a valid word string.
|
|
Problem: Build problem for Cygwin with Motif.
Solution: Undefine ControlMask. (Kelvin Lee, closes #10152)
|
|
Problem: Accepting "iso8859" 'encoding' as "iso-8859-".
Solution: use "iso8859" as "iso-8859-1".
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
|
|
Problem: Various comments could be improved.
Solution: Improve the comments.
|
|
Problem: Some unicode control characters are considered printable.
Solution: Make 0x2060 - 0x2069 not printable.
|
|
Problem: setcellwidths() may make 'listchars' or 'fillchars' invalid.
Solution: Check the value and give an error. (closes #9024)
|
|
Problem: Vim9: runtime and compile time type checks are not the same.
Solution: Add more runtime type checks for builtin functions. (Yegappan
Lakshmanan, closes #8646)
|
|
Problem: Dynamic library load error does not mention why it failed.
Solution: Add the error message. (Martin Tournoij, closes #8621)
|
|
Problem: Functions for string manipulation are spread out.
Solution: Move string related functions to a new source file. (Yegappan
Lakshmanan, closes #8470)
|
|
Problem: Crash when passing null string to charclass().
Solution: Bail out when string pointer is NULL. (Christian Brabandt,
closes #8498, closes #8260)
|
|
Problem: Unicode tables are slightly outdated.
Solution: Update the tables for Unicode release 13. (Christian Brabandt
closes #8430)
|
|
Problem: 'fileencodings' default value should depend on 'encoding'. (Gary
Johnson)
Solution: When 'encoding' is "utf-8" use a different default value for
'fileencodings'.
|
|
Problem: When 'clipboard' is "unnamed" zp and zP do not work correctly.
Solution: Pass -1 to str_to_reg() and fix computing the character width
instead of using the byte length. (Christian Brabandt,
closes #8301, closes #8317)
|
|
Problem: Computing array length is done in various ways.
Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes #8305)
|
|
Problem: MS-Windows: when using "default" for encoding utf-8 is used.
Solution: Use the system encoding. (Ken Takata, closes #8300)
|
|
Problem: MS-Windows: most users expect using Unicode.
Solution: Default 'encoding' to utf-8 on MS-Windows. (Ken Takata,
closes #3907)
|
|
Problem: Mac: SF symbols are not displayed properly.
Solution: Add custom range to list of double-width characters. (Yee Cheng
Chin, closes #8077)
|
|
Problem: Vim9: not enough function arguments checked for string.
Solution: Check in balloon functions. Refactor function arguments.
|
|
Problem: Vim9: error for not using string doesn't mention argument.
Solution: Add argument number.
|
|
Problem: Build error with +eval feature but without +spell.
Solution: Adjust #ifdef. (John Marriott)
|
|
Problem: Some functions use any value as a string.
Solution: Check that the value is a non-empty string.
|
|
Problem: Various comment problems.
Solution: Update comments.
|