runtime(doc): link cmdline completion to to |wildcards| and fix typos (vim/vim#13636)
The docs for cmdline completion doesn't mention that [abc] is considered
a wildcard, and |wildcards| contains more detailed information, so just
link to it.
Also fix some typos in other help files.
61e984e212
Problem: [security]: overflow with count for :s command
Solution: Abort the :s command if the count is too large
If the count after the :s command is larger than what fits into a
(signed) long variable, abort with e_value_too_large.
Adds a test with INT_MAX as count and verify it correctly fails.
It seems the return value on Windows using mingw compiler wraps around,
so the initial test using :s/./b/9999999999999999999999999990 doesn't
fail there, since the count is wrapping around several times and finally
is no longer larger than 2147483647. So let's just use 2147483647 in the
test, which hopefully will always cause a failure
ac63787734
Co-authored-by: Christian Brabandt <cb@256bit.org>
runtime(doc): Improve command-line completion docs (vim/vim#13331)
* Improve command-line completion docs
Add more details about 'ignorecase' and its effect on cmdline
completion.
Make sure keys used in wildmenu are properly documented and linked in the
keys' documentation entries, and in `:h index` for proper
cross-referencing, as wildmenu popup is slightly different from
insert-mode popup menu.
* Fix docs typos
2bbd0d30ee
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Problem: cannot complete option values
Solution: Add completion functions for several options
Add cmdline tab-completion for setting string options
Add tab-completion for setting string options on the cmdline using
`:set=` (along with `:set+=` and `:set-=`).
The existing tab completion for setting options currently only works
when nothing is typed yet, and it only fills in with the existing value,
e.g. when the user does `:set diffopt=<Tab>` it will be completed to
`set diffopt=internal,filler,closeoff` and nothing else. This isn't too
useful as a user usually wants auto-complete to suggest all the possible
values, such as 'iblank', or 'algorithm:patience'.
For set= and set+=, this adds a new optional callback function for each
option that can be invoked when doing completion. This allows for each
option to have control over how completion works. For example, in
'diffopt', it will suggest the default enumeration, but if `algorithm:`
is selected, it will further suggest different algorithm types like
'meyers' and 'patience'. When using set=, the existing option value will
be filled in as the first choice to preserve the existing behavior. When
using set+= this won't happen as it doesn't make sense.
For flag list options (e.g. 'mouse' and 'guioptions'), completion will
take into account existing typed values (and in the case of set+=, the
existing option value) to make sure it doesn't suggest duplicates.
For set-=, there is a new `ExpandSettingSubtract` function which will
handle flag list and comma-separated options smartly, by only suggesting
values that currently exist in the option.
Note that Vim has some existing code that adds special handling for
'filetype', 'syntax', and misc dir options like 'backupdir'. This change
preserves them as they already work, instead of converting to the new
callback API for each option.
closes: vim/vim#13182900894b09a
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Update runtime files
10e8ff9b26
Also:
- fix a missing `<` in builtin.txt.
- edit `:function` `{name}` wording to match the change made for the docs above
by Justin in #10619.
- link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua`
may also be used).
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Solution for "!!sort" in closed fold is not optimal.
Solution: Use a different range instead of the subtle difference in handling
a range with an offset. (issue vim/vim#11487)
9954dc39ea
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Update runtime files
76db9e0763
- `col()`'s example was changed to use `:echowin` so that the message can be
seen with `showmode`. Use "\n" to force a hit-enter instead as `:echowin`
isn't ported.
- Replace interpolated string usage in syntax/modula3.vim (not ported).
- Add a space after the `wincmd =` examples in `*CTRL-W_=*` so that the inlined
code is highlighted properly when followed by a full stop.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot use expand() to get the script name.
Solution: Support expand('<script>'). (closesvim/vim#10121)
6013d0045d
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
Problem: When a test fails it's often not easy to see what the call stack
is.
Solution: Add more entries from the call stack in the exception message.
a5d0423fa1
Use docs from latest Vim.
Neovim already removed `evim` (or any similar flags). The 'insertmode'
option is a weird remnant, so get rid of it.
The 'insertmode' option is replaced with a script that closely emulates
the option. This script is documented at :help 'insertmode'
This marks the following Vim patches as ported:
vim-patch:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Problem: With modifyOtherKeys CTRL-^ doesn't work.
Solution: Handle the exception.
828ffd5963
vim-patch:8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Problem: Other text for CTRL-V in Insert mode with modifyOtherKeys.
Solution: Convert the Escape sequence back to key as if modifyOtherKeys is
not set, and use CTRL-SHIFT-V to get the Escape sequence itself.
(closesvim/vim#5254)
fc4ea2a72d
vim-patch:8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Problem: CTRL-V U doesn't work to enter a Unicode character when
modifyOtherKeys is effective. (Ken Takata)
Solution: Add a flag to get_literal() for the shift key. (closesvim/vim#7413)
0684e36a7e
Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which
may introduce a potential breakage.
Update runtime files.
a2baa73d1d
Cherry-pick tabpage.txt changes from patch 8.2.1413.
Skip digraph functions: included in #17440.
Skip many error codes as they haven't been ported yet.
Problem: Fnamemodify() does not apply ":~" when followed by ":.".
Solution: Don't let a failing ":." cause the ":~" to be skipped. (Yasuhiro
Matsumoto, closesvim/vim#5577)
d816cd94d8
I mistakenly suggested maxlines=&cmdwinheight, forgetting that it is
calculated from topline, not cursor. maxlines=1 makes the most sense in
cmdwin.
ref #15401622a36b1f1
Add a new default autocommand to limit syntax highlighting
synchronization in the command window. This refactors the nvim_terminal
autocommand out of main() and into a new init_default_autocmds()
function, which is now part of the startup process and can be further
extended with more default autocommands down the road.
ref #6289#6399
Opt in to this secret world using
set wildchar=0
" already the default, but remove if non-zero existing config:
set wildcharm=0
now you can map 'wildmode' just like any mode:
cnoremap <tab> <c-z>
function! Spacey()
return getcmdline()[-1:] == "/" ? "\<bs>" : ""
endfunc
cnoremap <expr> / wildmenumode() ? Spacey()."/<c-z>" : "/"
Possibly asked questions:
What about backwards compatibility?
====
Just do nothing and your existing 'wildchar' and 'wildcharm' will keep working.
Doesn't `<c-z>` mean suspend?
====
Not in cmdline mode. If it would then the recommended wildcharm would not
have been `<c-z>` to start with.
My config relies on `:<c-z>` being a synonym to `:<nop>`!
====
just no.
In #8226 <A-x> and <M-x> were changed to behave like <Esc>x in insert
mode when no mapping exists. This commit backs out that change and
replaces it with a more general one that makes unmapped ALT and META
keypresses as <Esc>+char in all modes. This fixes an unnecessary and
confusing inconsistency between modes.
Problem: Cannot get the script line number when executing a function.
Solution: Store the line number besides the script ID. (Ozaki Kiichi,
closesvim/vim#3362) Also display the line number with ":verbose set".
f29c1c6aa3