Commit Graph

7161 Commits

Author SHA1 Message Date
Maria José Solano
608543f8a9
fix(snippet): cancel snippet session when leaving the buffer (#29031) 2024-05-27 17:18:10 +02:00
Ilia Choly
292365fa1b
fix(lsp): do not detach from buffer if there are uninitialized clients (#29029)
Problem: if on_lines is called before the LSP is initialized, the buffer
is detached.
Solution: check for uninitialized clients before detaching.
2024-05-27 17:06:03 +02:00
zeertzjq
8893b7b340
vim-patch:393708c: runtime(vim): re-generate vim syntax from generator (#29041)
related: vim/vim#14861

393708cff6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-27 22:38:10 +08:00
Gregory Anders
48251134ee
perf: add fast path to vim.validate (#28977)
For many small/simple functions (like those found in shared.lua), the
runtime of vim.validate can far exceed the runtime of the function
itself. Add an "overload" to vim.validate that uses a simple assertion
pattern, rather than parsing a full "validation spec".
2024-05-27 08:08:23 -05:00
Guilherme Soares
c4eb0b64bd
fix(treesitter): find buffer in multiple windows #28922
Problem:
1. When interacting with multiple :InspectTree and the source buffer
   windows there is a high chance of errors due to the window ids not
   being updated and validated.
2. Not all InspectTree windows were closed when the source buffer was
   closed.

Solution:
1. Update InspectTree window id on `CursorMoved` event and validate
   source buffer window id before trying to navigate to it.
2. Close all InspectTree windows
2024-05-27 04:20:03 -07:00
Christian Clason
ffbd09ef6a vim-patch:8607192: runtime(typescriptreact): fix highlighting nested and escaped quotes in string props (vim/vim#14852)
86071925ed

Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
2024-05-27 06:59:01 +02:00
Christian Clason
14a7644181 vim-patch:76174e7: runtime(asm): remove the indent plugin since it has too many issues
fixes: vim/vim#14791

76174e7110

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-27 06:59:01 +02:00
Riley Bruins
eb37241d38
fix(tohtml): properly handle multiple hl groups #29012
Problem: :TOhtml doesn't properly handle virtual text when it has
multiple highlight groups. It also improperly calculates position offset
for multi-byte virt_text characters.

Solution: Apply the `vim.api.nvim_strwidth` broadly to properly
calculate character offset, and handle the cases where the `hl` argument
can be a table of multiple hl groups.
2024-05-26 10:27:12 -07:00
altermo
88c7997503 fix(tohtml): show how many warnings are hidden 2024-05-26 13:57:30 +02:00
altermo
8cd9feb501 fix(tohtml): ignore lsp inlay hints 2024-05-26 13:14:40 +02:00
altermo
2ed6423c7e fix(tohtml): replace ipairs with pairs 2024-05-26 12:56:32 +02:00
Christian Clason
61b3a26e5b build(deps): bump tree-sitter-query to v0.4.0 2024-05-26 12:38:20 +02:00
zeertzjq
3d39ea3ea9
vim-patch:9.1.0442: hare runtime files outdated (#29011)
Problem:  hare runtime files outdated
Solution: runtime(hare): update hare.vim to match upstream
          (Amelia Clarke)

closes: vim/vim#14836

35dfe58a54

Co-authored-by: Amelia Clarke <selene@perilune.dev>
2024-05-26 07:11:50 +08:00
Christian Clason
eaaf3d9048 vim-patch:0076ddc: runtime(debian): update Debian runtime files (vim/vim#14849)
* Add space in template for 'commentstring'
* Add 'comments' and 'commentstring' support to debcontrol
* debversions: Move Ubuntu releases outside of standard support to unsupported
  Although trust, xenial, and bionic are not EOL yet, their standard support period has ended.

Reported-by: Riley Bruins <ribru17@gmail.com>

0076ddc07d

Co-authored-by: James McCoy <jamessan@debian.org>
Co-authored-by: Riley Bruins <ribru17@gmail.com>
2024-05-25 23:51:55 +02:00
Mathias Fußenegger
7994fdba6a
fix(snippet): don't override unnamed register on tabstop select (#28998) 2024-05-25 21:23:04 +02:00
Mathias Fußenegger
f03b1622ad
fix(lsp): handle nil root_dir in health check (#29007)
The root directory could show up as something like:

    Root directory: ~/path/to/cwd/v:null

Despite being `nil`
2024-05-25 21:22:41 +02:00
dundargoc
520c2657bb refactor: move provider-related to where they are used 2024-05-25 20:13:17 +02:00
Rafael Kitover
fdeb01cd77
feat(main): expand file ~\ or ~/ prefix on Windows (#28515)
In command_line_scan() for MSWIN, expand "~\" or "~/" prefixed paths to
the USERPROFILE environment variable for the user's profile directory.

Fix #23901

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-25 20:44:39 +08:00
zeertzjq
bdb81afab3
refactor(lua): rewrite vim.highlight.range() (#28986)
- Use getregionpos().
- Use a single extmark for non-blockwise selection.
2024-05-25 20:37:33 +08:00
bfredl
75f6ee5b26
Merge pull request #28617 from glepnir/border_hl
fix(float): missing default highlight for title
2024-05-25 11:13:58 +02:00
zeertzjq
4757d497f3
vim-patch:9.1.0444: Not enough tests for getregion() with multibyte chars (#29000)
Problem:  Not enough tests for getregion() with multibyte chars.
Solution: Add a few more tests (zeertzjq).

closes: vim/vim#14844

dff55a3358
2024-05-25 16:53:10 +08:00
Christian Clason
b43244adaf vim-patch:5e45715: runtime(typescript): update outdated syntax files
fixes: vim/vim#14721
fixes: HerringtonDarkholme/yats.vim#277
closes: vim/vim#14840

5e45715084

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2024-05-25 09:46:33 +02:00
Christian Clason
4c7fd323ec vim-patch:b1ffc52: runtime(i3config/swayconfig): fix floating_modifier highlight (vim/vim#14841)
b1ffc52694

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2024-05-25 09:46:33 +02:00
glepnir
8b2b1fba2a fix(float): missing default highlight for title
Problem: there is missing default title highlight when highlight not defined in title text chunk.

Solution: when attr is not set use default title highlight group.
2024-05-25 15:34:29 +08:00
Gregory Anders
5d26934c7c
feat(lsp): update LSP healthcheck format (#28980)
This is mostly an aesthetic change, although there are a few new pieces
of information included. Originally I wanted to investigate including
server capabilities in the healthcheck, but until we have the ability to
fold/unfold text in health checks that would be too much information.
2024-05-24 18:31:25 -05:00
zeertzjq
06347a64ca
vim-patch:9.1.0443: Can't use blockwise selection with width for getregion() (#28985)
Problem:  Can't use a blockwise selection with a width for getregion().
Solution: Add support for blockwise selection with width like the return
          value of getregtype() or the "regtype" value of TextYankPost
          (zeertzjq).

closes: vim/vim#14842

afc2295c22
2024-05-25 05:19:46 +08:00
Gregory Anders
28c04948a1
docs: update LSP quickstart (#28954)
The LSP quickstart can act as our true "entrypoint" for answering the
question "How do I use LSP in Neovim?" As such, it can be a little more
beginniner-friendly than other sections of our help docs by including
explanatory comments and a more fleshed out example (including a
`FileType` autocommand).

This also includes some other minor wording updates and points users
toward `:checkhealth lsp`.
2024-05-24 13:35:39 -05:00
Gregory Anders
2c6b635872
feat(defaults): add LSP default mappings (again) (#28650) 2024-05-24 11:33:49 -05:00
Gregory Anders
206f8f24a2
fix(fs): make vim.fs.root work for relative paths and unnamed buffers (#28964)
If a buffer does not have a backing file then fall back to the current
working directory.
2024-05-24 10:48:32 -05:00
Gregory Anders
e71713ba2b
fix: show swapfile warning as a warning (#28971)
The new default SwapExists autocommand displays warning text (W325) but
does not use the WarningMsg highlight group as other warnings do. Use
the WARN log level when displaying this warning.
2024-05-24 10:44:02 -05:00
dundargoc
1a2e6ebc59 refactor: replace deprecated vim.loop with vim.uv 2024-05-24 16:41:02 +02:00
Famiu Haque
a616272f56
feat(complete): specify reason for CompleteDone
Problem: `CompleteDone` currently does not specify the reason for why completion was done, which is problematic for completion plugins as they cannot know whether the event was triggered due to the completion being canceled, accepted, or for some other reason.

Solution: Add a `reason` key to `v:event`, which is set by `CompleteDone` to indicate why completion ended.
2024-05-24 11:57:46 +02:00
dundargoc
d123202ae6 fix: change deprecation presentation
Deprecation with vim.deprecate is currently too noisy. Show the
following warning instead:

[function] is deprecated. Run ":checkhealth vim.deprecated" for more information.

The important part is that the full message needs to be short enough to
fit in one line in order to not trigger the "Press ENTER or type command
to continue" prompt.

The full information and stack trace for the deprecated functions will
be shown in the new healthcheck `vim.deprecated`.
2024-05-24 11:08:00 +02:00
dundargoc
f864b68c5b feat: allow gx to function for markdown links
In other words, `gx` works regardless of where it was used in
`[...](https://...)`. This only works on markdown buffers.

Co-authored-by: ribru17 <ribru17@gmail.com>
2024-05-24 11:07:43 +02:00
dundargoc
6dc62c2e2b docs: extract health to its own file 2024-05-24 11:07:30 +02:00
zeertzjq
4f431bb632
vim-patch:9.1.0439: Cannot filter the history (#28958)
Problem:  Cannot filter the history
Solution: Implement :filter :history

closes: vim/vim#14835

42a5b5a6d0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-24 15:45:07 +08:00
zeertzjq
cd05fbef17
vim-patch:9.1.0441: getregionpos() can't properly indicate positions beyond eol (#28957)
Problem:  getregionpos() can't properly indicate positions beyond eol.
Solution: Add an "eol" flag that enables handling positions beyond end
          of line like getpos() does (zeertzjq).

Also fix the problem that a position still has the coladd beyond the end
of the line when its column has been clamped.  In the last test case
with TABs at the end of the line the old behavior is obviously wrong.

I decided to gate this behind a flag because returning positions that
don't correspond to actual characters in the line may lead to mistakes
for callers that want to calculate the length of the selected text, so
the behavior is only enabled if the caller wants it.

closes: vim/vim#14838

2b09de9104
2024-05-24 15:44:52 +08:00
Christian Clason
521b9930b8 vim-patch:22ac941: runtime(i3config/swayconfig): support floating_modifier none; revert broken highlighting
- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: vim/vim#14826
closes: vim/vim#14827

22ac941208

Co-authored-by: James Eapen <james.eapen@vai.org>
Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
2024-05-24 08:32:08 +02:00
Christian Clason
0d3d198109 vim-patch:9.1.0435: filetype: cygport files are not recognized
Problem:  filetype: cygport files are not recognized
Solution: Recognize '*.cygport' files as sh filetype
          (Ken Takata)

https://cygwin.github.io/cygport/cygport_in.html

closes: vim/vim#14833

cd79f8fbd3

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-05-23 23:47:13 +02:00
Evgeni Chasnovski
0a2218f965
fix(comment): fall back to using trimmed comment markers (#28938)
Problem: Currently comment detection, addition, and removal are done
  by matching 'commentstring' exactly. This has the downside when users
  want to add comment markers with space (like with `-- %s`
  commentstring) but also be able to uncomment lines that do not contain
  space (like `--aaa`).

Solution: Use the following approach:
  - Line is commented if it matches 'commentstring' with trimmed parts.
  - Adding comment is 100% relying on 'commentstring' parts (as is now).
  - Removing comment is first trying exact 'commentstring' parts with
    fallback on trying its trimmed parts.
2024-05-23 15:30:53 -05:00
Ilia Choly
af200c10cf
fix(lsp): check if buffer was detached in on_init callback (#28914)
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-05-23 15:17:53 +02:00
Mathias Fußenegger
2908f71dc9
refactor(lsp): reuse buf_detach_client logic in on_detach (#28939) 2024-05-23 15:17:03 +02:00
Andre Toerien
5ac8db10f0
fix(lsp): trigger LspDetach on buffer delete (#28795)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-05-23 12:03:47 +02:00
zeertzjq
5cbd6d9b9f
vim-patch:9.1.0430: getregionpos() doesn't handle one char selection (#28924)
Problem:  getregionpos() doesn't handle one char selection.
Solution: Handle startspaces differently when is_oneChar is set.
          Also add a test for an exclusive charwise selection with
          multibyte chars (zeertzjq)

closes: vim/vim#14825

52a6f34887
2024-05-23 06:08:24 +08:00
Christian Clason
3d43bdc81e vim-patch:802fc04: runtime(rescript): include basic rescript ftplugin file (vim/vim#14822)
Reference: https://rescript-lang.org/docs/manual/latest/overview#comments

802fc04a78

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-22 23:48:32 +02:00
dundargoc
01b4da65c2 fix: merge all provider healthchecks into a single health.lua
This will help manage the overly granular checkhealth completion to go
from

```
vim.health
vim.lsp
vim.provider.clipboard
vim.provider.node
vim.provider.perl
vim.provider.python
vim.provider.ruby
vim.treesitter
```

to

```
vim.health
vim.lsp
vim.provider
vim.treesitter
```
2024-05-22 21:34:49 +02:00
dundargoc
e8f7025de1 docs: move vim.health documentation to lua.txt
`vim.health` is not a "plugin" but part of our Lua API and the
documentation should reflect that. This also helps make the
documentation maintenance easier as it is now generated.
2024-05-22 20:15:17 +02:00
Ilia Choly
339129ebc9 refactor(lsp): use supports_method where applicable 2024-05-22 09:54:16 +01:00
zeertzjq
10601ac5fa
vim-patch:62ccaa6: runtime(termdebug): check for gdb file/dir before using as buffer name (#28908)
Add test so that this doesn't regress.

fixes: vim/vim#12718
closes: vim/vim#14792

62ccaa60d5

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2024-05-22 08:41:07 +08:00
Gregory Anders
d6be78cc98
vim-patch:d1d9316: runtime(zig): refactor zig ftplugin, remove auto format (#28904)
Refactored zig ftplugin, removed upstream comment, aucmd and
auto formatting support. Updated documentation for zig configuration
settings and added new maintainer.

closes: vim/vim#13803

d1d9316c66

Co-authored-by: Tiseno <mathias.lindgren@stabelo.se>
2024-05-21 18:51:51 -05:00