Commit Graph
3074 Commits
Author SHA1 Message Date
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
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

https://github.com/vim/vim/commit/4bd9b2b2467e696061104a029000e9824c6c609e

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
Kristijan Husak 33d10db5b7 fix(lsp): filter completion candidates based on completeopt (#30945) 2024-11-13 15:18:29 +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 ClasonandJonathan Lopez 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

https://github.com/vim/vim/commit/6fbf63de865001dedafc227465e651926cf6f6dc

Co-authored-by: Jonathan Lopez <jonathanglopez@gmail.com>
2024-11-12 08:18:38 +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
Riley Bruins c5f217db01 refactor(lsp): simplify reference range logic 2024-11-10 09:40:37 +00:00
Lewis Russell 4b001f297a fix(lsp): fix infinite loop
Fixes #31129
2024-11-09 09:41:12 +00:00
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
Christian ClasonandRiley Bruins ba40a6dbe3 vim-patch:9.1.0839: filetype: leo files are not recognized
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/leo

closes: vim/vim#15988

https://github.com/vim/vim/commit/93f65a4ab8168c766e4d3794607762b52762ef82

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-05 08:31:45 +01:00
Christian ClasonandSerhii Khoma 65b9499e4a vim-patch:9.1.0840: filetype: idris2 files are not recognized
Problem:  filetype: idris2 files are not recognized
Solution: detect '*.idr' files as idris2, '*.lidr' files as lidris2
          and '*.ipkg' files as ipkg filetype (Serhii Khoma)

closes: vim/vim#15987

https://github.com/vim/vim/commit/c04bc64ba61f2386fafb086b47f16f122a0c779a

Co-authored-by: Serhii Khoma <srghma@gmail.com>
2024-11-05 08:31:32 +01:00
Yochem van Rosmalen 079e5f4f9b feat(defaults): unimpaired empty line below/above cursor #30984 2024-11-04 06:06:18 -08:00
Famiu Haque a27419f3fc feat(options)!: disallow setting hidden options #28400
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.
2024-11-04 05:00:12 -08:00
Lewis Russell 6e68fed374 feat(lsp): multi-client support for signature_help
Signatures can be cycled using `<C-s>` when the user enters the floating
window.
2024-11-04 11:55:39 +00:00
zeertzjq 99acc9de55 fix(treesitter): close InspectTree/EditQuery window on BufUnload (#31036)
Problem:  The window opened :InspectTree or :EditQuery isn't closed when
          the source buffer is unloaded, even though it is closed when
          the buffer is hidden.
Solution: Also close the window on BufUnload.
2024-11-03 11:28:31 +08:00
zeertzjqandYegappan Lakshmanan 3075c69ff0 vim-patch:9.1.0831: 'findexpr' can't be used as lambad or Funcref (#31058)
Problem:  'findexpr' can't be used for lambads
          (Justin Keyes)
Solution: Replace the findexpr option with the findfunc option
          (Yegappan Lakshmanan)

related: vim/vim#15905
closes: vim/vim#15976

https://github.com/vim/vim/commit/a13f3a4f5de9c150f70298850e34747838904995

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-03 10:06:41 +08:00
Christian Clason 2e3f1069f4 fix(health): better layout of vim.treesitter health check
Problem: Long lists of available parsers make it hard to see WASM
status.

Solution: Add separate headings for "treesitter features" (ABI, WASM)
and "treesitter parsers". Also add minimum supported ABI version.
2024-11-02 23:51:00 +01:00
Christian ClasonandRiley Bruins db46b58569 vim-patch:9.1.0826: filetype: sway files are not recognized
Problem:  filetype: sway files are not recognized
Solution: detect '*.sw' files as sway filetype, include
          a filetype plugin (Riley Bruins)

References:
 https://github.com/FuelLabs/sway.

Comments taken from their syntax documentation. File extension taken
from the same documentation/GitHub's own recognition of these file types

closes: vim/vim#15973

https://github.com/vim/vim/commit/84b5b1c660beb2f9e27de70687e41d39a023ae81

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-02 23:33:38 +01:00
zeertzjq 3688a33354 fix(lua): show stacktrace for error in vim.on_key() callback (#31021) 2024-11-02 10:11:06 +08:00
zeertzjqandChristian Brabandt 7bf3a616e1 vim-patch:b5e7da1: runtime(doc): mention 'iskeyword' at :h charclass() (#31026)
fixes: vim/vim#15965

https://github.com/vim/vim/commit/b5e7da1f27241f7d770d342009e2fb443e45e6ce

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-01 18:22:08 +08:00
Lewis Russell 9b357e30fd feat(lsp)!: remove client-server handlers from vim.lsp.handlers
- Partition the handlers in vim.lsp.handlers as:
  - client to server response handlers (RCS)
  - server to client request handlers (RSC)
  - server to client notification handlers (NSC)

  Note use string indexes instead of protocol.methods for improved
  typing in LuaLS (tip: use hover on RCS, RSC or NSC).
2024-11-01 09:17:39 +00:00
nikolightsaberandNikolai Devolder f54266dbed fix(lsp): hover border type can be string (#31013)
Border type can also be a string as defined in `api-win_config`

Co-authored-by: Nikolai Devolder <nikolai.devolder@yamabiko.eu>
2024-11-01 10:03:09 +01:00
errael b34e137e43 feat(lua): allow vim.on_key() callback to consume the key (#30939) 2024-11-01 09:11:15 +08:00
Lewis Russell be04bbf781 refactor(loader): format annotations 2024-10-31 15:20:29 +00:00
Lewis Russell 086e598a6e refactor(loader): use the term stat instead of hash 2024-10-31 15:20:29 +00:00
Lewis Russell 8d68d883a9 refactor(loader): remove Loader table and use locals 2024-10-31 15:20:29 +00:00
Lewis Russell 4a0010e267 refactor(loader): rename types 2024-10-31 15:20:29 +00:00
Lewis Russell 7ccdd9235a refactor(loader): inline Loader.load into Loader.loadfile 2024-10-31 15:20:29 +00:00
Lewis Russell ab2f2461b5 refactor(loader): simplify Loader.loader_lib 2024-10-31 15:20:27 +00:00
Lewis Russell 53536be62a refactor(loader): simplify Loader.write/read 2024-10-31 15:02:12 +00:00
Lewis Russell f8fc6cb157 perf(loader): reduce calls to Loader.cache_file 2024-10-31 15:02:08 +00:00
Lewis Russell 03118c46ab refactor(loader): remove unused _topmods 2024-10-31 14:15:09 +00:00
Lewis Russell 1d4ba8c1ed fix: another round of type annotation fixes 2024-10-31 11:55:23 +00:00
Christian ClasonandXudong Zheng 82e5066a7f vim-patch:9.1.0823: filetype: Zephyr overlay files not recognized
Problem:  filetype: Zephyr overlay files not recognized
Solution: detect '*.overlay' files as dts filetype,
          include syntax tests for DTS files
          (Xudong Zheng)

Reference:
https://docs.zephyrproject.org/latest/build/dts/howtos.html

closes: vim/vim#15963

https://github.com/vim/vim/commit/a68bd6f089239a51ba90026b18109707e601b107

Co-authored-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2024-10-31 10:24:37 +01:00
notomo b4599acbf8 fix(lsp): correct hover result handling (#30995)
Problem: vim.lsp.buf.hover() displays "No information available" when client_id
is not 1.

Solution: use vim.tbl_isempty(tbl) instead of #tbl==0
2024-10-30 16:57:33 +01:00
Gregory Anders ff93cccbc1 fix(defaults): omit extraneous info from unimpaired mapping errors (#30983) 2024-10-29 10:06:14 -05:00
Kai Moschcau 4c7f5032af docs(options): shell-powershell #30969
`-NonInteractive` at least somewhat hints to pwsh/powershell, that shell
sessions created from :! are not interactive, though even that is not
foolproof, because powershell is weird.
`$PSStyle.OutputRendering='plaintext'` causes pwsh/powershell
to omit ANSI escape sequences in its output.
2024-10-29 07:36:58 -07:00
Lewis Russell 2cd6abf0d7 Merge pull request #30935 from lewis6991/feat/lsp_multi_hover 2024-10-29 09:51:14 +00:00
Lewis Russell 8260e4860b feat(lsp)!: multiple client support for vim.lsp.buf.hover()
Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
2024-10-29 09:06:05 +00:00
Lewis Russell 1471dfc859 refactor(lsp): buf_request_all 2024-10-29 09:06:05 +00:00
zeertzjq 60b3ccd850 vim-patch:9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline argument
Problem:  'findexpr' completion doesn't set v:fname to cmdline argument.
Solution: Set v:fname to the cmdline argument as-is (zeertzjq).

closes: vim/vim#15934

https://github.com/vim/vim/commit/20e045f78148c0ef0143c33ffe686fee72d29376
2024-10-29 08:20:00 +08:00
zeertzjqandYegappan Lakshmanan 378d9135e7 vim-patch:9.1.0810: cannot easily adjust the |:find| command
Problem:  cannot easily adjust the |:find| command
Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan)

closes: vim/vim#15901
closes: vim/vim#15905

https://github.com/vim/vim/commit/aeb1c97db5b9de4f4903e7f288f2aa5ad6c49440

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-29 08:20:00 +08:00
Nikita Revenco 0b7cc014fc feat(defaults): map gO to LSP document_symbol #30781 2024-10-28 06:29:29 -07:00