Fix command name termination, match bang, and allow a line-continued
argument.
closes: vim/vim#15358bbe5252c2c
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Enable folding of class, enum and interface declarations.
- Highlight constructor names with the Function highlight group, like
other special methods.
- Mark function definitions using special method names as errors.
- Highlight :type arguments.
fixes: vim/vim#14393#issuecomment-2042796198.
closes: vim/vim#13810818c641b6f
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Currently, the overriding object method definitions are
matched as vimFunctionError (:help builtin-object-methods,
v9.1.0148).
For example:
------------------------------------------------------------
vim9script
class Test
def string(): string
return "Test"
enddef
endclass
echo string(Test.new()) == Test.new().string()
------------------------------------------------------------
Instead, let's introduce a new syntax group vimMethodName
and make these methods its members. In order to emphasise
the link between the overriding methods and the overridden
functions for highlighting, vimMethodName is linked by
default to vimFuncName.
80aabaab66
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
With the arrival of Vim9 classes, the syntax must allow for
_new_ constructors; multiple constructor definitions are
supported for a class, provided distinct suffix-names are
used. Currently, the defined constructors match either
vimCommand or vimFunctionError (for any newBar).
For example:
------------------------------------------------------------
vim9script
class Foo
def new()
enddef
def newBar()
enddef
endclass
------------------------------------------------------------
Since every constructor is required to bear a lower-cased
_new_ prefix name, it should suffice to distinguish them
from functions, and so there are no new highlight or syntax
groups introduced.
dfcef890cb
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Problem: Ext_messages chunks only contain the highlight attr id, which
is not very useful for vim.ui_attach() consumers.
Solotion: Add highlight group id to message chunks, which can easily be
used to highlight text in the TUI through nvim_buf_set_extmark():
hl_group = synIDattr(id, "name").
This is needed specifically for the second signature of
add_custom_command, which appends an operation to an existing target.
This will prevent the cmake warning CMP0175.
Reference: https://cmake.org/cmake/help/latest/policy/CMP0175.html
Properly escape the values for makeprg according to the :set rules
closes: vim/vim#160140f60fbf679
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Problem: Highlight group id is not propagated to the end of the message call
stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
instead of attr id.
Problem:
The `varp` argument for `set_option` is extraneous as the option's
variable pointer can be retrieved using the option's index and flags.
Solution:
Remove the `varp` argument for `set_option`
Problem: Inccommand preview callback may flush inaccurate cmdline cursor position.
Solution: Ensure cursor is where it belongs when doing command preview.
Problem: Can receive dozens of <MouseMove> events for same cell position. #30965
Solution: Leverage check_multiclick() to detect if cell position is unchanged.
Problem:
When tmpdir is local. The returned values from tmpname may already
exist. This can cause problems for tests which pass `create=false` as
they may require the file to not exist yet.
Solution:
When creating tmp names, always remove it to ensure it doesn't exist,
and optionally open it if `create~=false`
Additionally refactor the tmpname code and flattrn some functions into
constants.
Also while debugging this issue. It was discovered that `exec_lua()`
doesn't report error messages properly. This has been fixed.
Problem: filetype: leo files are not recognized
Solution: detect '*.leo' files as leo filetype, include
a filetype plugin (Riley Bruins)
References:
https://github.com/ProvableHQ/leocloses: vim/vim#1598893f65a4ab8
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Set the "matchparen_disable_cursor_hl" config variable to disable
highlighting the cursor with the MatchParen highlighting group.
closes: vim/vim#1598459834ba6df
Co-authored-by: Matteo Landi <matteo@matteolandi.net>
- Move mantic to unsupported
- Reorder names to maintain alphabetic order
- Bump date to submit upstream
closes: vim/vim#159919dadfe7a52
Co-authored-by: James McCoy <jamessan@jamessan.com>
Problem: tests: still preferring python2 over python3
Solution: prefer Python 3 when picking a Python program in Vim tests,
by checking for the more specific python version first and
only when python3 not found, check for the python binary
(Yee Cheng Chin)
Most OSes have Python 3 mapped to `python3` instead of `python`. Vim
tests should prioritize using that instead of Python 2 in case that is
still installed on the host system.
closes: vim/vim#15986cef8ab2c75
Cherry-pick test changes from patch 8.2.{2824,4684}.
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Problem:
There are three different ways of marking an option as hidden, `enable_if
= false`, `hidden = true` and `immutable = true`. These also have different
behaviors. Options hidden with `enable_if = false` can't have their value
fetched using Vim script or the API, but options hidden with `hidden = true` or
`immutable = true` can. On the other hand, options with `hidden = true` do not
error when trying to set their value, but options with `immutable = true` do.
Solution:
Remove `enable_if = false`, remove the `hidden` property for options, and use
`immutable = true` to mark an option as hidden instead. Also make hidden option
variable pointers always point to the default value, which allows fetching the
value of every hidden option using Vim script and the API. This does also mean
that trying to set a hidden option will now give an error instead of just being
ignored.