Problem: Vim's diff block merging algorithm when doing a multi-file diff
is buggy when two different diff hunks overlap a single
existing diff block (after v9.1.0743)
Solution: fix a couple bugs in this logic:
1. Fix regression from v9.1.0743 where it's not correctly expanding the
2nd overlap correctly, where it always expands without taking into
account that this was always taken care of when the first overlap
happened. Instead, we should only grow the 2nd overlap if it overhangs
outside the existing diff block, and if we encounter a new overlapping
diff block (due to overlap chaining).
2. When we expand a diff block to match the hunk size on the orig side
(when handling the first overlap), we expand the same amount of lines
in the new side. This is not sound if there exists a second overlap
hunk that we haven't processed yet, and that hunk has different
number of lines in orig/new. Fix this by doing the corresponding
counter adjustment when handling 2nd/3rd/etc overlap by calculating
the difference in lines between orig and new side.
(Yee Cheng Chin)
closes: #16768
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: editing a special crafted tar file allows code execution
(RyotaK, after 129a8446d23cd9cb4445fcfea259cba5e0487d29)
Solution: escape the filename before feeding it to the `:read` command
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-wfmf-8626-q3r3
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: $MYVIMDIR is set too late and not available while sourcing
runtime files (Maxim Kim, after v9.1.1159)
Solution: Also set it when $MYVIMRC file is found
fixes: #16764closes: #16767
Signed-off-by: Christian Brabandt <cb@256bit.org>
The current lightweight synchronisation with ":redraw" needs further
reinforcement in the light of v9.1.1110. And, with v9.1.0820, make
another synchronisation point _before_ the first (or only) screenful is
dumped.
Also add a script to regenerate all screendumps.
closes: #16632
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When an info popup spans into the cmdline area and ESC is
pressed, some content remains visible on screen (yu3s)
Solution: Add popup_overlays_cmdline() check in screen_fill() to prevent
prematurely clearing the clear_cmdline flag (glepnir).
fixes: #15627closes: #16765
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: preinsert requires bot "menu" and "menuone" to be set,
but "menu" is redundant (after v9.1.1160)
Solution: preinsert only requires menuone (glepnir)
closes: #16763
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The 'preinsert' feature requires Ctrl-Y to confirm insertion,
but Ctrl-Y only works when the popup menu (pum) is displayed.
Without enforcing this dependency, it could lead to confusing
behavior or non-functional features.
Solution: Modify ins_compl_has_preinsert() to check for both 'menu' and
'menuone' flags when 'preinsert' is set. Update documentation
to clarify this requirement. This avoids adding complex
conditional behaviors. (glepnir)
fixes: #16728closes: #16753
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: $MYVIMDIR may not always be set (after 9.1.0718)
(sandwm)
Solution: always set $MYVIMDIR to first item in runtimepath
(except when using --clean), update it when changing &rtp
fixes: #16609closes: #16709
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: :verbose set has wrong file name with :compiler!
Solution: Add -keepscript (zeertzjq)
closes: #16752
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: No test for what patch 9.1.1152 fixes.
Solution: Add a test (zeertzjq).
closes: #16742
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Prevent 'include' from matching variable assignments as calls to
require() and others.
- Use script-local functions for 'includeexpr' and 'foldexpr'.
- Formatting fixes.
closes: #16746
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match Vim9 function calls after ex-bar. These are also currently
matched but invalid syntax for legacy script.
fixes: #16721closes: #16747
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: not able to use autoload class accross scripts
Solution: make it work, re-enable the test (Yegappan Lakshmanan)
fixes: #15031closes: #16748
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in getchar.c
Solution: store last inserted and recorded lengths,
add functions to retrieve those and use those
functions (John Marriott)
closes: #16720
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: :highlight auto-complettion has a minor bug where an existing
highlight group with a cterm color being unset would result in
it being auto-completed to -1 in cmdline which is invalid.
Solution: Correctly check for whether an int value is set to non-zero
before retrieving the existing value for auto-complete. Also
do this for attr/string values as they previously worked only
by accident (Yee Cheng Chin).
closes: #16726
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Unix Makefile does not support Brazilian lang for the
installer
Solution: add support for language code pt_br (RestorerZ)
This is in preparation of the Portuguese Brazilian translation
that will be merged a bit later.
related: #16692closes: #16732
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem:
- The doc says the default `g:lua_subversion` is 2, but in fact it is 3
(see `runtime/syntax/lua.vim`)
- `includeexpr` doesn't work with module in `init.lua`
Solution:
- Update documentation
- Assign value to option `&include`
- Add function `LuaInclude` and assign it to `l:&includeexpr`
closes: #16655
Co-authored-by: dkearns <dougkearns@gmail.com>
Signed-off-by: brianhuster <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: preview-window does not scroll correctly
Solution: init firstline = 0 for a preview window
(Girish Palya)
The 'info' window, which appears during insert-mode completion to display
additional information, was not scrolling properly when using commands like:
win_execute(popup_findinfo(), "normal! \<PageDown>")
This issue made it impossible to navigate through info window contents using
keyboard-based scrolling.
The fix correctly updates the w_firstline value of the popup window, ensuring
proper scrolling behavior. Mouse scrolling was already working as expected and
remains unaffected.
closes: #16703
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Prepare for PR #16692 which will eventually bring pt-br translation to
the installer and add some clarification on how to test the installer
with different languages
closes: #16725
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: wrong context being used when evaluating class member
(lifepillar, Ernie Rael)
Solution: Use the correct script context when evaluating a class member
init expression(Yegappan Lakshmanan)
fixes: #14011fixes: #14402closes: #15112closes: #16660
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When expanding omni completion items with newlines (e.g.
`then\n\t\nend`), the end statement gets wrong indentation.
Solution: Add OPENLINE_FORCE_INDENT flag to make open_line() use
second_line_indent directly (glepnir)
closes: #16614
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Justin M. Keyes <justinkz@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: no way to create raw strings from a blob
Solution: support the "encoding": "none" option
to create raw strings (which may be invalid!)
(Bakudankun)
closes: #16666
Signed-off-by: Bakudankun <bakudankun@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: illegal memory access when putting a register
Solution: make sure cursor column doesn't become negative
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_startup fails if $HOME/$XDG_CONFIG_HOME is defined
Solution: define $HOME and $XDG_CONFIG_HOME to some non-existing
directory
Signed-off-by: Christian Brabandt <cb@256bit.org>
- let keywordprg in vim filetype handle context-sensitive help calls by
detecting the syntax group of the word under the cursor
- reformat whitespace
- add modeline
related: #16677closes: #16680
Co-authored-by: Andrew Radev <andrey.radev@gmail.com>
Co-authored-by: "D. Ben Knoble" <ben.knoble+github@gmail.com>
Co-authored-by: Gary Johnson <garyjohn@spocom.com>
Co-authored-by: Tim Pope <code@tpope.net>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [fifo] is not displayed when editing a fifo
(after v7.4.2189)
Solution: stat the filename and detect the type correctly
fixes: #16702closes: #16705
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Existing cmdline completion for :highlight was barebone and
only completed the highlight group names.
Solution: Implement full completion for the highlight group arguments
such as guifg and cterm. If the user tries to complete
immediately after the '=' (e.g. `hi Normal guifg=<Tab>`), the
completion will fill in the existing value, similar to how
cmdline completion for options work (Yee Cheng Chin).
closes: #16712
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: ins_str() is inefficient by calling STRLLEN()
Solution: refactor ins_str() to take a length argument
and let all callers provide the correct length
when calling ins_str() (John Marriott)
closes: #16711
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
otherwise the test src/testdir/test_netbeans.vim wouldn't be executed by
the CI.
closes: #16710
Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>