Commit Graph

7939 Commits

Author SHA1 Message Date
Riley Bruins
44229bb85b
feat(lsp): highlight hover target/range #31110
**Problem:** Despite the LSP providing the option for language servers
to specify a range with a hover response (for highlighting), Neovim does
not give the option to highlight this range.

**Solution:** Add an option to `buf.hover()` which causes this range to
be highlighted.

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2024-11-17 12:31:32 -08:00
luukvbaal
235cb5bc5f
fix(api): update "range" windows in nvim__redraw #31042
Problem:  nvim__redraw's "range" marks a buffer range for redraw, and subsequently
          flushes the UI without updating the windows containing that buffer.
Solution: Implicitly update the screen, unless specified otherwise.
          Only update the screen with the last call of the treesitter
          on_changedtree() callback.
2024-11-17 11:43:36 -08:00
luukvbaal
e025f5a5b3
fix(messages): proper multiline Lua print() messages #31205
Problem:  Separate message emitted for each newline present in Lua
          print() arguments.
Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use
          msg_multiline(). Refactor vim.print() to use print().
2024-11-17 10:21:50 -08:00
Maria José Solano
38838fb00a
fix(lsp): type-errors, other nits in vim.lsp.log #31235 2024-11-16 18:32:09 -08:00
luukvbaal
cdc9baeaf8
fix(treesitter): remove redundant on_bytes callback #31041
Problem:  Treesitter highlighter implements an on_bytes callback that
          just re-marks a buffer range for redraw. The edit that
          prompted the callback will already have done that.
Solution: Remove redundant on_bytes callback from the treesitter
          highlighter module.
2024-11-16 16:25:10 -08:00
luukvbaal
9c718bc2bc
fix(api): validation, documentation of hl_group #31195
Problem:  Documentation for "hl_group" in nvim_buf_set_extmark() is
          unclear. "hl_group" in nvim_echo() does not accept
          highlight group id.
Solution: Move documentation for highlight group name/id to first
          mention of hl_group. Update nvim_echo() to accept highlight
          group id.
2024-11-16 15:36:11 -08:00
luukvbaal
f85bc41c80
feat(ui): don't show unfocusable windows in :tabs, 'tabline' #27984
Problem:  Floating windows with focusable set to false can reasonably be
          expected to be UI elements but are listed in some outputs that
          should contain only regular windows.
Solution: Hide unfocusable floating windows from the default tabline and
          :tabs.
2024-11-16 15:32:36 -08:00
errael
2f7b0018b0
docs: standardize doc for ChanInfo/ChanOpen autocmds/v:event (#31099) 2024-11-16 09:37:36 +08:00
zeertzjq
fbbb9d6f7b
vim-patch:9.1.0866: filetype: LLVM IR files are not recognized (#31228)
Problem:  filetype: LLVM IR files are not recognized
Solution: detect '*.ll' files either as lifelines or llvm filetype
          (Wu, Zhenyu)

closes: vim/vim#15824

bc32bbddcf

N/A patch:
vim-patch:7e4b861: runtime(filetype): remove duplicated *.org file pattern

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-16 00:42:12 +00:00
luukvbaal
6e4df18b45
fix(ui): no fast context for prompt message kinds #31224
Problem:  No longer able to show prompt messages with vim.ui_attach().
Solution: Do not execute callback in fast context for prompt message
          kinds. These events must be safe to show the incoming message
          so the event itself serves to indicate that the message
          should be shown immediately.
2024-11-15 14:34:42 -08:00
Yi Ming
f1748b78e3
feat(default): bind vim.lsp.buf.signature_help in select mode (#31223) 2024-11-15 10:13:41 -06:00
Christian Clason
c33ec2d7ce vim-patch:7c3b65e: runtime(cfg): only consider leading // as starting a comment
fixes: vim/vim#16051

7c3b65eb3e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-15 09:32:15 +01:00
Christian Clason
a785be9cc7 vim-patch:0acd3ab: runtime(sh): better function support for bash/zsh in indent script
closes: vim/vim#16052

0acd3abfad

Co-authored-by: Lukas Zapletal <lzap+git@redhat.com>
2024-11-15 09:32:15 +01:00
Christian Clason
c9045f5ba3 vim-patch:460799d: runtime(netrw): small fixes to netrw#BrowseX
- do not enter dir in Netrw on opening
- double quotes after start cause error on Windows

See @chrisbra 's comments at
[0]

[0]: ff82e7a9db (diff-39baf27d8f62071617bbef12f874cce31c0ebd02ec99e7b119474ca870c636a3R5279)

460799d885

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-15 09:32:15 +01:00
Christian Clason
f0fd9acc4b vim-patch:9.1.0865: filetype: org files are not recognized
Problem:  filetype: org files are not recognized
Solution: detect '*.org' files as 'org' filetype,
          include filetype and syntax plugin
          (Luca Saccarola)

closes: vim/vim#16054

0684800c85

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-15 09:07:37 +01:00
Hyker
6ef80eb42c
fix(treesitter): keep treeview open if source window is still open #31198
Problem: When there is a tree view opened by :InspectTree and the
source buffer is open in multiple windows, closing one of the source
windows will lead to the tree view being closed as well.
Regression by #31181.

Solution: Check how many source windows are open when trying to
quit one. If there are more than one, keep the tree view(s) open.
If the only source window is closed, also close the tree view(s).

fix #31196
2024-11-14 19:00:18 -08:00
zeertzjq
fa0dcde3d9
vim-patch:9.1.0864: message history is fixed to 200 (#31215)
Problem:  message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
          value to 500 (Shougo Matsushita)

closes: vim/vim#16048

4bd9b2b246

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-15 08:04:49 +08:00
bfredl
05d354e216
Merge pull request #27874 from luukvbaal/funcerr
fix(messages)!: vim.ui_attach message callbacks are unsafe
2024-11-14 18:56:56 +01:00
Lewis Russell
d3e4ffafff feat(lsp): support utf-8 and utf-32 position encodings
Resolves #30034
2024-11-14 15:32:49 +00:00
Luuk van Baal
de48fbbd5f fix(messages)!: vim.ui_attach message callbacks are unsafe
Problem:  Lua callbacks for "msg_show" events with vim.ui_attach() are
          executed when it is not safe.
Solution: Disallow non-fast API calls for "msg_show" event callbacks.
          Automatically detach callback after excessive errors.
          Make sure fast APIs do not modify Nvim state.
2024-11-14 13:23:11 +01:00
Christian Clason
40dee8a2dc vim-patch:c4208da: runtime(compiler): include a Java Maven compiler plugin
@Konfekt suggested adding this [1]; I confirmed that both source
repositories have permissive licenses [2], [3] that permit copying the
code (at least where the compiler scripts are concerned).

[1]: 570b1006fd
[2]: https://github.com/JalaiAmitahl/maven-compiler.vim
[3]: https://github.com/mikelue/vim-maven-plugin/issues/13

closes: vim/vim#16041

c4208da0f4

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-11-14 09:35:11 +01:00
Christian Clason
c905f16507 vim-patch:8e013b1: runtime(racket): update Racket runtime files
This brings the included Racket runtime files to commit c41bc5a (indent
for[*]/lists with accumulator clause correctly, 2024-11-12) of
https://github.com/benknoble/vim-racket.

Note that not all files from that repository are included.

closes: vim/vim#16046

8e013b1421

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-11-14 09:35:11 +01:00
zeertzjq
41be1bfe05 vim-patch:9b05326: runtime(doc): improve indentation in examples for netrw-handler
related: vim/vim#16043

9b05326afd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-14 07:21:38 +08:00
zeertzjq
d410583e7d vim-patch:8b96858: runtime(doc): improve examples for netrw-handler functions
fixes: vim/vim#16043

8b96858996

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-14 07:21:25 +08:00
Kristijan Husak
33d10db5b7
fix(lsp): filter completion candidates based on completeopt (#30945) 2024-11-13 15:18:29 +00:00
zeertzjq
eaf5ae6cc6
vim-patch:210c49b: runtime(compiler): update pylint linter (#31191)
closes: vim/vim#16039

210c49bbe8

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-13 08:00:35 +00:00
Christian Clason
096cb572af vim-patch:5ca8f22: runtime(idris2): include filetype,indent+syntax plugins for (L)Idris2 + ipkg
closes: vim/vim#15993

5ca8f223f0

Co-authored-by: Serhii Khoma <srghma@gmail.com>
Co-authored-by: Christian Clason <ch.clason+github@icloud.com>
2024-11-13 08:24:14 +01:00
zeertzjq
1128d75550
vim-patch:f18987c: runtime(doc): clarify the use of filters and external commands (#31185)
related: vim/vim#16044

f18987caa5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-12 23:38:59 +00:00
hykerr
86b737649b fix(treesitter): add 'QuitPre' event to autocommands in inspect_tree
Problem: Quitting source buffer for ```:InspectTree``` command raises
```E855``` when source buffer and tree views are the only open buffers.

Solution: Add ```QuitPre``` event to autocmd handling closing/hiding the
source buffer to close all open tree views. This allows nvim to quit
when source and tree buffers are the only open windows.
2024-11-12 16:10:43 +00:00
Nicolas Hillegeer
9aab98a275 refactor(lsp): avoid redundant function wrapping
Leftover from #21026.
2024-11-12 16:10:16 +00:00
Christian Clason
295f98c8e0 vim-patch:9.1.0853: filetype: kubernetes config file not recognized
Problem:  filetype: kubernetes config file not recognized
Solution: detect '/.kube/config' file as yaml filetype
          (Jonathan Lopez)

closes: vim/vim#11076

6fbf63de86

Co-authored-by: Jonathan Lopez <jonathanglopez@gmail.com>
2024-11-12 08:18:38 +01:00
Christian Clason
c026a114b5 vim-patch:129a844: runtime(tar): Update tar.vim to support permissions
These changes enable tar.vim to keep permissions of files that were
edited intact instead of replacing them with the default permissions.

The major change for this is switching from "tar -OPxf", which reads out
the contents of the selected file from an tar archive to stdout to
"tar -pPxf" which extracts the selected file to the current directory
with permissions intact

This requirs the temporary directory to be created earlier.

closes: vim/vim#7379

129a8446d2

Co-authored-by: Lennart00 <73488709+Lennart00@users.noreply.github.com>
2024-11-12 08:18:22 +01:00
Lewis Russell
3e855d533f
perf(lsp): use faster version of str_byteindex 2024-11-11 14:23:38 +00: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
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
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
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
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