So let's remove the symlink and copy the netrw documentation back into
runtime/doc directory. While at it, add a Makefile target to do this
whenever runtime/pack/dist/opt/netrw/doc/netrw.txt is updated.
fixes: #16878fixes: #16872
Co-authored-by: Brandon Maier <brandon.maier@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Fix grammar
- Use "matches" instead of "items" ("completion candidates" is used in
some other places, but it's a bit verbose)
- "When set" is a bit vague, instead use "For specified modes"
closes: #16871
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
"umask" is pronounce like "youmask", so having an "an" before it is a
bit strange. In other places in the help, "umask" is not preceded by
either "a" or "an", and sometimes preceded by "the".
Also, "Note" is usually followed either by ":" or "that" in builtin.txt,
so add a ":" after "Note".
closes: 16860
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: the highlight-yank plugin exmaple provided in the doc behaves
incorrectly when selection is set to exclusive.
Solution: use a unified offset of 1 and pass 'exclusive: false' to
getregionpos(), while at it, also clarify when the
TextYankPost autocommand triggers.
closes: #16866
Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
On man-db systems, complete with actual man sections and pages, instead
of shell commands.
I tried to come up with a portable solution for multiple man
implementations in https://github.com/vim/vim/discussions/16794 but I
think the differences between implementations were too large to do that
without overly complicated code. So instead, I implemented it for man-db
(which I think is common on Linux) and hopefully left it easier for
other people to implement it on other systems in the future if they want
to.
closes: #16843
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Test for patch 9.1.1186 doesn't fail without the patch.
Solution: Set 'nomodeline' in the test (zeertzjq).
closes: #16835
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
It's called "GNOME Terminal" in
https://gitlab.gnome.org/GNOME/gnome-terminal It's also called GNOME
Terminal in English Wikipedia
https://en.wikipedia.org/wiki/GNOME_Terminal and the Wikipedia pages of
8 other languages.
Also, make line wrapping the same in insert.txt and cmdline.txt.
closes: #16832
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: help files in git repos are not detected
Solution: detect */doc/*.txt files as help if they end with a help
modeline, even if 'modeline' is off
Here's how I checked that this would still detect vim's own help files
correctly:
$ find . -type f -path '*/doc/*.txt' \
> -exec awk '{ } ENDFILE { print FILENAME ":" $0; }' '{}' + |
> grep -v 'vim:.*\<\(ft\|filetype\)=help\>'
./src/libvterm/doc/seqs.txt: 23 DECSM 42 = DECNRCM, national/multinational character
closes: #16817
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: No cmdline completion for the 'completefuzzycollect' option
(after v9.1.1178)
Solution: Add cmdline completion for the 'completefuzzycollect' option,
improve its description in optwin.vim (zeertzjq).
closes: #16813
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: not possible to generate completion candidates using fuzzy
matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
modes (glepnir)
fixes#15296fixes#15295fixes#15294closes: #16032
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Vim9 syntax changed before Vim 9 leading to errors thrown if checked for
availability of Vim9script in Vim Version 8.2 such as
This check seems to work as well and throws less errors on Vim 8.2 such
as on Ubuntu 22.04
closes: #16783
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: command-line auto-completion hard with wildmenu
Solution: implement "noselect" wildoption value (Girish Palya)
When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the
completion menu appears without pre-selecting the first item.
This change makes it easier to implement command-line auto-completion,
where the menu dynamically appears as characters are typed, and `<Tab>`
can be used to manually select an item. This can be achieved by
leveraging the `CmdlineChanged` event to insert `wildchar(m)`,
triggering completion menu.
Without this change, auto-completion using the 'wildmenu' mechanism is
not feasible, as it automatically inserts the first match, preventing
dynamic selection.
The following Vimscript snippet demonstrates how to configure
auto-completion using `noselect`:
```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()]))
def CmdComplete(cur_cmdline: string, timer: number)
var [cmdline, curpos] = [getcmdline(), getcmdpos()]
if cur_cmdline ==# cmdline # Avoid completing each character in keymaps and pasted text
&& !pumvisible() && curpos == cmdline->len() + 1
if cmdline[curpos - 2] =~ '[\w*/:]' # Reduce noise by completing only selected characters
feedkeys("\<C-@>", "ti")
set eventignore+=CmdlineChanged # Suppress redundant completion attempts
timer_start(0, (_) => {
getcmdline()->substitute('\%x00$', '', '')->setcmdline() # Remove <C-@> if no completion items exist
set eventignore-=CmdlineChanged
})
endif
endif
enddef
```
fixes: #16551closes: #16759
Signed-off-by: Girish Palya <girishji@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:
- 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: 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: 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>
The new native commenting functionality is currently not used when
editing mail. One could reasonably expect it to change the "quote" state
of any given line in the mail (i.e. the preceding ">"), which would be
very handy and feel natural when editing mail. Especially since the
current file already uses "setlocal comments+=n:>".
Solution: Add commentstring to `> %s` to be used in files of type mail.
closes: #16669
Signed-off-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Highlight groups PopupSelected/PopupNotification/
MessageWindow are supposed to fall back to default highlight
groups if they are not defined. However, once a colorscheme
has defined them, switching to another colorscheme that
doesn't do so will leave behind a cleared colorscheme, which
causes the fallback to fail.
Solution: Set up default links to the relevant fallback highlight
groups, which makes sure a `:hi clear` command will reset the
state properly (Yee Cheng Chin).
closes: #16676
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: enabling termguicolors automatically confuses users. Since
querying the terminal for the RGB flag happens asynchronously,
enabling termguicolors is noticeable by users as the highlighting changes
and is therefore unexpected.
(after v9.1.1054)
Solution: comment out that part for now. We may need another way to
enable this in the future.
fixes: #16539fixes: #16568fixes: #16649
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim tests are slow and flaky at the same time due to reliance
on timeouts which are unreliable.
Solution: improve Vim test performance and reduce flakiness
(Yee Cheng Chin)
A lot of Vim tests currently rely on waiting a specific amount of time
before asserting a condition. This is bad because 1) it is slow, as the
timeout is hardcoded, 2) it's unreliable as a resource-starved runner
may overshoot the timeout. Also, there are a lot of builtin sleep
commands in commonly used utilities like VerifyScreenDump and WaitFor()
which leads to a lot of unnecessary idle time.
Fix these issues by doing the following:
1. Make utilities like VerifyScreenDump and WaitFor use the lowest wait
time possible (1 ms). This essentially turns it into a spin wait. On
fast machines, these will finish very quickly. For existing tests
that had an implicit reliance on the old timeouts (e.g.
VerifyScreenDump had a 50ms wait before), fix the tests to wait that
specific amount explicitly.
2. Fix tests that sleep or wait for long amounts of time to instead
explicitly use a callback mechanism to be notified when a child
terminal job has finished. This allows the test to only take as much
time as possible instead of having to hard code an unreliable
timeout.
With these fixes, tests should 1) completely quickly on fast machines,
and 2) on slow machines they will still run to completion albeit slowly.
Note that previoulsy both were not true. The hardcoded timeouts meant
that on fast machines the tests were mostly idling wasting time, whereas
on slow machines, the timeouts often were not generous enough to allow
them to run to completion.
closes: #16615
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: no support for protected new() method
Solution: support the protected "_new()" object method
(Yegappan Lakshmanan)
closes: #16604
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>