Hardcoding a charset causes trouble when porting Vim patches.
I previously tried to unset "charset" for certain file extensions, but
vim-patch.sh can generate more files, and automatically detecting file
encoding is more correct anyway.
`:tabmove` takes either an argument (`:tabmove -`) or an address (`:-tabmove`).
The code assumed that `:tabmove` is the first command on the cmdline, but that
is not the case when using additional modifiers like `:silent`.
Make the addr parsing more robust by searching the command first, then going
back to check for a potential address `-`.
This will check if the string after the variable in a @param is either
"number", "string", "table", "boolean" and "function" and if so add a
parenthesis around it. This will help separate the variable type with
the following text. Had all our functions been annotated with emmylua
then a more robust solution might have been preferable (such as always
assuming the third string is parameter type without making any checks).
I believe however this is a clear improvement over the current situation
and will suffice for now.
At the moment of comparison, the pointer save_curwin can be invalid (as
suggested by the comment) because it has been free'd. Worst, the new
curwin could have been re-allocated to that same pointer, altering the
execution flow unpredictably.
While there are many other potential similar cases to fix in the
codebase, the presented scenario is not hypothetical and does happen in
practice (while spawning new windows from fzf for instance).
There are numerous other instances of curwin comparisons in the
codebase, and they may need further investigation.
closes#16941
Most code in keymap.h is for keycode definitions, while most code in
keymap.c is for the parsing and conversion of keycodes.
The name "keymap" may also make people think these two files are for
mappings, while in fact keycodes are used even when no mappings are
involved, so "keycodes" should be a better file name than "keymap".
It's special cased by the vimSubst syntax group, and isn't present in Vim's
vimCommand group.
For example, this fixes `call s:Foo()` highlighting `:` as Error in Nvim, as the
`s` is parsed as vimCommand rather than as vimUserFunc since
`contains=vimCommand` was added to vimUserFunc (and vimFunc) in a rt update.
Interestingly, `g:`, `l:`, etc. have the same issues due to :global, :list, etc.
Vim also has that problem, so it should ideally be fixed upstream.
We could also omit g[lobal] from vimCommand and rely on vimGlobal instead, but
it doesn't work in some cases, like when there's a `:` before the command. Also,
Vim matches only `g` in vimCommand for some reason, which doesn't produce any
highlight for `:global/foo/bar` (with Nvim you at least get some highlights on
the `global` bit despite the leading `:`).
Also, remove special handling of :py3 in syntax/vim.vim, as the generator seems
to have no problems finding it.
Adds the API function `nvim_cmd` which allows executing an Ex-command through a Dictionary which can have the same values as the return value of `nvim_parse_cmd()`. This makes it much easier to do things like passing arguments with a space to commands that otherwise may not allow it, or to make commands interpret certain characters literally when they otherwise would not.
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
249591057b
A hunk from the patch depends on patch 8.2.4861, which hasn't been
ported yet, but that should be easy to notice.
Problem: Trailing backslash may cause reading past end of line.
Solution: Check for NUL after backslash.
53a70289c2
N/A patches for version.c:
vim-patch:8.2.4926: #ifdef for crypt feature around too many lines
Problem: #ifdef for crypt feature around too many lines.
Solution: Move code outside of #ifdef. (closesvim/vim#10388)
51f0bc31d3
Problem: maparg() may return a string that cannot be reused.
Solution: use msg_outtrans_special() instead of str2special().
(closesvim/vim#10384)
0519ce0039
Problem: Conceal character from matchadd() displayed too many times.
Solution: Check the syntax flag. (closesvim/vim#10381, closesvim/vim#7268)
9830db6305
Problem: Mouse in Insert mode test fails.
Solution: Fix the text and check relevant positions.
8e8dc9b323
Use nvim_input_mouse() to set mouse position, and discard mouse event
using getchar().
vim-patch:8.2.4903: cannot get the current cmdline completion type and position
Problem: Cannot get the current cmdline completion type and position.
Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
closesvim/vim#10344)
79d599b877
vim-patch:8.2.4910: imperfect coding
Problem: Imperfect coding.
Solution: Make code nicer.
9ff7d717aa
LSP servers should be daemonized (detached) so that they run in a
separate process group from Neovim's. Among other things, this ensures
the process does not inherit Neovim's TTY (#18475).
Make this configurable so that clients can explicitly opt-out of
detaching from Nvim.
Problem: Some users do not want a line comment always inserted.
Solution: Add the '/' flag to 'formatoptions' to not repeat the comment
leader after a statement when using "o".
2bf875f881