Commit Graph

8073 Commits

Author SHA1 Message Date
zeertzjq
98e3610316 vim-patch:41d6de2: runtime(doc): update the change.txt help file
41d6de2974

Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2024-12-17 08:20:18 +08:00
Justin M. Keyes
022449b522
fix(api): generic error messages, not using TRY_WRAP #31596
Problem:
- API functions using `try_start` directly, do not surface the
  underlying error message, and instead show generic messages.
- Error-handling code is duplicated in the API impl.
- Failure modes are not tested.

Solution:
- Use `TRY_WRAP`.
- Add tests.
2024-12-16 08:34:16 -08:00
Lewis Russell
47f2769b46 fix(Man): completion on Mac
Problem:
`man -w` does not work on recent versions of MacOs.

Solution:
Make it so an empty result is interpreted as an error unless silent=true
2024-12-16 16:05:08 +00:00
Juan Cruz De La Torre
6c975515c5
fix(diagnostic): vim.diagnostic.setqflist() opens loclist on first call #31585
Problem:
Regression from de794f2d24: `vim.diagnostic.setqflist{open=true}` attempts to
open the location list instead of the diagnostics quickfix list if it didn't
exist before. This is because we are using `qf_id` to decide which to open, but
`qf_id=nil` when there is no existing diagnostics quickfix list with a given
title ("Diagnostics" by default).

Solution:
- Revert to using `loclist` to decide which to open.
- Add tests.
2024-12-16 06:38:57 -08:00
Tomasz N
9c6a3703bb
fix(messages): no message kind for :undo messages #31590
Problem: cannot handle `:undo` and `:redo` messages in a special way,
e.g. replace one by another.

Solution: add `undo` kind.
2024-12-16 03:07:27 -08:00
Christian Clason
cc38630d39 vim-patch:9.1.0929: filetype: lalrpop files are not recognized
Problem:  filetype: lalrpop files are not recognized
Solution: detect '*.lalrpop' files as lalrpop filetype
          (David Thievon)

References:
https://github.com/lalrpop/lalrpop

closes: vim/vim#16223

5a2e0cf5f1

Co-authored-by: David Thievon <pdkfan@gmail.com>
2024-12-16 00:19:16 +01:00
Christian Clason
6c2c77b128 vim-patch:9.1.0926: filetype: Pixi lock files are not recognized
Problem:  filetype: Pixi lock files are not recognized
Solution: detect "pixi.lock" file as yaml filetype
          (Brandon Maier)

Reference:
https://pixi.sh/latest/features/lockfile/

closes: vim/vim#16212

7d1bb90dcf

Co-authored-by: Brandon Maier <brandon.maier@gmail.com>
2024-12-15 12:42:27 +01:00
zeertzjq
3406b00911 vim-patch:fbe9a69: runtime(doc): Add a reference to |++opt| and |+cmd| at :h :pedit
closes: vim/vim#16217

fbe9a6903a

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-12-15 07:10:12 +08:00
zeertzjq
caa93b5e1e vim-patch:ed89206: runtime(doc): add a note about inclusive motions and exclusive selection
related: vim/vim#16202

ed89206efe

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-15 07:09:39 +08:00
luukvbaal
433b342baa
feat(ui): sign/statuscolumn can combine highlight attrs #31575
Problem:
Since e049c6e4c0, most statusline-like UI elements can combine
highlight attrs, except for sign/statuscolumn.

Solution:
Implement for sign/statuscolumn.
2024-12-14 10:21:50 -08:00
Colin Kennedy
f9dd682621 docs(annotations): added ---@generic support 2024-12-13 17:05:38 +00:00
Justin M. Keyes
65b1733405
Revert "fix(Man.lua): trigger completion even without arguments" #31572
This reverts commit 7940ec6913.
2024-12-13 06:46:40 -08:00
Lewis Russell
9c20342297 fix(lsp): reuse client if configs match and no root dir
Problem:
An LSP configuration that creates client with no root_dir or
workspace_folders can result in vim.lsp.enable attaching to it multiple
times.

Solution:
When checking existing clients, reuse a client if it wasn't initially
configured have any workspace_folders. This more closely matches the
behaviour we had prior to d9235ef
2024-12-13 14:36:24 +00:00
Luca Saccarola
7940ec6913
fix(man.lua): :Man <tab> does not complete #31569
closes: #31512
2024-12-13 06:26:20 -08:00
Christian Clason
3e3a984300 vim-patch:5c42c77: runtime(netrw): do not pollute search history with symlinks
fixes: vim/vim#16206

5c42c77315

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-13 09:38:19 +01:00
Christian Clason
2e73ba102a vim-patch:9.1.0919: filetype: some assembler files are not recognized
Problem:  filetype: some assembler are files not recognized
Solution: detect '*.nasm' files as nasm filetype and '*.masm' as masm
          filetype (Wu, Zhenyu)

closes: vim/vim#16194

d66d68763d

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-13 09:38:08 +01:00
Jeremy Fleischman
de794f2d24
fix(diagnostic): broken variable reference #31557 2024-12-12 02:41:57 -08:00
Lewis Russell
130f4344cf refactor(lsp/rpc): move transport logic to separate module 2024-12-12 09:52:08 +00:00
Jeremy Fleischman
5eda7aafe9
fix(diagnostic): setqflist() is stuck after vim.lsp.buf.document_symbol #31553
Previously, when updating the quickfix diagnostics list, we'd update it,
and then open the quickfix buffer, but there was no guarantee that the
quickfix buffer would be displaying the quickfix diagnostics list (it
could very possibly be displaying some other quickfix list!).

This fixes things so we first select the quickfix list before opening the
quickfix buffer. If `open` is not specified, the behavior is the same as
before: we update the diagnostics quickfix list, but do not navigate to
it.

fixes https://github.com/neovim/neovim/issues/31540
2024-12-11 17:32:07 -08:00
Jeremy Fleischman
21961967ff
feat(diagnostic): update quickfix list by title #31486
Previously, there was a singleton diagnostics quickfix list. Now there's
effectively one per title (up to vim's internal limit on quickfix
lists).

Suggested by mfussenegger https://github.com/neovim/neovim/pull/30868#pullrequestreview-2385761374.
2024-12-11 17:29:54 -08:00
Jonny Kong
442d338cb5
fix(uri): uri_encode encodes brackets incorrectly for RFC2732 #31284
**Problem:**
The brackets in the RFC2732 regular expression are currently unescaped,
causing them to be misinterpreted as special characters denoting
character groups rather than as literal characters.

**Solution:**
Escape the brackets.
Fix #31270
2024-12-11 05:48:17 -08:00
Riley Bruins
3dfb9e6f60
feat(treesitter): include capture id in return value of get_captures_at_pos() #30559
**Problem:** Currently, it is difficult to get node(s)-level metadata
for a capture returned by `get_captures_at_pos()`. This is because it is
stored in `metadata[id]` and we do not have access to the value of `id`,
so to get this value we have to iterate over the keys of `metadata`. See
[this commit](d636229300 (diff-8bd4742121c2f359d0345f3c6c253a58220f1a28670cc4e1c957992232059a6cR16)).

Things would be much simpler if we were given the `id` of the capture so
we could use it to just index `metadata` directly.

**Solution:** Include `id` in the data returned by
`get_captures_at_pos()`
2024-12-11 04:34:24 -08:00
Colin Kennedy
492ae57aa6
docs(annotation): return types for Vimscript functions #31546 2024-12-11 03:27:08 -08:00
Lewis Russell
3f1d09bc94 feat(lsp): add vim.lsp.config and vim.lsp.enable
Design goals/requirements:
- Default configuration of a server can be distributed across multiple sources.
  - And via RTP discovery.
- Default configuration can be specified for all servers.
- Configuration _can_ be project specific.

Solution:

- Two new API's:
  - `vim.lsp.config(name, cfg)`:
    - Used to define default configurations for servers of name.
    - Can be used like a table or called as a function.
    - Use `vim.lsp.confg('*', cfg)` to specify default config for all
      servers.
  - `vim.lsp.enable(name)`
    - Used to enable servers of name. Uses configuration defined
    via `vim.lsp.config()`.
2024-12-10 17:16:01 +00:00
Tomasz N
ca760e645b
fix(messages): no message kind for :write messages #31519
- Problem: cannot replace the initial bufwrite message (from `filemess`) by the final one (`"test.lua" [New] 0L, 0B written`), when using `vim.ui_attach`.
- Solution: add kind to both messages.
2024-12-10 02:39:41 -08:00
bfredl
c87ca1e2eb
Merge pull request #30869 from vanaigr/decor_long_lines_perf
perf(decor): improve performance for long lines
2024-12-10 10:26:03 +01:00
Christian Clason
4182e98752 vim-patch:b66cac1: runtime(typst): add definition lists to formatlistpat, update maintainer
closes: vim/vim#16192

b66cac1a8e

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-10 08:06:35 +01:00
Christian Clason
c3899419d4 vim-patch:ad4764f: runtime(proto): include filetype plugin for protobuf
closes: vim/vim#16199

ad4764f65b

Co-authored-by: David Pedersen <limero@me.com>
2024-12-10 08:06:35 +01:00
luukvbaal
4889935a7a
docs(vvars): adjust lua types for vim.v variables #31510
- classes for v:event and v:completed_item
- add remaining unknown types
2024-12-09 16:27:39 -08:00
Maria José Solano
3bb2d02759 docs: fix type of vim.validate value 2024-12-09 07:59:51 +00:00
zeertzjq
3d318be8cd vim-patch:92b3666: runtime(netrw): only check first arg of netrw_browsex_viewer for being executable
fixes: vim/vim#16185

92b36663f8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-09 08:08:44 +08:00
zeertzjq
d7b3add63e vim-patch:eda923e: runtime(netrw): do not detach when launching external programs in gvim
On Debian 12 when detaching the program wouldn't launch at all

closes: vim/vim#16168

eda923e9c9

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-09 08:07:06 +08:00
Lewis Russell
4bfdd1ee9d refactor(lsp): better tracking of requests
Not essential, but adds robustness and hardening for future
changes.
2024-12-08 10:10:29 +00:00
zeertzjq
bf7e534c88 vim-patch:41afa30: runtime(doc): Add vietnamese.txt to helps main TOC
closes: vim/vim#16177

41afa308d6

Co-authored-by: h-east <h.east.727@gmail.com>
2024-12-08 08:46:33 +08:00
brianhuster
99a24d511f vim-patch:8a52587: runtime(doc): fix wrong syntax and style of vietnamese.txt
8a52587ee0

vim-patch:72212c9: runtime(doc): update wrong Vietnamese localization tag

72212c9bea

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-08 08:46:33 +08:00
brianhuster
5549115bee vim-patch:189e24b: runtime(doc): include vietnamese.txt
Since Vietnamese keymaps in Vim is quite differences from the
corresponding input methods, let's document the Vietnamese specifics in
vietnames.txt

related: vim/vim#16144

189e24bb14
2024-12-08 08:46:33 +08:00
zeertzjq
96329910b0 vim-patch:9.1.0911: Variable name for 'messagesopt' doesn't match short name
Problem:  Variable name for 'messagesopt' doesn't match short name
          (after v9.1.0908)
Solution: Change p_meo to p_mopt.  Add more details to docs.

closes: vim/vim#16182

8cc43daee1
2024-12-08 07:06:16 +08:00
zeertzjq
f3fa6507f2 vim-patch:9.1.0910: 'messagesopt' does not check max wait time
Problem:  'messagesopt' does not check max wait time
          (after v9.1.0908)
Solution: Check for max wait value
          (Shougo Matsushita)

closes: vim/vim#16183

d9e9f89e0f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-12-08 07:01:50 +08:00
Lewis Russell
668d2569b4 refactor: add vim._resolve_bufnr 2024-12-07 16:58:40 +00:00
Christian Clason
b52ffd0a59 fix(inspect): always show priority
Problem: It is not obvious if a treesitter highlight priority shown in
`:Inspect` is higher or lower than the default.

Solution: Also print default priority (`vim.hl.priorities.treesitter`).
Add padding for better readability.
2024-12-07 17:26:27 +01:00
zeertzjq
4817547ec4
feat(ex_cmds): :sleep! hides the cursor while sleeping (#31493)
Problem:  :sleep! not hiding the cursor is an arbitrary difference from
          Vim without obvious justification, and Vim's behavior isn't
          easily achievable in Nvim.
Solution: Make :sleep! hide the cursor while sleeping.

Ref:
6a01b3fcc3
b5c0ade437
2024-12-07 21:42:44 +08:00
Riley Bruins
c63e49cce2
fix(treesitter): #trim! range for nodes ending at col 0 #31488
Problem:
char-wise folding for `#trim!` ranges are improperly calculated for nodes that
end at column 0, due to the way `get_node_text` works.

Solution:
Add the blank line that `get_node_text` removes for for nodes ending at column
0. Also properly set column positions when performing linewise trims.
2024-12-07 03:01:59 -08:00
Lewis Russell
5c245ec3e9 fix: remove vim.lsp._with_extend
Not used anywhere.
2024-12-07 10:08:58 +00:00
tris203
bdfba8598b fix(lsp): cancel pending requests before refreshing
Problem:
Diagnostics and inlay hints can be expensive to calculate, and we
shouldn't stack them as this can cause noticeable lag.

Solution:
Check for duplicate inflight requests and cancel them before issuing a new one.
This ensures that only the latest request is processed, improving
performance and preventing potential conflicts.
2024-12-07 10:08:33 +00:00
Maria José Solano
c2bf09ddff fix(lsp): check for configuration workspace folders when reusing clients 2024-12-07 09:43:45 +00:00
Christian Clason
9c278af7cc fix(inspect): show priority for treesitter highlights
Problem: `:Inspect` does not show priority for treesitter highlights,
leading to confusion why sometimes earlier highlights override later
highlights.

Solution: Also print priority metadata if set.
2024-12-07 10:26:24 +01:00
zeertzjq
ec94c2704f
vim-patch:9.1.0908: not possible to configure :messages (#31492)
Problem:  not possible to configure :messages
Solution: add the 'messagesopt' option (Shougo Matsushita)

closes: vim/vim#16068

51d4d84d6a

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: h_east <h.east.727@gmail.com>
2024-12-07 02:17:36 +00:00
Bartłomiej Maryńczak
517ecb85f5
feat(stdlib): vim.json.encode(...,{escape_slash:boolean}) #30561
Problem:
vim.json.encode escapes every slash in string values (for example in
file paths), and is not optional. Use-case is for preventing HTML
injections (eg. injecting `</script>` closing tag); in the context of
Nvim this is rarely useful.

Solution:
- Add a `escape_slash` flag to `vim.json.encode`.
- Defaults to `false`. (This is a "breaking" change, but more like
  a bug fix.)
2024-12-06 12:43:41 -08:00
Tristan Knight
fac96b72a5
fix(lsp): add foldingrange method support check #31463
Problem: The folding_range request method assumes that the client
supports the method

Solution: Add a capability guard to the call
2024-12-06 10:09:07 -08:00
Gregory Anders
2550b5e9bd
docs: do not escape Lua keywords #31467 2024-12-06 10:08:46 -08:00