Ensure :map (and :abbreviate) terminate at | when included in :command
replacement strings containing commands separated by line continuations.
b88f9e4a04
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: cannot easily trigger wildcard expansion
Solution: Introduce wildtrigger() function
(Girish Palya)
This PR introduces a new `wildtrigger()` function.
See `:h wildtrigger()`
`wildtrigger()` behaves like pressing the `wildchar,` but provides a
more refined and controlled completion experience:
- Suppresses beeps when no matches are found.
- Avoids displaying irrelevant completions (like full command lists)
when the prefix is insufficient or doesn't match.
- Skips completion if the typeahead buffer has pending input or if a
wildmenu is already active.
- Does not print "..." before completion.
This is an improvement on the `feedkeys()` based autocompletion script
given in vim/vim#16759.
closes: vim/vim#17806b486ed8266
While at it, also make Ctrl-Z trigger search completion.
Co-authored-by: Girish Palya <girishji@gmail.com>
- Match :autocmd options and special buffer pattern.
- Normalise ellipsis (three dots) in Ex command argument lists.
closes: vim/vim#1779331ec66403d
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem:
- Extmark breaks lesson 3.1 of vim-01-beginner.tutor because when users
delete the line and put it elsewhere, the extmark doesn't move to the
put location.
- This doesn't mean the extmark implementation is bad though (note that
thanks to extmark, for the first time, we can make lesson 2.6 really
interactive), it's just that the tutor format has never been made for
kinds of lessons like lesson 3.1, which is why all "expected" in that
lesson are -1, which also means that lesson is not interactive in the
first place. Also see lesson 2.1.3 in vim-02-beginner, where the mark
is just used to mark the first line of the exercise, which also prove
my point.
Solution:
- For a not-really-interactive lesson like lesson 3.1, just use legacy
syntax. I borrow the old vimtutor's `--->` to mark the exercises of
the lesson.
- Less redundant interactive marks also make the json files smaller and
more maintainable.
- Match Ex command modifiers and functions with the same name correctly.
E.g., :browse and browse().
- Match full :eval command.
closes: vim/vim#177892f7c957c8d
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Don't match lower-case function names as errors when the qualifier
includes a dict/list accessor.
This is a less than perfect fix until qualified function call matching
is reworked.
fixes: vim/vim#17766closes: vim/vim#17780175662f4f2
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Take over as file maintainer.
- Improve highlighting of legacy script examples by using :syn-iskeyword
with the default 'iskeyword' value. Vim9 script examples are not
supported yet.
- Match admonition labels in more contexts.
- Match URLs in more contexts.
fixesvim/vim#17721closes: vim/vim#177311341176e7b
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This change:
* enforces that the alias starts with a letter
* allows the other words in an alias to be separated by either a space
or a hyphen, but not both or double separators
* allows only a letter after space, possibly followed by letters or
digits
* allows both letters and digits after a hyphen
Tested with:
a = '\N{Cyrillic Small Letter Zhe} is pronounced as zh in pleasure'
b = '\N{NO-BREAK SPACE} is needed here'
# ... other tests here
r = '\N{HENTAIGANA LETTER E-1} is a Japanese hiragana letter archaic ye'
s = '\N{CUNEIFORM SIGN NU11 TENU} is a correction alias'
t = '\N{RECYCLING SYMBOL FOR TYPE-1 PLASTICS} base shape is a triangle'
print(a)
print(b)
print(r)
print(s)
print(t)
The tests confirm the behavior and are selected from real Unicode
tables/aliases to check these combinations based on the specification.
fixes: vim/vim#17323closes: vim/vim#177356f85cec4fb
Co-authored-by: Zvezdan Petkovic <zpetkovic@acm.org>
- Match the range prefix separately as a count.
- Match an explicit count of 1, rarely used but seen in the wild.
- Allow whitespace between the count and command.
closes: vim/vim#17717ce1d1969f3
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Match more function calls.
- Contain function call syntax groups.
- Improve differentiation between Ex commands and builtin functions with
the same name. Remove special cases. Command modifiers are not
currently well differentiated from functions.
closes: vim/vim#177126ac2e4aa0a
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem:
No conceal in qf on `lopen` since 74fcc945. Repro:
nvim --clean +'tab Man ls' +'norm gO' +lclose +lopen
Solution:
Consider "Table of contents" title.
- Match escape sequences in :command replacement blocks.
- Match :substitute after escape sequences (a temporary fix until Ex
commands are contained).
fixes: vim/vim#17326closes: vim/vim#17663a8b86605f3
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Match Conceal, ComplMatchIns, MsgArea, Terminal, and User[1-9]
highlight groups.
- Generate the vimGroup syntax group from runtime/syncolor.vim.
- Match :SynColor and :SynLink as special user commands.
fixesvim/vim#17467closes: vim/vim#17556c233c2e6a5
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Set minlines and maxlines to 100 and 200 respectively. Set these after
the script interface syntax files have been loaded to ensure the values
set in those are overridden.
fixesvim/vim#17580closes: vim/vim#17614a5b744ef93
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Remove unmatchable :normal {mark,register} matches. The arg to :normal
is now handled separately and contained marks and registers are no
longer matched.
closes: vim/vim#17571dcff497373
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
The required space in Vim9 continuation comments (#\ comment) was
accidentally removed in commit 6acca4b as trailing whitespace.
closes: vim/vim#1757399b9847bd8
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Limit heredoc matches to assignment statements. Matching these at the
top level is very slow.
closes: vim/vim#17473274efcc7e6
Co-authored-by: Doug Kearns <dougkearns@gmail.com>