Brandon Maier [Wed, 18 Dec 2024 20:18:01 +0000 (21:18 +0100)]
patch 9.1.0946: cross-compiling fails on osx-arm64
Problem: cross-compiling fails on osx-arm64
Solution: use vim_cv_timer_create_with_lrt() instead of
vim_cv_timer_create_works() (Brandon Maier)
Cross-compiling to osx-arm64 fails with the following
In file included from json.c:17:
In file included from ./vim.h:457:
./macros.h:304:24: error: expected identifier or '('
304 | static inline int isnan(double x)
| ^
.../MacOSX11.0.sdk/usr/include/math.h:165:7: note: expanded from macro 'isnan'
165 | ( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x))
| ^
This can be traced back to ./configure incorrectly detecting the
compiler support for `isnan()`, from the config.log:
configure:14567: checking for isnan()
configure:14588: arm64-apple-darwin20.0.0-clang <...> -L$PREFIX/lib conftest.c -lncurses -ltinfo -lrt >&5
ld: library not found for -lrt
arm64-apple-darwin20.0: error: linker command failed with exit code 1 (use -v to see invocation)
The `-lrt` linking is added by ./configure script when it detects
compiler support for `timer_create()`. On the osx-arm64 platform
`timer_create()` works but does not link with `-lrt`. This results in
the following settings from config.log:
zeertzjq [Wed, 18 Dec 2024 20:12:25 +0000 (21:12 +0100)]
patch 9.1.0945: ComplMatchIns highlight doesn't end after inserted text
Problem: ComplMatchIns highlight doesn't end after inserted text.
Solution: Handle ComplMatchIns highlight more like search highlight.
Fix off-by-one error. Handle deleting text properly.
(zeertzjq)
closes: #16244
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This partly reverts commit 98874dca6d0b60ccd6fc3a140b3ec1cc3e560f95,
but keeps the added changes from #16240, since the re-generated sv.po
file fails the Vim check.vim script in the CI test suite.
patch 9.1.0938: exclusive selection not respected when re-selecting block mode
Problem: exclusive selection not respected when re-selecting block mode
(Matt Ellis)
Solution: advance selection by another character when using
selection=exclusive and visual block mode
Aliaksei Budavei [Mon, 16 Dec 2024 20:37:54 +0000 (21:37 +0100)]
patch 9.1.0935: SpotBugs compiler can be improved
Problem: SpotBugs compiler can be improved
Solution: runtime(compiler): Improve defaults and error handling for
SpotBugs; update test_compiler.vim (Aliaksei Budavei)
runtime(compiler): Improve defaults and error handling for SpotBugs
* Keep "spotbugs#DefaultPreCompilerTestAction()" defined but
do not assign its Funcref to the "PreCompilerTestAction"
key of "g:spotbugs_properties": there are no default and
there can only be introduced arbitrary "*sourceDirPath"
entries; therefore, this assignment is confusing at best,
given that the function's implementation delegates to
whatever "PreCompilerAction" is.
* Allow for the possibility of relative source pathnames
passed as arguments to Vim for the Javac default actions,
and the necessity to have them properly reconciled when
the current working directory is changed.
* Do not expect users to remember or know that new source
files ‘must be’ ":argadd"'d to be then known to the Javac
default actions; so collect the names of Java-file buffers
and Java-file Vim arguments; and let users providing the
"@sources" file-lists in the "g:javac_makeprg_params"
variable update these file-lists themselves.
* Strive to not leave behind a fire-once Syntax ":autocmd"
for a Java buffer whenever an arbitrary pre-compile action
errors out.
* Only attempt to run a post-compiler action in the absence
of failures for a pre-compiler action. Note that warnings
and failures are treated alike (?!) by the Javac compiler,
so when previews are tried out with "--enable-preview",
remember about passing "-Xlint:-preview" too to also let
SpotBugs have a go.
* Properly group conditional operators when testing for key
entries in a user-defined variable.
* Also test whether "javaExternal" is defined when choosing
an implementation for source-file parsing.
* Two commands are provided to toggle actions for buffer-local
autocommands:
- SpotBugsRemoveBufferAutocmd;
- SpotBugsDefineBufferAutocmd.
For example, try this from "~/.vim/after/ftplugin/java.vim":
------------------------------------------------------------
if exists(':SpotBugsDefineBufferAutocmd') == 2
SpotBugsDefineBufferAutocmd BufWritePost SigUSR1
endif
------------------------------------------------------------
And ":doautocmd java_spotbugs User" can be manually used at will.
closes: #16140
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: new Italian tutor not installed
Solution: add Makefile rule, include it into the Filelist
("Philip H." <47042125+pheiduck@users.noreply.github.com>),
update the tutors help file
closes: #16215
Co-authored-by: Philip H. <47042125+pheiduck@users.noreply.github.com> Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.0928: tests: test_popupwin fails because the filter command fails
Problem: tests: test_popupwin fails because the filter command fails
Solution: add the "e" flag to the :s command to normalize the
screendumps Last Change header so that it doesn't fail on
"Pattern not found"
The test might still fail, because the "Last Change" hader should always
be part of the screendump, but at least the filter command should not
cause aborting of the test script.
patch 9.1.0925: Vim9: expression compiled when not necessary
Problem: Vim9: expression compiled when not necessary
Solution: do not compile when ctx_skip is set, add a few more
Vim9 expressions tests (Yegappan Lakshmanan)
closes: #16218
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
John Marriott [Fri, 13 Dec 2024 12:58:53 +0000 (13:58 +0100)]
patch 9.1.0923: too many strlen() calls in filepath.c
Problem: too many strlen() calls in filepath.c
Solution: refactor filepath.c and remove calls to STRLEN(),
unify dos_expandpath() and unix_expandpath() into
a single function
closes: #16160
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
glepnir [Fri, 13 Dec 2024 11:13:23 +0000 (12:13 +0100)]
patch 9.1.0921: popupmenu logic is a bit convoluted
Problem: popupmenu logic is a bit convoluted
Solution: slightly refactor logic and use MIN/MAX() macros to simplify
(glepnir)
Define the MAX/MIN macros. Since we support some older platforms, C
compilers may not be as smart. This helps reduce unnecessary if
statements and redundant ternary expressions. Pre-calculate some
expressions by defining variables. Remove unnecessary parentheses.
Adjust certain lines to avoid exceeding 80 columns.
closes: #16205
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Gary Johnson [Mon, 9 Dec 2024 20:03:48 +0000 (21:03 +0100)]
patch 9.1.0917: various vartabstop and shiftround bugs when shifting lines
Problem: various vartabstop and shiftround bugs when shifting lines
Solution: Fix the bugs, add new tests for shifting lines in various ways
(Gary Johnson)
fixes: #14891
closes: #16193
Signed-off-by: Gary Johnson <garyjohn@spocom.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.0912: xxd: integer overflow with sparse files and -autoskip
Problem: xxd: integer overflow with sparse files and -autoskip
Solution: reset zero_seen when at the limit, change the type to char
(sendittothenewts)
When encountering INT_MAX lines of zeros in the input, xxd overflows an
`int` counter, resulting in undefined behaviour. Usually, this results
in a spurious line of zeros being output every 2**32 lines, while the
"*" line is lost, as is the final line of zeros that delineate the file
size if at end of file.
Since xxd doesn't need to know exactly how many lines are being skipped
when it's > 3, the exact value of the line counter `zero_seen` doesn't
matter and it can simply be reduced in value before the overflow occurs.
Changing the type of `zero_seen` to `signed char` is not important, and
done only to make the bug triggerable with more modest file sizes, and
therefore more convenient to test the fix.
fixes: #16170
closes: #16175
Signed-off-by: sendittothenewts <ross.axe@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Sat, 7 Dec 2024 15:09:08 +0000 (16:09 +0100)]
patch 9.1.0911: Variable name for 'messagesopt' doesn't match short name
Problem: Variable name for 'messagesopt' doesn't match short name
(after v9.1.0908)
Solution: Change p_meo to p_mopt. Add more details to docs.
(zeertzjq)
closes: #16182
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Zdenek Dohnal [Wed, 4 Dec 2024 19:19:40 +0000 (20:19 +0100)]
patch 9.1.0904: Vim9: copy-paste error in class_defining_member()
Problem: Vim9: copy-paste error in class_defining_member()
Solution: use variable type VAR_CLASS instead (Zdenek Dohnal)
Found issue by OpenScanHub:
Error: COPY_PASTE_ERROR (CWE-398):
vim91/src/vim9class.c:3308: original: "VAR_OBJECT" looks like the
original copy.
vim91/src/vim9class.c:3316: copy_paste_error: "VAR_OBJECT" looks like a
copy-paste error.
vim91/src/vim9class.c:3316: remediation: Should it say "VAR_CLASS"
instead?
3314| {
3315| cl_tmp = super;
3316|-> vartype = VAR_OBJECT;
3317| }
3318| }
closes: #16163
Signed-off-by: Zdenek Dohnal <zdohnal@redhat.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Zdenek Dohnal [Wed, 4 Dec 2024 19:16:17 +0000 (20:16 +0100)]
patch 9.1.0903: potential overflow in spell_soundfold_wsal()
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>
D. Ben Knoble [Sun, 1 Dec 2024 15:06:18 +0000 (16:06 +0100)]
runtime(helptoc): reload cached g:helptoc.shell_prompt when starting toc
Follow up on PR 10446 [1] so that changes at run-time (or after loading
a vimrc) are reflected at next use. Instead of "uncaching" the variable
by computing SHELL_PROMPT on each use, which could negatively impact
performance, reload any user settings before creating the TOC.
Also make sure, changes to the shell prompt variable do correctly
invalidate b:toc, so that the table of content is correctly re-created
after user makes any changes.