Problem: tabpanel may flicker in the GUI
Solution: call scroll_start() and scroll_region_reset()
(Hirohito Higashi)
fixes: #17440closes: #17442
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Change from "Document '&variable'" to the expected correct result
"TODO: Document '&variable'"
closes: #17417
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: CTRL-X CTRL-R only completes individual words from registers,
making it difficult to insert complete register content.
Solution: Add consecutive CTRL-X CTRL-R support - first press completes
words, second press completes full register lines, similar to
CTRL-X CTRL-L and CTRL-X CTRL-P behavior (glepnir).
closes: #17395
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tabpanel: there are still some problems with the tabpanel with
column handling
Solution: fix the problems and refactor Tabpanel feature (Hirohito
Higashi).
fixes: #17423fixes: #17332closes: #17336
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: PMenu selection broken with multi-line selection and limits
(Maxim Kim)
Solution: update completion match index when limiting the completion
sources (Girish Palya)
fixes: #17394closes: #17401
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: :tag command not working correctly using Vim9 Script
Solution: inject a ':' before the numeric address, to make the command
valid in Vim9 context
fixes: #17415closes: #17418
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: scheduling of complete function can be improved
Solution: call user completion functions earlier when just determining
the insertion column (Girish Palya)
This change improves the scheduling behavior of async user-defined
completion functions (such as `F{func}`, `F`, or `'o'` values in the
`'complete'` option), particularly benefiting LSP clients.
Currently, these user functions are invoked twice:
1. First with `findstart = 1` to determine the completion start
position.
2. Then with `findstart = 0` to retrieve the actual matches.
Previously, both calls were executed back-to-back. With this change, the
first call (`findstart = 1`) is performed earlier—before any matches are
gathered from other sources.
This adjustment gives event-driven completion sources (e.g., LSP
clients) more time to send their requests while Vim concurrently
collects matches from other sources like the current buffer.
Not sure about the real-world performance gains, but this approach
should, in theory, improve responsiveness and reduce latency for
asynchronous completions.
To test, try using yegappan LSP client:
```vim
set cpt+=o^10
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```
If you prefer to use 'native' auto-completion (without plugins), try the
following configuration:
```vim
set cot=menuone,popup,noselect,nearest
autocmd TextChangedI * InsComplete()
def InsComplete()
if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
SkipTextChangedI()
feedkeys("\<c-n>", "n")
endif
enddef
inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedI()<cr><c-e>
inoremap <silent> <c-y> <c-r>=<SID>SkipTextChangedI()<cr><c-y>
def SkipTextChangedI(): string
set eventignore+=TextChangedI
timer_start(1, (_) => {
set eventignore-=TextChangedI
})
return ''
enddef
inoremap <silent><expr> <tab> pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
```
closes: #17396
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: need a test for the new-style tutor.tutor, patch
9.1.1384 broke the expected positions for the signs
Solution: Update all number keys in tutor.tutor.json to match the
correct line numbers in tutor.tutor, replace tabs by spaces,
add a screen-dump test to verify it does not regress
(Pham Bình An)
closes: #17416
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Complement the documented support for the recognition of all
public types of the "java.lang" package (":help java.vim").
(The original syntax item generator may have, inadvertently,
contributed via suppressing "NullPointerException"s to not
having annotation and interface types qualify in general.)
Also, re-link usage instructions for the alternative syntax
item generator to a rolling "master"'s version.
closes: #17419
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match full :profile and :profdel commands.
closes: #17420
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Match full :mark and :k commands.
- Match 2 and 3 letter :s repeat commands.
- Match :s [count] argument.
closes: #17408
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: could need some more tests for shebang lines
Solution: add more shebang patterns to test_filetype.vim
(Eisuke Kawashima)
closes: #17409
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
And generalise the sourcing of "javaid.vim" for Java
buffers.
Resolves zzzyxwvut/java-vim#10.
closes: #17411
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: It is difficult to ignore all but some events.
Solution: Add support for a "-" prefix syntax in '(win)eventignore' that
subtracts an event from the ignored set if present
(Luuk van Baal).
closes: #17392
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
It is now possible to use omni-completion by adding the "o" flag to
'complete'
fixes: #17393
Co-authored-by: Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Match comments and trailing bar after :set without args.
- Match the <...> form for key code options.
- Remove orphaned vim_ex_python[3x]* dump files (Aliaksei Budavei).
closes: #17397
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: configures GUI auto detection favors GTK2
Solution: make configure favor GTK3 over GTK2 for the GUI
when auto detecting the gui toolkit (Drew Vogel).
Prior to these changes if the dev packages for both GTK2 and GTK3 were
installed, the `--enable-gui=auto` would used GTK2. After these changes
it will use GTK3. Users can still use `--enable-gui=gtk2` to
specifically select GTK2.
In addition to the prioritization change, this also brings some cleanups
to the GTK autoconf code:
* The `AM_PATH_GTK` macro had an unused third argument that has been
removed.
* The `AM_PATH_GTK` macro checked the `SKIP_GTK2` & `SKIP_GTK3`
variables but the code that decided whether to call it also checked
those. Now just the calling code does so.
* The `AM_PATH_GTK` macro set a default minimum version based on
`SKIP_GTK2` and `SKIP_GTK3` but the calling code was also expected to
pass a version. Now the calling code _must_ pass a version.
* The GTK test program previous used `gtk_(major|minor|micro)_version`
as all of: a C variable name, a C macro provided only by GTK2, and an
autoconf variable name. It also needlessly parsed a `x.y.z` version
string when the same string was already parsed by autoconf + sed. Now
the parsed values are used directly in the test program.
* The GTK test program previous created a test program `conf.gtktest`
which was cleaned up by the autoconf script. This appeared to be a
crude way to debug whether an erroring configure run had actually run
the test program. Instead the autoconf script now outputs more messaging
and the user can check `config.log` to determine the status of the
configure script.
I'm not an autoconf expert and I don't have access to some of the older
systems we try to support with gvim. So I would very much appreciate if
anyone could run this on their systems to ensure it doesn't misbehave.
While my motivation here is mainly to further establish GTK3 as the
primary GUI mode, this should at least partially address the concern
described in #15437.
Here are a few test runs with both GTK 2 and GTK 3 installed:
```
--with-features=huge \
--enable-gui \
--enable-gtk3-check=no \
--enable-gtktest \
```
```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for GTK+ 3... no
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-2.0... found
checking for GTK - version >= 2.2.0... yes; found version 2.24.33
checking ability to compile GTK test program... yes
```
```
--with-features=huge \
--enable-gui \
--enable-gtk2-check=no \
--enable-gtktest \
```
```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... no
checking whether or not to look for GTK+ 3... yes
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
checking ability to compile GTK test program... yes
```
```
--with-features=huge \
```
```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for GTK+ 3... yes
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
checking ability to compile GTK test program... yes
```
```
--with-features=huge \
--disable-gtktest \
```
```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for GTK+ 3... yes
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test disabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
```
```
--with-features=huge \
--enable-gui=gtk2 \
```
```
checking --enable-gui argument... GTK+ 2.x GUI support
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-2.0... found
checking for GTK - version >= 2.2.0... yes; found version 2.24.33
checking ability to compile GTK test program... yes
```
```
--with-features=huge \
--enable-gui=gtk3 \
```
```
checking --enable-gui argument... GTK+ 3.x GUI support
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
checking ability to compile GTK test program... yes
```
And here is a similar run with the GTK 3 dev package removed:
```
--with-features=huge \
--enable-gui=gtk3 \
--enable-fail-if-missing \
```
```
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... no; consider installing your distro
GTK -dev package
configure: error: pkg-config could not find gtk+-3.0
```
closes: #17369
Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: missing info about register completion in complete_info()
(after v9.1.1408)
Solution: update documentation and mention that register is used as
source, add a test (glepnir)
closes: #17389
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: potential use-after free when there is an error in 'tabpanel'
option (@char101, after v9.1.1391)
Solution: check if p_tpl has been set to null before accessing it again.
While at it slightly change starts_with_percent_and_bang() and use the
existing opt_name and opt_scope variables.
fixes: #17364closes: #17388
Signed-off-by: Christian Brabandt <cb@256bit.org>
According to ISO-639, the correct 2 letter language code is HY not AM,
so let's rename am.po.
Also, add hy.po to the CHECKFILES Make target and convert the file to
Unix lineformat.
closes: #17380
Signed-off-by: Gagik Hakobyan <hakgagik@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: spurious CursorHold triggered in GUI on startup
Solution: init global did_cursorhold flag to true
(Gary Johnson)
When Vim is started in GUI mode, the CursorHold autocommand event is
triggered 'updatetime' milliseconds later, even when the user has not
pressed a key. This is different from the behavior of Vim in terminal
mode, which does not trigger a CursorHold autocommand event at startup,
and contradicts the description of the CursorHold event in ":help
CursorHold", which states that the event is "[n]ot triggered until the
user has pressed a key".
The fix is to change the initial value of did_cursorhold from FALSE to
TRUE. While it is true that the CursorDone event has not been done yet
at startup, it should appear to have been done until the user presses
a key.
fixes#17350closes: #17382
Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: crash when calling non-existing function for tabpanel (Yamagi,
after v9.1.1391)
Solution: check if there was an error and if there was, set tabpanel
option to empty to prevent showing errors on every redraw
fixes: #17364closes: #17375closes: #17371
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: out-of-bounds access with 'completefunc' (csetc)
Solution: check if it is safe to advance cpt_sources_index
(Girish Palya)
fixes: #17363closes: #17374
Co-authored-by: @csetc
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: using f-flag in 'complete' conflicts with Neovims filename
completion (glepnir, after v9.1.1301).
Solution: use upper-case "F" flag for completion functions
(Girish Palya).
fixes: #17347closes: #17378
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: not easily possible to complete from register content
Solution: add register-completion submode using i_CTRL-X_CTRL-R
(glepnir)
closes: #17354
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Can't use getpos('v') in OptionSet when using setbufvar().
Solution: Don't reset Visual selection when switching to the same
buffer (zeertzjq).
closes: #17373
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: crash when importing invalid tuple
(Yang LUO, Yanju Chen)
Solution: set type to VAR_UNKNOWN, so that it isn't freed
(Yegappan Lakshmanan)
closes: #17362
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: no test for mapping with special keys in session file.
Solution: Add a special keys to an existing test. Also test with UTF-8
characters containing 0x80 or 0x9b bytes (zeertzjq).
closes: #17360
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: wrong link to Chapter 2 in vim-01-beginner.tutor
Solution: Fix the link to Chapter 2, add test for links in tutor files
(Phạm Bình An)
In order to write the test, I expose the function `s:GlobTutorials` as
`tutor#GlobTutorials` and make it also accept a `locale` argument.
closes: #17356
Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>