Both latin-1 and utf-8 versions are included.
closes: #17245
Signed-off-by: fernandovilarino <fernando@cvc.uab.es>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: Possible to open more windows into a closing
buffer without splitting, bypassing existing "b_locked_split"
checks and triggering use-after-free
Solution: Disallow switching to a closing buffer. Editing a closing
buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an
error message and check just "b_locked_split", as "b_locked"
is necessary only when the buffer shouldn't be wiped, and may
be set for buffers that are in-use but not actually closing.
(Sean Dewar)
closes: #17246
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype. Only
allow '#' as start of comment in confini syntax (zeertzjq).
Ref:
- https://wiki.gnuradio.org/index.php/Configuration_Filescloses: #17242
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_lua: compile warnings with gcc15
Solution: update function prototypes (lilydjwg)
see also https://github.com/ruby/ruby/pull/13202.
closes: #17243
Signed-off-by: lilydjwg <lilydjwg@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match enum values and missing class keywords.
fixes: #15970
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- :helptags is also a tags generating program, it deserves mentioning
- JTags seems too dead: its website has been sold, the source, binary
can't be found anywhere.
- update link of ptags
closes: #17233
Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim incorrectly escapes tags containing "[" in a help buffer
Solution: check if the buffer has the "help" filetype set, instead of
already being a help buffer (Phạm Bình An)
fixes: #17224closes: #17232
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The pum_redraw function is too complex and difficult to
maintain with nested loops and mixed responsibilities handling
both RTL and LTR text rendering.
Solution: Extracted core rendering logic into dedicated helper functions
(pum_display_rtl_text, pum_display_ltr_text, pum_draw_scrollbar,
pum_process_item) while preserving the original behavior. This
improves code readability and maintainability (glepnir).
closes: #17204
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_terminalwinscroll_topline() fails on Windows
(after v9.1.1348)
Solution: instead of disabling it in Github Actions runners, disable it
for all Windows runs
related: #17196
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Return value of getcmdline() inconsistent in CmdlineLeavePre
when leaving cmdline in different ways (after v9.1.1329).
Solution: Trigger CmdlineLeavePre before calling abandon_cmdline() so
that getcmdline() can return the command line (zeertzjq).
closes: #17218
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: typo in Test_CmdlineLeavePre_cabbr()
(after v9.1.1349)
Solution: fix typo, disable failing test on Windows for now
(Girish Palya)
closes: #17217
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
HTML tags in Javadoc comments can additionally be folded
after applying
------------------------------------------------------------
let g:html_syntax_folding = 1
set foldmethod=syntax
------------------------------------------------------------
and giving explicit consent with
------------------------------------------------------------
let g:java_consent_to_html_syntax_folding = 1
------------------------------------------------------------
Do not default to this kind of folding unless ALL start tags
and optional end tags are balanced in Javadoc comments;
otherwise, put up with creating runaway folds that break
syntax highlighting.
resolves: zzzyxwvut/java-vim#8.
closes: #17216
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: CmdlineLeavePre may trigger twice
(after v9.1.1329)
Solution: check that the key was typed, trigger it when it wasn't before
(Girish Palya)
There are two problems:
- CmdlineLeavePre may be triggered twice when a cabbr is present.
- CmdlineLeavePre fails to trigger when exiting the command-line via
<Backspace>.
Check if the Carriage Return (Enter) key was actually typed.
Trigger the event when the command-line is exited using Backspace and
other keys.
closes: #17214
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match Vim9 comments at start-of-line (no leading whitespace) in
dictionaries, lists and parenthesised expressions and argument lists.
Addresses https://github.com/vim/vim/pull/14975#issuecomment-2832643115
Report and fix by Aliaksei Budavei.
closes: #17211
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: small problems with gui_w32.c
Solution: fix compile warnings and refactor code (John Marriott)
Compiler (clang v20.1.3) warnings on `_OnMenuSelect()` and
`_OnGetDpiScaledSize()`:
```
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601
-DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
-pipe -Wall -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Wstrict-prototypes
-Wmissing-prototypes -Wno-deprecated-declarations
-Wno-error=missing-field-initializers -Werror=uninitialized
-Wunused-but-set-variable -DEXITFREE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD
gui_w32.c -o gobjx86-64/gui_w32.o
gui_w32.c:5038:55: warning: comparison of integers of different signs:
'UINT' (aka 'unsigned int') and 'int' [-Wsign-compare]
5038 | && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
gui_w32.c:5054:26: warning: unused parameter 'hwnd' [-Wunused-parameter]
5054 | _OnGetDpiScaledSize(HWND hwnd, UINT dpi, SIZE *size)
| ^
2 warnings generated.
```
This commit contains the following changes:
- Fixes Warning 1:
The prototype of `GetMenuState()` says that it returns a UINT, but
returns -1 on failure. Huh?!?
Also, Microsoft says that this function has been superseded (see
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmenustate)
and replaced by `GetMenuItemInfo()`. Both of these functions have a
minimum support of Windows 2000.
Therefore in `_OnMenuSelect()`, replace the call to `GetMenuState()`
with `GetMenuItemInfo()`.
- Fixes Warning 2:
Add `UNUSED` to the definition of `_OnGetDpiScaledSize()`.
- Simplify `logfont2name()`.
- Add small optimisations in `_OnNotify()` and `gui_mch_do_spawn()`.
- Add out-of-memory check in `gui_mch_do_spawn()`.
- Code cosmetics (see definitions of `process_message_usual_key_classic()`
and `process_message()`).
closes: #17208
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
clarify complete_match() documentation to better explain its backward
search behavior, argument handling, and return value format and add an
example of isexpand
closes: #17212
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Continued strings are currently only matched after operators, in
parenthesised expressions and in function call argument lists.
closes: #14975
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: missing out-of-memory check in textformat.c
Solution: add out-of-memory check, add small optimizations to
internal_format() and same_leader() (John Marriott)
closes: #17200
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_xxd_color2() test failure dump diff is misleading
Solution: Ensure the reference dump and the test dump are both processed the
same (Drew Vogel).
Background:
Commit b6dc76b6fd23e571d309064b795847ee9ffc7689 sought to make the xxd
screendump tests compatible with non-standard `XXD` overrides. It provides a
vim script that matches a very general `xxd` command pattern but then also
removed the matching line from the reference dump. This second step was
unnecessary because `VerifyScreenDump()` runs the associated vim script against
both the reference dump and the test dump.
Problem Details:
As part of some unrelated work, the GUI tests were failing with a window size 1
column too narrow. The screendumps in `Test_xxd_color2` were failing as a
result. When I loaded the diff using `term_dumpdiff()` the associated vim
scripts are not run. As a result, the test dump contained the `xxd` invocation
on line 1 while reference dump did not. This throws the diff off, obscuring the
true issue of the GUI window being too narrow.
Verification:
In addition to the test suite, locally I've tried to recreate the issue being
fixed in b6dc76b6fd23e571d309064b795847ee9ffc7689. Setting a very non-standard
`XXD` path, this test still passes:
```
XXD=/home/dvogel/opt/vim/bin/xxd TEST_FILTER=Test_xxd_color2 TERM=xterm-color make test_xxd
rm -f test_xxd.res test.log messages starttime
if test -n "${ASAN_OPTIONS}"; then \
XXD=../xxd/xxd; export XXD; ASAN_OPTIONS="${ASAN_OPTIONS}_test_xxd" \
UBSAN_OPTIONS="${UBSAN_OPTIONS}_test_xxd" VIMRUNTIME=../../runtime ../vim -f \
-u unix.vim --gui-dialog-file guidialog -U NONE --noplugin --not-a-term -S \
runtest.vim test_xxd.vim ; \
fi
From test_xxd.vim:
Executed Test_xxd_color2() in 0.066049 seconds
Filtered 17 tests with $TEST_FILTER and $TEST_SKIP_PAT
Executed 1 test in 0.096862 seconds
```
closes: #17202
Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: double free in f_complete_match() (after v9.1.1341)
Solution: remove additional free of trig pointer, correctly free
regmatch.regprog and before_cursor in the error case
closes: #17203
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- set options in ftplugin but not in syntax
- implement ftplugin/groff.vim (wrapper of ftplugin/nroff.vim)
closes: #17174
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Shebang filetype detection can be improved
Solution: Improve detection logic (Eisuke Kawashima)
Vim does not correctly detect filetype from
- `#!/usr/bin/env --split-string=awk -f`
- `#!/usr/bin/env -S -i awk -f`
- `#!/usr/bin/env -S VAR= awk -f`
So update the current detection logic to detect those cases.
closes: #17199
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot define completion triggers and act upon it
Solution: add the new option 'isexpand' and add the complete_match()
function to return the completion matches according to the
'isexpand' setting (glepnir)
Currently, completion trigger position is determined solely by the
'iskeyword' pattern (\k\+$), which causes issues when users need
different completion behaviors - such as triggering after '/' for
comments or '.' for methods. Modifying 'iskeyword' to include these
characters has undesirable side effects on other Vim functionality that
relies on keyword definitions.
Introduce a new buffer-local option 'isexpand' that allows specifying
different completion triggers and add the complete_match() function that
finds the appropriate start column for completion based on these
triggers, scanning backwards from cursor position.
This separation of concerns allows customized completion behavior
without affecting iskeyword-dependent features. The option's
buffer-local nature enables per-filetype completion triggers.
closes: #16716
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: missing out-of-memory checks for enc_to_utf16() and
utf16_to_enc()
Solution: Add out-of-memory checks and fix a few other minor issues
(John Marriott)
This change does:
- add missing out-of-memory checks for enc_to_utf16() and
utf16_to_enc()
- add a small optimisation in mch_errmsg_c() and mch_msg_c() (in
message.c) to only call STRLEN() if needed.
- fix a memory leak in winpty_term_and_job_init() (in terminal.c).
closes: #17191
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Undo corrupted with 'completeopt' "preinsert" when switching
buffer or window.
Solution: Do not delete preinsert text when switching buffer or window.
(zeertzjq)
related: neovim/neovim#33581
closes: #17193
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit fixes the following error message:
```
Compiler not supported: make inc< sw< sts<
```
1. orginal value: `setl com< cms< et< fo<| compiler make inc< sw< sts<`
2. correct value: `setl com< cms< et< fo< inc< sw< sts< | compiler make`
While at it, let's also document the g:yaml_recommended_style variable.
closes: #17179
Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Vincent Law <vlaw@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
prevent indentation if the previous line starts with e.g. `.PHONY:`
closes: #17183
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: comment plugin does not support case-insensitive
'commentstring' (char101)
Solution: Use pattern '\c' to make the regex case-insensitive
(Maxim Kim)
fixes: #17184closes: #17186
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity complains about Null pointer dereferences
Solution: before accessing ccline->cmdbuff check that ccline is not NULL
Fixes: Coverity issue 1646601
closes: #17189
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity complains about unchecked return value
Solution: cast return value to (void)
Fixes: Coverity issue 1646574
related: #17189
Signed-off-by: Christian Brabandt <cb@256bit.org>