This changes the type for the sorted pattern table from
`vim.filetype.mapping[]` to `vim.filetype.mapping.sorted[]`
E.g. instead of:
```lua
{
{ ['/debian/changelog$'] = {'debchangelog', { parent = '/debian/' } },
{ ['%.git/'] = { detect.git , { parent = 'git/', priority = -1 } },
}
```
It is now:
```lua
{
{ '/debian/, '/debian/changelog$', 'debchangelog' },
{ 'git/' , '%.git/' , detect.git , -1 },
}
```
Overall this should roughly cut the amount of tables used by 3, and
replaces lots of hash indexes with array indexes.
So let's revert "runtime(tex): add Number highlighting to syntax file"
This (partly) reverts commits 8e6b5034f32049fd0 and 6065755a39d838aab
fixes: vim/vim#16030622f6f5b9a
Co-authored-by: Christian Brabandt <cb@256bit.org>
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.