Problem: cannot set the maximum popup menu width
(Lucas Mior)
Solution: add the new global option value 'pummaxwidth'
(glepnir)
fixes: #10901closes: #16943
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: No test that 'listchars' "eol" doesn't affect "gM".
Solution: Add a test (zeertzjq).
closes: #16990
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
While at it, remove the item about merged PR #12032closes: #16984
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: compile error when building without FEAT_QUICKFIX
Solution: adjust ifdefs in popupwin.c, add CheckFeature quickfix
to a few tests (John Marriott, Hirohito Higashi)
closes: #16940closes: #16962
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: fragile setup to get (preferred) keys from key_name_entry
(after v9.1.1179)
Solution: refactor the code further, fix a bug with "pref_name" key
entry introduced in v9.1.1180 (Yee Cheng Chin)
The optimization introduced for using bsearch() with key_name_entry
in #16788 was fragile as it required synchronizing a non-obvious index
(e.g. IDX_KEYNAME_SWU) with the array that could be accidentally changed
by any one adding a key to it. Furthermore, the "pref_name" that was
introduced in that change was unnecessary, and in fact introduced a bug,
as we don't always want to use the canonical name.
The bug is triggered when the user triggers auto-complete using a
keycode, such as `:set <Scroll<Tab>`. The bug would end up showing two
copies of `<ScrollWheelUp>` because both entries end up using the
canonical name.
In this change, remove `pref_name`, and simply use a boolean to track
whether an entry is an alt name or not and modify logic to respect that.
Add test to make sure auto-complete works with alt names
closes: #16987
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: need some more tests for curly braces evaluation
Solution: Add a test for the regression introduced by patch v9.1.1242
(Yegappan Lakshmanan)
closes: #16986
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: part of patch v9.1.1242 was wrong
Solution: revert part of the patch
fixes: #16983
related: #16972
Signed-off-by: Christian Brabandt <cb@256bit.org>
Note: this commit rewrites the omnimark syntax script in Vim9 script and
is therefore probably incompatible with Neovim
closes: #16979
Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Diff mode's inline highlighting is lackluster. It only
performs a line-by-line comparison, and calculates a single
shortest range within a line that could encompass all the
changes. In lines with multiple changes, or those that span
multiple lines, this approach tends to end up highlighting
much more than necessary.
Solution: Implement new inline highlighting modes by doing per-character
or per-word diff within the diff block, and highlight only the
relevant parts, add "inline:simple" to the defaults (which is
the old behaviour)
This change introduces a new diffopt option "inline:<type>". Setting to
"none" will disable all inline highlighting, "simple" (the default) will
use the old behavior, "char" / "word" will perform a character/word-wise
diff of the texts within each diff block and only highlight the
differences.
The new char/word inline diff only use the internal xdiff, and will
respect diff options such as algorithm choice, icase, and misc iwhite
options. indent-heuristics is always on to perform better sliding.
For character highlight, a post-process of the diff results is first
applied before we show the highlight. This is because a naive diff will
create a result with a lot of small diff chunks and gaps, due to the
repetitive nature of individual characters. The post-process is a
heuristic-based refinement that attempts to merge adjacent diff blocks
if they are separated by a short gap (1-3 characters), and can be
further tuned in the future for better results. This process results in
more characters than necessary being highlighted but overall less visual
noise.
For word highlight, always use first buffer's iskeyword definition.
Otherwise if each buffer has different iskeyword settings we would not
be able to group words properly.
The char/word diffing is always per-diff block, not per line, meaning
that changes that span multiple lines will show up correctly.
Added/removed newlines are not shown by default, but if the user has
'list' set (with "eol" listchar defined), the eol character will be be
highlighted correctly for the specific newline characters.
Also, add a new "DiffTextAdd" highlight group linked to "DiffText" by
default. It allows color schemes to use different colors for texts that
have been added within a line versus modified.
This doesn't interact with linematch perfectly currently. The linematch
feature splits up diff blocks into multiple smaller blocks for better
visual matching, which makes inline highlight less useful especially for
multi-line change (e.g. a line is broken into two lines). This could be
addressed in the future.
As a side change, this also removes the bounds checking introduced to
diff_read() as they were added to mask existing logic bugs that were
properly fixed in #16768.
closes: #16881
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Regression with ic/ac text objects and comment plugin
Solution: Fix regression, update tests (Maxim Kim)
fix regression: sometimes ic/ac should be line-wise
```
int main() {
// multilple comments
// cursor is between them
}
# dac ->
int main() {
}
```
closes: #16947closes: #16980
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_python: no tuple data type support (after v9.1.1232)
Solution: Add support for using Vim tuple in the python interface
(Yegappan Lakshmanan)
closes: #16964
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: With ':set splitkeep=screen', cursor did't restore column
correctly when splitting a window on a line longer than the
last line on the screen (after v9.1.0707)
Solution: Restore cursor column in `win_fix_scroll()` since it may be
changed in `getvcol()` after 396fd1ec2956 (phanium).
Example:
```
echo longlonglongling\nshort | vim - -u NONE --cmd 'set
splitkeep=screen' +'norm $' +new +q
```
fixes: #16968closes: #16971
Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Compile error with C89 compiler in term.c
(Zoltan Arpadffy)
Solution: split out LOG_TR macro into 2 different macros. LOG_TR1 that
takes only a single argument and LOG_TRN that takes 2
arguments. Remove the use of ##__VA_ARGS__ since the macro is
now always called with 2 arguments (Hirohito Higashi)
related: #16962closes: #16969
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_comments leaves swapfiles around
Solution: use ':bw!' instead of ':close!'
closes: #16955
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cproto files are outdated
Solution: regenerate proto files by running make proto
(Yegappan Lakshmanan)
closes: #16956
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Compile error when SIZE_MAX is not defined
Solution: Define SIZE_MAX (Zoltan Arpadffy)
related: #16962
Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity warns about NULL pointer when triggering WinResized
Solution: Add OOM checks for windows_list like for scroll_dict. Remove
void casts that are unnecessary after 9.1.1084 (zeertzjq).
closes: #16959
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim script is missing the tuple data type
Solution: Add support for the tuple data type
(Yegappan Lakshmanan)
closes: #16776
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Support for protected constructors was added in commit 7e89800.
closes: 16618
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#uicloses: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: SPA (single page application) JSON files are not
recognized (used by pipewire and wireplumber)
Solution: detect pipewire and wireplumber configuration files as spajson
filetype, include filetype, indent and syntax scripts for this
new filetype (David Mandelberg).
I looked at all the files found by this command to see if the syntax
highlighting looked reasonable:
```
find {~/.config,/etc,/usr/share}/{pipewire,wireplumber} -type f -name \*.conf
```
References:
* pipewire config files: https://docs.pipewire.org/page_config.html
* wireplumber config files:
https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html
and
* https://pipewire.pages.freedesktop.org/wireplumber/daemon/locations.htmlcloses: #16950
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
See pull request #14767.
Rename the Vim :keymap filter files so they're, again, associated with
the correct dump files.
closes: #16560
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Ctrl-C closes popup windows that have a filter callback,
but does not close popups without a filter callback.
Solution: Modified popup_do_filter() to also close popups without
filter callback when Ctrl-C is pressed (glepnir).
fixes: #16839closes: #16928
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: the comment plugin can be improved
Solution: add comment text objects "ic" and "ac"
(Maxim Kim)
closes: #16938
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Also, do not set g:is_kornshell when g:is_posix is set. BSD shells are
POSIX but many are derived from the ash shell.
closes: #16939
Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The current_pos.col was incorrectly updated to the length of
the matching text. This will cause the next search to start
from the wrong position.
Solution: current_pos has already been updated in search_str_in_line and
does not need to be changed (glepnir)
closes: #16941
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: no tests for the comment package
Solution: add some tests (Maxim Kim).
closes: #16933
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: "shellcmdline" completion doesn't work with input().
Solution: Use set_context_for_wildcard_arg(). Fix indent in nextwild()
(zeertzjq).
There are some other inconsistencies for input() completion (ref #948),
but since "shellcmdline" currently doesn't work at all, it makse sense
to at least make it work.
fixes: #16932closes: #16934
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: extra NULL check in VIM_CLEAR()
Solution: remove the NULL check and rely on the NULL check in vim_free()
instead (Hirohito Higashi).
closes: #16936
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem:
- The document from `go doc` can be very long, and you can scroll if
using `!` to run shell command in Gvim.
- I realize that I didn't fully mimic behavior of default keywordprg
in Nvim in the last commit.
Solution:
- Use builtin terminal for keywordprg in Gvim
- In Nvim (both TUI and GUI), it should mimic the behavior of Vim
`:term`, `:Man`, and `:help`
closes: #16911
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: wrong translation for encoding failures because of using
literal "from" and "to" in the resulting error message
(RestorerZ)
Solution: use separate error messages for errors "from" and "to"
encoding errors.
fixes: #16898closes: #16918
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: using wrong length for last inserted string
(Christ van Willegen, after v9.1.1212)
Solution: use the correct length in get_last_insert_save(), make
get_last_insert() return a string_T (John Marriott)
closes: #16921
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Wrong cursor position and '^' mark when leaving Insert mode
just after 'autoindent' and cursor on last char of line.
Solution: Don't move cursor to NUL when it wasn't moved to the left
(zeertzjq).
fixes: #15581
related: neovim/neovim#30165neovim/neovim#32943closes: #16922
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Strange error with type for matchfuzzy() "camelcase".
Solution: Show the error "Invalid value for argument camelcase" instead
of "Invalid argument: camelcase" (zeertzjq).
Note that using tv_get_string() will lead to confusion, as when the
value cannot be converted to a string tv_get_string() will also give an
error about that, but "camelcase" takes a boolean, not a string. Also
don't use tv_get_string() for the "limit" argument above.
closes: #16926
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>