Commit Graph

7237 Commits

Author SHA1 Message Date
Gregory Anders
d38912b59f refactor(terminal): move :terminal defaults to _defaults.lua 2024-06-12 10:43:57 -05:00
Gregory Anders
3e09fbdf82 feat(highlight): add StatusLineTerm and StatusLineTermNC groups
These highlight groups are used for the statusline in :terminal windows.
By default they link to StatusLine and StatusLineNC (respectively), so
there is no visual difference unless a colorscheme defines these groups
separately.
2024-06-12 10:43:57 -05:00
zeertzjq
7215512100
vim-patch:210b39c: runtime(doc): clarify documentation for "v" position at line() (#29296)
Problem: the previous documentation falsely states that "v" always
refers to the start of a visual area.  In fact, the reference of "v" and
"." complement each other.  If the cursor is at the start of
a (characterwise) visual area, then "v" refers to the end of the area.

Solution: be more verbose and explicit about the connection between "."
and "v" and also refer to |v_o| which many vim users will be familiar
with for visual areas.

210b39c2d6

Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-06-12 11:44:38 +08:00
zeertzjq
d73910d7f6
vim-patch:b4e648a: runtime(doc): fix typos in syntax.txt (#29293)
b4e648a006

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-06-12 11:07:22 +08:00
zeertzjq
bbe69b4022 vim-patch:959c3c8: runtime(vim): Update base-syntax, configurable comment string highlighting (vim/vim#14931)
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.

959c3c887b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-12 10:29:19 +08:00
zeertzjq
c7799b1a23 vim-patch:059cbe8: runtime(vim): Update base-syntax, match multiline continued comments (vim/vim#13936)
Match multiline (continued) line comments.

Continued tail comments are not supported yet.

059cbe8933

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-12 10:22:50 +08:00
Christian Clason
66a1e028e6 vim-patch:2e3b2a8: runtime(kdl): use shiftwidth() instead of &tabstop in indent script
closes: vim/vim#14962

2e3b2a8d89

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-06-12 00:02:39 +02:00
Gregory Anders
3ad977f01d
feat(terminal): add support for copying with OSC 52 in embedded terminal (#29117)
When libvterm receives the OSC 52 escape sequence it ignores it because
Nvim does not set any selection callbacks. Install selection callbacks
that forward to the clipboard provider, so that setting the clipboard
with OSC 52 in the embedded terminal writes to the system clipboard
using the configured clipboard provider.
2024-06-11 13:18:06 -05:00
notomo
44410d063a fix(types): add some vim.fn type annotations
Problem: Some vim.fn have no type annotations.

Solution: Add type annotations.
2024-06-11 16:37:15 +01:00
Will Hopkins
e947f226be fix(types): use vararg return type annotation
build(types): allow vararg returns in function types
2024-06-11 16:36:29 +01:00
Christian Clason
c06f3dbe3e vim-patch:2d88210: runtime(kdl): include syntax, indent and ftplugin files
closes: vim/vim#14956

2d88210b3c

Co-authored-by: inzuo Jiang <jiangyinzuo@foxmail.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
2024-06-11 14:00:11 +02:00
Christian Clason
04d3ad1ded vim-patch:b8076f9: runtime(deb822sources): add missing Enabled field in syntax script
closes: vim/vim#14898

It lacks the support of Enabled: boolean option field [1]:

e.g.

  Types: deb
  Uris: https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/
  Components: main
  Suites: vscodium
  Architectures: amd64 i386 arm64 armhf
  Enabled: yes
  Signed-By: /var/lib/extrepo/keys/vscodium.asc

This patch was also forwarded to upstream. [2]

[1] https://manpages.debian.org/unstable/apt/sources.list.5.en.html#DEB822-STYLE_FORMAT
[2] https://salsa.debian.org/vim-team/vim-debian/-/merge_requests/16

b8076f92a1

Co-authored-by: Kentaro Hayashi <kenhys@gmail.com>
2024-06-11 14:00:11 +02:00
Christian Clason
34b7e00eed vim-patch:7e9a1a7: runtime(svelte): basic svelte ftplugin file
closes: vim/vim#14949

7e9a1a75b8

Co-authored-by: Igor <igorlfs@ufmg.br>
2024-06-11 14:00:11 +02:00
Lewis Russell
5e49ef0af3 refactor(lua): improve type annotations 2024-06-11 12:45:43 +01:00
Ilia Choly
37bf4c572a
fix(lsp): do not reset buf version when detaching client (#29242) 2024-06-10 18:53:08 +02:00
Justin M. Keyes
d9af8c2431
Merge #29238 from clason/feat/help-toc 2024-06-10 05:22:27 -07:00
Jon Huhn
4bd86120d4
fix(glob): handle overlapping {} condition elements #29236
This change fixes an issue where glob patterns like `{a,ab}` would not
match `ab` because the first option `a` matches, then the end of the
string is expected but `b` is found, and LPeg does not backtrack to try
the next option `ab` which would match. The fix here is to also append
the rest of the pattern to the generated LPeg pattern for each option.
This changes a glob `{a,ab}` from being parsed as

    ("a" or "ab") "end of string"

to

    ("a" "end of string" or "ab" "end of string")

Here, matching against `ab` would try the first option, fail to match,
then proceed to the next option, and match.

The sacrifice this change makes is dropping support for nested `{}`
conditions, which VSCode doesn't seem to support or test AFAICT.

Fixes #28931

Co-authored-by: Sergey Slipchenko <faergeek@gmail.com>
2024-06-10 04:23:03 -07:00
Tom Praschan
20f22f75ee
feat(lsp): include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164 2024-06-09 18:14:55 -07:00
zeertzjq
40329f32d8
vim-patch:9c4389a: runtime(doc): Fix small style issues (#29263)
closes: vim/vim#14942

9c4389acc3

Co-authored-by: h-east <h.east.727@gmail.com>
2024-06-10 06:47:30 +08:00
Christian Clason
2f752d6ad4 vim-patch:d6b4afb: runtime(java): Exclude lambda expressions from _when_ _switch-case_ label clauses (vim/vim#14945)
These guard clauses are always boolean expressions, whereas
lambda expressions can only appear in either an assignment,
a casting, or an invocation context.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.11.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.27

d6b4afb636

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-10 00:23:18 +02:00
Samuel Born
b6c1ce8a95 fix(runtime): add commentstring for glsl ftplugin 2024-06-09 14:51:22 +02:00
Christian Clason
a156038d70 docs: fix more treesitter parsing errors 2024-06-09 13:54:34 +02:00
Christian Clason
6592873f77 feat(help): use treesitter for table of contents
Problem: Creating the table of contents for `gO` is complicated.

Solution: Use treesitter instead.
2024-06-09 13:54:34 +02:00
dundargoc
9afa1fd355 feat(lua): add vim._with
It's a function to perform operations in their own sealed context,
similar to pythons `with`. This helps ease operations where you need to
perform an operation in a specific context, and then restore the
context.

Marked as private for now as it's not ready for public use. The current
plan is to start using this internally so we can discover and fix any
problems. Once this is ready to be exposed it will be renamed to
`vim.with`.

Usage:

```lua
local ret = vim._with({context = val}, function()
  return "hello"
end)
```

, where `context` is any combination of:

- `buf`
- `emsg_silent`
- `hide`
- `horizontal`
- `keepalt`
- `keepjumps`
- `keepmarks`
- `keeppatterns`
- `lockmarks`
- `noautocmd`
- `options`
- `sandbox`
- `silent`
- `unsilent`
- `win`

(except for `win` and `buf` which can't be used at the same time). This
list will most likely be expanded in the future.

Work on https://github.com/neovim/neovim/issues/19832.

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2024-06-08 21:38:06 +02:00
Christian Clason
105a9e3dcf build(deps): bump tree-sitter-vimdoc to v3.0.0 2024-06-08 10:19:28 +02:00
Lennard Hofmann
da6f68ee69
fix(man): filter OSC 8 hyperlink markup #29171
Problem: `man cmake` shows "8;;https://cmake.orghttps://cmake.org8;;"
Solution: Remove noise so that it shows as "https://cmake.org".
See also: https://en.wikipedia.org/wiki/ANSI_escape_code#OSC
2024-06-07 12:43:17 -07:00
altermo
f3632e14e3
feat: get/set namespace properties #28728
ref https://github.com/neovim/neovim/pull/28432
ref https://github.com/neovim/neovim/issues/28469
2024-06-07 08:33:40 -07:00
Al Colmenar
2ce4a4d91e
fix(lsp): fix reverse sorting of same position text edits (#29212)
Problem:
Text edits with the same position (both line and character) were being
reverse sorted prior to being applied which differs from the lsp spec

Solution:
Change the sort order for just the same position edits
2024-06-07 11:54:43 +02:00
Mathias Fußenegger
6e45cd7f00
fix(lsp): revert buf_versions deprecation/replacement (#29217)
* Revert "fix(lsp): account for changedtick version gap on modified reset (#29170)"

This reverts commit 2e6d295f79.

* Revert "refactor(lsp): replace util.buf_versions with changedtick (#28943)"

This reverts commit 5c33815448.
2024-06-07 11:36:46 +02:00
dundargoc
8c5af0eb85
docs: misc (#28837)
Co-authored-by: Danymat <d.danymat@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jakub Okoński <jakub@okonski.org>
Co-authored-by: John L. Villalovos <john@sodarock.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Michaili K <git@michaili.dev>
Co-authored-by: TheLeoP <eugenio2305@hotmail.com>
Co-authored-by: Tobias Schmitz <tobiasschmitz2001@gmail.com>
Co-authored-by: W20MC <157727813+W20MC@users.noreply.github.com>
Co-authored-by: Will Hopkins <willothyh@gmail.com>
Co-authored-by: Yifan Hu <141280278+b0ae989c@users.noreply.github.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: prljav <74116121+prljav@users.noreply.github.com>
2024-06-07 10:55:14 +08:00
Christian Clason
d490a7bc5b vim-patch:ce47d32: runtime(cpp): Change 'cms' for C++ to '// %s'
fixes: vim/vim#14911
closes: vim/vim#14926

ce47d32b03

Co-authored-by: Luc Hermitte <luc.hermitte@csgroup.eu>
2024-06-07 00:17:56 +02:00
sus-domesticus
cb6c0fda71
feat(editorconfig): add support for spelling_language (#28638) 2024-06-06 09:16:43 -05:00
zeertzjq
78d3f47428
vim-patch:92f4e91: runtime(vim): Update base-syntax, allow whitespace before :substitute pattern (#29210)
Allow whitespace between the :substitute command and its pattern
argument.  Although unusual, it is supported and there are examples in
the wild.

Match Vi compatible :substitute commands like :s\/{string}/.  See :help
E1270.

fixes: vim/vim#14920
closes: vim/vim#14923

92f4e91590

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-06 06:40:11 +08:00
zeertzjq
1d4e894403 vim-patch:9.1.0469: Cannot have buffer-local value for 'completeopt'
Problem:  Cannot have buffer-local value for 'completeopt'
          (Nick Jensen).
Solution: Make 'completeopt' global-local (zeertzjq).

Also for some reason test Test_ColonEight_MultiByte seems to be failing
sporadically now. Let's mark it as flaky.

fixes: vim/vim#5487
closes: vim/vim#14922

529b9ad62a
2024-06-06 06:07:31 +08:00
Gregory Anders
d7651b27d5
fix(tui): move $COLORTERM check to _defaults.lua (#29197)
We currently check $COLORTERM in the TUI process to determine if the
terminal supports 24 bit color (truecolor). If $COLORTERM is "truecolor"
or "24bit" then we automatically assume that the terminal supports
truecolor, but if $COLORTERM is set to any other value we still query
the terminal.

The `rgb` flag of the UI struct is a boolean which only indicates
whether the UI supports truecolor, but does not have a 3rd state that we
can use to represent "we don't know if the UI supports truecolor". We
currently use `rgb=false` to represent this "we don't know" state, and
we use XTGETTCAP and DECRQSS queries to determine at runtime if the
terminal supports truecolor. However, if $COLORTERM is set to a value
besides "truecolor" or "24bit" (e.g. "256" or "16) that is a clear
indication that the terminal _does not_ support truecolor, so it is
incorrect to treat `rgb=false` as "we don't know" in that case.

Instead, in the TUI process we only check for the terminfo capabilities.
This must be done in the TUI process because we do not have access to
this information in the core Neovim process when `_defaults.lua` runs.
If the TUI cannot determine truecolor support from terminfo alone, we
set `rgb=false` to indicate "we don't know if the terminal supports
truecolor yet, keep checking". When we get to `_defaults.lua`, we can
then check $COLORTERM and only query the terminal if it is unset.

This means that users can explicitly opt out of truecolor determination
by setting `COLORTERM=256` (or similar) in their environment.
2024-06-05 08:27:56 -05:00
zeertzjq
43bd9c9c1c
fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203) 2024-06-05 16:47:43 +08:00
zeertzjq
c2e836c41c vim-patch:2a2c4ff: runtime(doc): clarify how fuzzy 'completeopt' should work
related: vim/vim#14912

2a2c4fffd7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-05 15:08:31 +08:00
zeertzjq
164338330b vim-patch:9.1.0463: no fuzzy-matching support for insert-completion
Problem:  no fuzzy-matching support for insert-completion
Solution: enable insert-mode completion with fuzzy-matching
          using :set completopt+=fuzzy (glepnir).

closes: vim/vim#14878

a218cc6cda

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-05 15:08:31 +08:00
Andre Toerien
f69937fdbd
fix(diagnostic): fix float scope filtering (#29134) 2024-06-04 16:35:44 -05:00
Christian Clason
946a839aa9 vim-patch:98b73eb: runtime(netrw): prevent accidental data loss
fixes: vim/vim#14915

98b73eb645

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-04 23:15:50 +02:00
Saltaformajo
230bc34ca5
fix(lsp): check if buffer is valid before LspDetach autocmd (#29162) 2024-06-04 17:23:57 +02:00
jdrouhard
43581011e4
fix(lsp): remove superfluous on_detach callback from semantic tokens module (#29174)
LspDetach is now triggered by the main on_detach callback that is added
when an LSP client is attached to a buffer. The semantic_tokens module
already includes a LspDetach handler that does the right thing. When the
LspDetach trigger was added to the main LSP on_detach, it created a race
condition in semantic tokens when a buffer was deleted that would
trigger both its own on_detach and the LspDetach handlers. If the former
came last, an error was thrown trying to delete a non-existent augroup
(destroy() was being called twice).
2024-06-04 17:22:02 +02:00
Mathias Fußenegger
2e6d295f79
fix(lsp): account for changedtick version gap on modified reset (#29170)
Follow up to https://github.com/neovim/neovim/pull/28943
Fixes https://github.com/neovim/neovim/issues/29163
2024-06-04 17:21:37 +02:00
Ilia Choly
8cbb1f20e5
refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
Christian Clason
8369590eb2 fix(runtime): remove obsolete ftplugin/calender.lua 2024-06-04 12:54:34 +02:00
Evgeni Chasnovski
aa9f21ee95 fix(filetype): fix typos in filetype detection 2024-06-04 11:26:27 +02:00
Christian Clason
2f5b8a0092 vim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins
Problem:  no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
          existing filetype plugins with the new default value
          (Riley Bruins)

closes: vim/vim#14843

0a0830624a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-06-04 10:38:55 +02:00
ippachi
5aa9906676
fix(lsp): use client.id instead of pairs index (#29143)
Problem: Completion side effects not working randomly.

Solution: When creating the table of LSP responses, the table index
was used, but this is not the same as the actual client_id, so it was changed
to use the client_id directly.
2024-06-03 18:07:09 +02:00
dundargoc
a9c89bcbf6 fix(gx): allow @ in url
This will make `gx` work for links for the form
https://hachyderm.io/@neovim.
2024-06-03 15:33:10 +02:00
Soham Shanbhag
054a287dbe
feat(ftplugin): change 'commentstring' to // %s for C/C++ (#29085)
Problem: The default commentstring for C/C++ can lead to invalid code 
when commenting and does not match the Nvim codebase.

Solution: Change commentstring to `// %s` as used by Neovim. Also
set all commentstrings that derive from the default C string explicitly
(and correctly).
2024-06-03 09:48:43 +02:00