Commit Graph

31387 Commits

Author SHA1 Message Date
Luuk van Baal
9fa3a0964e fix(messages): pass previous highlight id to ext chunks 2024-11-11 15:15:33 +01:00
Lewis Russell
ff575b3886 perf(filetype): optimize internal data structures
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.
2024-11-11 13:42:24 +00:00
bfredl
29fd5ed606 refactor(tests): use more global highlight definitions 2024-11-11 14:27:25 +01:00
bfredl
d0e78b5871
Merge pull request #27813 from luukvbaal/msgid
feat(ext_messages): add hl_id to ext_messages chunks
2024-11-11 12:26:35 +01:00
Christian Clason
7919aa9102 vim-patch:622f6f5: runtime(tex): extra Number highlighting causes issues
So let's revert "runtime(tex): add Number highlighting to syntax file"

This (partly) reverts commits 8e6b5034f32049fd0 and 6065755a39d838aab

fixes: vim/vim#16030

622f6f5b9a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 09:24:57 +01:00
zeertzjq
7906532e08
vim-patch:5b63b23: runtime(netrw): directory symlink not resolved in tree view (#31161)
closes: vim/vim#16020

5b63b236a0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 07:52:11 +00:00
Christian Clason
f37d290775 vim-patch:6065755: runtime(tex): update Last Change header in syntax script
related: vim/vim#11271

6065755a39

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 08:23:46 +01:00
zeertzjq
adbffff5d0
vim-patch:9.1.0849: there are a few typos in the source (#31159)
Problem:  there are a few typos in the source.
Solution: Correct typos (zeertzjq).

closes: vim/vim#16026

7c5152826f
2024-11-11 08:20:41 +08:00
zeertzjq
0e54931b99
vim-patch:060107c: runtime(doc): fix typo in g:termdebug_config (#31155)
closes: vim/vim#16023

060107cbc4
2024-11-10 21:47:24 +08:00
Christian Clason
f59aeb5a9a build(deps): bump tree-sitter to v0.24.4 2024-11-10 11:34:23 +01:00
Christian Clason
07b72d9036 vim-patch:8e6b503: runtime(tex): add Number highlighting to syntax file
closes: vim/vim#11271

8e6b5034f3

Co-authored-by: amarakon <amar.al-zubaidi45@tutanota.com>
2024-11-10 11:05:26 +01:00
Christian Clason
5ff9a9397e vim-patch:a14c457: runtime(dune): use :setl instead of :set in ftplugin
closes: vim/vim#11419

a14c457cad

Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
2024-11-10 11:05:26 +01:00
Riley Bruins
c5f217db01 refactor(lsp): simplify reference range logic 2024-11-10 09:40:37 +00:00
zeertzjq
0eae0bc804
Merge pull request #31150 from zeertzjq/vim-bbe5252
vim-patch: Vim syntax updates
2024-11-10 10:35:57 +08:00
zeertzjq
d090a02780 vim-patch:bbe5252: runtime(vim): Update base-syntax, improve :normal highlighting
Fix command name termination, match bang, and allow a line-continued
argument.

closes: vim/vim#15358

bbe5252c2c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-11-10 10:03:41 +08:00
zeertzjq
93dbf1d86c vim-patch:818c641: runtime(vim): Update base-syntax file, improve class, enum and interface highlighting
- 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#13810

818c641b6f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-11-10 10:03:20 +08:00
zeertzjq
e9dc9be469 vim-patch:80aabaa: runtime(vim): Distinguish Vim9 builtin object methods from namesake builtin functions (vim/vim#14348)
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>
2024-11-10 10:03:20 +08:00
zeertzjq
f25ffc43a7 vim-patch:dfcef89: runtime(vim): Distinguish Vim9 constructor definitions from the :new ex command (vim/vim#14050)
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>
2024-11-10 10:03:20 +08:00
zeertzjq
3da8f4c7ee
vim-patch:5e7f43b: runtime(termdebug): allow to use decimal signs (#31149)
closes: vim/vim#16011

5e7f43b6ac

Co-authored-by: Ella Moss <ella.moss@utah.edu>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-10 09:24:27 +08:00
zeertzjq
7232b54aee
vim-patch:partial:624bb83: runtime(doc): Tweak documentation style a bit (#31148)
closes: vim/vim#11419

624bb83619

Skip syncolor.vim and v:colornames

Co-authored-by: h-east <h.east.727@gmail.com>
2024-11-10 09:11:06 +08:00
dundargoc
7d8dd8234a ci: downgrade to clang 19
Clang 20 is still in development at the time of this commit and is
unsuitable for CI.
2024-11-09 15:42:52 +01:00
Luuk van Baal
4f9260d06a feat(ext_messages): add hl_id to ext_messages chunks
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").
2024-11-09 14:28:17 +01:00
bfredl
dd4c828c86
Merge pull request #31118 from bfredl/merehl
refactor(tests): continue the global highlight definition work
2024-11-09 13:48:45 +01:00
dundargoc
07b14c8e2e build: specify POST_BUILD when using add_custom_command
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
2024-11-09 13:07:16 +01:00
Lewis Russell
4b001f297a fix(lsp): fix infinite loop
Fixes #31129
2024-11-09 09:41:12 +00:00
zeertzjq
b7e1bbfb50
Merge pull request #31130 from zeertzjq/vim-3780c11
vim-patch: runtime file updates
2024-11-09 09:31:52 +08:00
zeertzjq
c914ecf4c9 vim-patch:0f60fbf: runtime(compiler): improve cppcheck
Properly escape the values for makeprg according to the :set rules

closes: vim/vim#16014

0f60fbf679

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-09 08:45:10 +08:00
zeertzjq
591884c9fb vim-patch:39f52a6: runtime(structurizr): Update structurizr syntax
closes: vim/vim#16003

39f52a6249

Co-authored-by: Duke <emersonalmeidax@gmail.com>
2024-11-09 08:44:44 +08:00
zeertzjq
6b6a3b3894 vim-patch:6e410c9: runtime(8th): updated 8th syntax
closes: vim/vim#16005

6e410c9112

Co-authored-by: Ron Aaron <ron@aaron-tech.com>
2024-11-09 08:44:20 +08:00
zeertzjq
b4c5e743ac vim-patch:6d9a145: runtime(compiler): add mypy and ruff compiler; update pylint linter
mypy and ruff come from
https://github.com/Konfekt/vim-compilers/tree/master/compiler and the
former was added by @pbnj-dragon

closes: vim/vim#16007

6d9a145d71

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-09 08:43:50 +08:00
zeertzjq
5c600370e0 vim-patch:64a536d: runtime(netrw): fix several bugs in netrw tree listing
fixes: vim/vim#5630
fixes: vim/vim#9807
fixes: vim/vim#14623
closes: vim/vim#15996

64a536d4fa

Co-authored-by: Tom Benham <tom.benham13@gmail.com>
2024-11-09 08:41:04 +08:00
zeertzjq
1d9eb84558 vim-patch:a063b22: runtime(netrw): prevent polluting the search history
a063b22b3b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-09 08:24:19 +08:00
zeertzjq
32566dc1c3 vim-patch:3780c11: runtime(compiler): fix typo in cppcheck compiler plugin
closes: vim/vim#16002

3780c11267

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-11-09 08:23:59 +08:00
dundargoc
5a27d02584
docs: misc (#30914)
Co-authored-by: Ernie Rael <errael@raelity.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Jade <spacey-sooty@proton.me>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-09 08:10:56 +08:00
Lewis Russell
ad3472e291 fix(vim.system): resolve executable paths on windows
Fixes #31107
2024-11-08 16:29:44 +00:00
Lewis Russell
7342e6b00d perf(lsp): do not apply semantic tokens to folded lines
Fixes #31106
2024-11-08 14:01:35 +00:00
Luuk van Baal
5cfa7a72f8 refactor(message): propagate highlight id instead of attrs
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.
2024-11-08 13:21:35 +01:00
bfredl
abe6a07c54 refactor(tests): continue the global highlight definition work 2024-11-08 13:19:15 +01:00
bfredl
475f9f64ef
Merge pull request #31073 from bfredl/cmdchar
fix(cmdline): simplify and correct grapheme cluster adjustment
2024-11-08 13:08:14 +01:00
bfredl
092042b43d fix(cmdline): simplify and correct grapheme cluster adjustment 2024-11-08 11:25:34 +01:00
bfredl
8ab1903092
Merge pull request #31040 from luukvbaal/cmdpreviewcurs
fix(inccommand): ensure cursor is where it belongs
2024-11-08 11:22:14 +01:00
zeertzjq
f83a31b49d
refactor(options): use os_win/os_buf for local options (#31060)
Conversely, don't use them for global options.
2024-11-08 06:54:28 +00:00
Famiu Haque
8af1702647
refactor(options): remove varp argument for set_option (#31111)
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`
2024-11-08 13:28:18 +08:00
Luuk van Baal
59e130b6ca fix(inccommand): ensure cursor is where it belongs
Problem:  Inccommand preview callback may flush inaccurate cmdline cursor position.
Solution: Ensure cursor is where it belongs when doing command preview.
2024-11-07 13:12:30 +01:00
zeertzjq
5a86360400
test: add test for key following ignored mouse move (#31104) 2024-11-07 17:53:30 +08:00
errael
000129201c
perf(mouse): only generate <MouseMove> for a new cell positon (#31103)
Problem: Can receive dozens of <MouseMove> events for same cell position. #30965
Solution: Leverage check_multiclick() to detect if cell position is unchanged.
2024-11-07 16:21:28 +08:00
Lewis Russell
f7e32fb6e6 fix(test): better management of tmpfiles
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.
2024-11-06 11:37:33 +00:00
dundargoc
f8b193a01e ci: adjust reviewers 2024-11-06 11:22:09 +01:00
bfredl
c0f222d55b
Merge pull request #31062 from famiu/refactor/options/ff_macro
refactor(options): remove fileformat macros
2024-11-06 10:19:28 +01:00
Famiu Haque
04274a4173
refactor(options): remove unnecessary call to find_option() (#31088) 2024-11-06 06:07:29 +08:00