Commit Graph

3792 Commits

Author SHA1 Message Date
Jongwook Choi
ce4ea638c7 fix(lsp): fix incorrect typing and doc for vim.lsp.rpc
Typings introduced in #26032 and #26552 have a few conflicts, so we
merge and clean them up. We also fix some incorrect type annotation in
the `vim.lsp.rpc` package. See the associated PR for more details.

Summary:

- vim.rpc.Dispatchers -> vim.lsp.rpc.Dispatchers
- vim.lsp.rpc.Error -> lsp.ResponseError
- Revise docs
2024-01-14 09:02:45 +01:00
zeertzjq
2bdd8fad4c
docs(builtin): fix mapset() signature (#27008) 2024-01-14 08:44:16 +08:00
Evgeni Chasnovski
0c850add3e
fix(colorscheme): default statusline groups usability #26921
Problem: Current values of `StatusLine` and `StatusLineNC` are currently
  designed to be visually distinctive while being not intrusive.
  However, the compromise was more shifted towards "not intrusive".
  After the feedback, statusline highlight groups should be designed to:
  - Make current window clearly noticeable. Meaning `StatusLine` and
    `StatusLineNC` should obviously differ.
  - Make non-current windows clearly separable. Meaning `StatusLineNC`
    and `Normal`/`NormalNC` should obviously differ.

Solution:
  - Update `StatusLineNC` to have more visible background.
  - Update `StatusLine` to be inverted variant of `StatusLineNC`.
  - Update `WinBar` and `WinBarNC` to not link to `StatusLine` and
    `StatusLineNC` because it makes two goals harder to achieve.
  - Update `TabLine` to link to `StatusLineNC` instead of `StatusLine`
    to not be very visually intrusive.
2024-01-13 16:35:37 -08:00
zeertzjq
2783b6b0a4 vim-patch:9.1.0015: i_CTRL-R- no longer works in replace mode
Problem:  i_CTRL-R- no longer works in replace mode
Solution: delete characters in replace mode before putting, add a test,
          add a bit warning into the documentation, that i_CTRL-R-P/O
          is not supported in Replace mode for now

fixes: vim/vim#13792
closes: vim/vim#13816

5d5cbb2b9a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 08:29:47 +08:00
Christian Clason
f46ae13685 vim-patch:9.1.0016: default diff highlighting is too noisy
Problem:  default diff highlighting is too noisy
Solution: Link diff highlighting groups to new
          Added/Removed/Changed, revert previous change
          (Romain Lafourcade)

Remove diff* links added in vim/vim#13776 and doc added in commit b1392be

The links added in vim/vim#13776 are way too noisy for the contexts in which
the `diff` syntax is applied (git commits, patches, etc.).

This commit:

- removes those links
- adds new default highlighting groups Added, Changed and
  Removed
- links the diff highlighting groups to those new defaults
- removes the doc changes
- adjusts the syntax_completion test for those newly added group
  names

Note: Changes to the default color schemes will be handled separately,
by adding links to those newly created Added/Removed/Changed
highlighting groups.

related: vim/vim#13776
closes vim/vim#13825

124371c5a1

Co-authored-by: Romain Lafourcade <romain.lafourcade@razorfish.fr>
2024-01-12 13:52:26 +01:00
Lewis Russell
2f9ee9b6cf fix(doc): improve doc generation of types using lpeg
Added a lpeg grammar for LuaCATS and use it in lua2dox.lua
2024-01-11 16:24:12 +00:00
JD
a767c046f4
feat(vim.iter): add Iter:flatten (#26786)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-10 20:57:51 -06:00
Christian Clason
595f684c5b vim-patch:71d0ba07a33a
runtime(netrw): Sync with netrw 174b (vim/vim#13836)

* Import netrw v174b
* Revert unwanted changes
* Fix indent
* Revert some changes
* Update tags
* Break long line

71d0ba07a3

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-01-09 23:22:48 +01:00
Ghjuvan Lacambre
beca827212
feat(terminal): trigger TermRequest autocommand events (#22159)
This commit implements a new TermRequest autocommand event and has Neovim
emit this event when children of terminal buffers emit an OSC or DCS sequence
libvterm does not handle.

The TermRequest autocommand event has additional data in the
v:termrequest variable.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-09 08:27:56 -06:00
Jongwook Choi
f40df63bdc fix(docs): make lines not overflow in vim docs
Problem: Some lines in the generated vim doc are overflowing, not
correctly wrapped at 78 characters. This happens when docs body contains
several consecutive 'inline' elements generated by doxygen.

Solution: Take into account the current column offset of the last line,
and prepend some padding before doc_wrap().
2024-01-09 13:33:18 +00:00
Jongwook Choi
fbe40caa7c docs(treesitter): improve 'no parser' error message for InspectTree
Improve error messages for `:InspectTree`, when no parsers are available
for the current buffer and filetype. We can show more informative and
helpful error message for users (e.g., which lang was searched for):

```
 ... No parser available for the given buffer:
+... no parser for 'custom_ft' language, see :help treesitter-parsers
```

Also improve the relevant docs for *treesitter-parsers*.
2024-01-08 09:27:03 +00:00
Christian Clason
099bd35a7d docs(luvref): update to version bump 2024-01-06 12:02:27 +01:00
zeertzjq
f38f86b1ad vim-patch:9.1.0007: can select empty inner text blocks
Problem:  can select empty inner text blocks
          (laurentalacoque)
Solution: make selecting empty inner text blocks an error

textobjects: Make selecting inner empty blocks an error

fixes: vim/vim#13514
closes: vim/vim#13523

ad4d7f446d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-06 06:24:02 +08:00
zeertzjq
dab5844082
vim-patch:9.1.0010: Keymap completion is not available (#26888)
Problem:  Keymap completion is not available
Solution: Add keymap completion (Doug Kearns)

Add keymap completion to the 'keymap' option, user commands and builtin
completion functions.

closes: vim/vim#13692

81642d9d6f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-05 08:23:51 +08:00
Luuk van Baal
fa61e0c047 refactor(column): define and use maximum 'statuscolumn' width
Problem:  The maximum 'statuscolumn' width and grow behavior is undocumented.
Solution: Define, use and document the maximum 'statuscolumn' width and grow behavior.
2024-01-04 11:52:37 +00:00
Jaehwang Jung
dc48a98f9a fix(decorations): validate botline for on_win
Problem:
Many decoration providers (treesitter injection highlighting, semantic
token highlighting, inlay hint) rely on the correctness of the `botline`
argument of `on_win` callback. However, `botline` can be smaller than
the actual line number of the last displayed line if some lines are
folded. In such cases, some decorations will be missing in the lines not
covered by `botline`.

Solution:
Validate `botline` when invoking `on_win`.

NOTE:
It seems that the old code was deliberately avoiding this presumably due
to performance reasons. However, I haven't experienced noticeable lag
after this change, and I believe the cost of botline computation would
be much smaller than the cost of decoration providers.
2024-01-04 11:37:00 +00:00
Christian Clason
9b90657376 vim-patch:d94ca966ca6d
runtime(fortran): syntax and documentation updates (vim/vim#13811)

closes: vim/vim#13802

d94ca966ca

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2024-01-04 12:13:49 +01:00
Christian Clason
166b4284c8 vim-patch:b1392bee701d
runtime(doc): document that the diff filetype uses Diff hl groups

related: vim/vim#13776

b1392bee70

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-04 12:13:49 +01:00
zeertzjq
5dbf6ab9b1
vim-patch:9.1.0004: reloading colorscheme when not changing 'background' (#26877)
Problem:  reloading colorscheme when not changing 'background'
Solution: Check, if the background option value actually changed,
          if not, return early.

Only reload colorscheme when bg is changed

Currently the highlight groups are re-initialized and the colorscheme
(if any) is reloaded anytime 'background' is set, even if it is not
changed. This is unnecessary, because if the value was not changed then
there is no need to change highlight groups or do anything with the
colorscheme. Instead, only reload the colorscheme if the value of
'background' was actually changed.

closes: vim/vim#13700

83ad2726ff

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-04 05:45:26 +08:00
Lewis Russell
3734519e3b feat(lua): add noref to deepcopy
Problem:

Currently `deepcopy` hashes every single tables it copies so it can be
reused. For tables of mostly unique items that are non recursive, this
hashing is unnecessarily expensive

Solution:

Port the `noref` argument from Vimscripts `deepcopy()`.

The below benchmark demonstrates the results for two extreme cases of
tables of different sizes. One table that uses the same table lots of
times and one with all unique tables.

| test                 | `noref=false` (ms) | `noref=true` (ms) |
| -------------------- | ------------------ | ----------------- |
| unique tables (50)   | 6.59               | 2.62              |
| shared tables (50)   | 3.24               | 6.40              |
| unique tables (2000) | 23381.48           | 2884.53           |
| shared tables (2000) | 3505.54            | 14038.80          |

The results are basically the inverse of each other where `noref` is
much more performance on tables with unique fields, and `not noref` is
more performant on tables that reuse fields.
2024-01-03 19:17:52 +00:00
dundargoc
b3eda5e73f docs: small fixes
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: HiPhish <hiphish@posteo.de>
Co-authored-by: JD Rudie <rudiejd@miamioh.edu>
2024-01-02 22:00:06 +01:00
Mathias Fußenegger
91d76ac941
docs(lsp): add supports_method to vim.lsp.client docs (#26852) 2024-01-02 18:52:29 +01:00
Mathias Fußenegger
5dc0bdfe98
docs(glob): add glob module (#26853) 2024-01-02 14:32:43 +01:00
zeertzjq
2bf68df289
vim-patch:10b4f75d4c03 (#26846)
runtime(dist/ft): improve filetype detection for *.v (V/Verilog/Coq)

Patch provided by Dan Alt

closes: vim/vim#13793

10b4f75d4c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-02 19:06:43 +08:00
TheLeoP
3f788e73b3
feat(lsp): support connect via named pipes/unix domain sockets (#26032)
Closes https://github.com/neovim/neovim/issues/26031

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-01-02 10:08:36 +01:00
Evgeni Chasnovski
4ee656e4f3
feature(diagnostic): add vim.diagnostic.count() (#26807)
feat(diagnostic): add `vim.diagnostic.count()`

Problem: Getting diagnostic count based on the output of
  `vim.diagnostic.get()` might become costly as number of diagnostic
  entries grows. This is because it returns a copy of diagnostic cache
  entries (so as to not allow users to change them in place).
  Getting information about diagnostic count is frequently used in
  statusline, so it is important to be as fast as reasonbly possible.

Solution: Add `vim.diagnostic.count()` which computes severity
  counts without making copies.
2024-01-01 15:03:50 -06:00
Christian Clason
f69658bc35
feat(treesitter): highlight Lua files by default (#26824) 2024-01-01 15:37:07 +01:00
Jaehwang Jung
3faace1995 docs: clarify on_bytes arguments
based on extmark_splice doc
2024-01-01 12:20:19 +01:00
Christian Clason
d634cd5b0b vim-patch:d96f25bd69c1
runtime(fortran): update syntax and documentation (vim/vim#13784)

* Update Fortran section of indent.txt
* Small addition to fortran syntax

* Update Fortran section of syntax.txt

* Runtime (Fortran)

Fix regression

* Combine two expressions

d96f25bd69

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-12-30 10:53:31 +01:00
dundargoc
31d7007bf7 docs: convert BACKERS.md to backers.txt
There is no reason for this file to be in project root, which is crowded
as is. This also fits nicely part of the ongoing work towards gathering
as much of the documentation as possible into one place.
2023-12-28 22:41:01 +01:00
dundargoc
714b075197
docs: small fixes (#26651)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: WillLillis <wlillis@umass.edu>
2023-12-28 10:28:48 +08:00
zeertzjq
e0d998dbc8
vim-patch:65672ae1189e (#26767)
runtime(doc): clarify behaviour of ]m and ]M motions

In particular remove the sentence, that a missing '{'
(for ]m) or '}' (for ]M) after the cursor is an error, since
currently this is not treated as an error.

fixes: vim/vim#13777

65672ae118

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-28 08:48:03 +08:00
Christian Clason
8492a84bfd vim-patch:9042bd8b09ba
runtime(r): Update R runtime files and docs (vim/vim#13757)

* Update R runtime files
- Fix indentation issue with ggplot().
- Setlocal autoindent in indent/r.vim.
- New syntax option: rmd_include_latex.
- Clear syn iskeyword to recognize _ as keyword.
- Document some options.
- remove the test has("patch-7.4.1142")
- Update changed date of doc files

9042bd8b09

Co-authored-by: Jakson Alves de Aquino <jalvesaq@gmail.com>
2023-12-27 10:55:29 +01:00
Jongwook Choi
3767468b96 docs(gen_lsp.lua): re-generate vim.lsp._meta.protocol type annotations
The purpose of this commit is to make diff clean and easy to read; to
see the diff resulted from actual changes in gen_lsp.lua, not from the
updated LSP protocol JSON data.

Ran: `nvim -l scripts/gen_lsp.lua gen --methods`

Based on 3.18.0 (2023-12-23)
2023-12-27 10:48:06 +01:00
Nacho Nieva
c26dc1f77c
feat(defaults): map Q and @x to repeat in Visual mode (#26495) 2023-12-27 07:26:18 +08:00
luukvbaal
bbd5c6363c
feat(extmarks): add virt_text_repeat_linebreak flag (#26625)
Problem:  Unable to predict which byte-offset to place virtual text to
          make it repeat visually in the wrapped part of a line.
Solution: Add a flag to nvim_buf_set_extmark() that causes virtual
          text to repeat in wrapped lines.
2023-12-26 07:16:03 +08:00
bfredl
e8acbc1ade refactor(cpoptions): remove 'p'
Deleting a cpo flag a day keeps the doctor away

We don't need two different ways to indent LISP code
2023-12-25 14:13:52 +01:00
zeertzjq
2877672d70
feat(health): make :checkhealth support more split modifiers (#26731) 2023-12-25 10:21:13 +08:00
Pablo Arias
2ff2785c39
feat(health): checkhealth buffer can show in a split window (#26714)
:checkhealth now respects :vertical and :horizontal.
For example:
  :vertical checkhealth foo bar
will open the healthcheck buffer in a vertical split.
2023-12-25 08:30:56 +08:00
dundargoc
675522af18 build: remove clint checks and style text covered by uncrustify 2023-12-24 20:50:44 +01:00
Mathias Fußenegger
db0ec84fb4
feat(lsp): add type annotations for lsp.util.locations_to_items (#26694)
Problem: luals reported many warnings
Solution: Add type annotations
2023-12-22 11:38:02 +01:00
Christian Clason
19aba5916a
docs(options): add codeblock annotations to options.lua (#26696)
Also consistently remove leading colons in examples

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-12-22 10:55:39 +01:00
zeertzjq
6700127b30
vim-patch:9.0.2183: Maximum callback depth is not configurable (#26703)
Problem:  Maximum callback depth is not configurable.
Solution: Revert patch 9.0.2103.  Set 'maxfuncdepth' in test.

fixes: vim/vim#13732
closes: vim/vim#13736

fe583b1e59
2023-12-22 10:33:34 +08:00
zeertzjq
2b3d1e1854
vim-patch:0630080bbd3e (#26704)
runtime(doc): reformat and align :h ft-c-syntax (vim/vim#13738)

0630080bbd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-22 08:58:51 +08:00
Lewis Russell
e8d3c4cccb feat: generate types and docs for v variables 2023-12-21 14:19:10 +00:00
Lewis Russell
a8935d97ac docs: move vim-variables to separate file 2023-12-21 14:19:10 +00:00
Evgeni Chasnovski
d431a4d410
fix(runtime): source old color scheme in bundled color schemes (#26641)
Problem:
Bundled color schemes use `:hi clear` and only define Vim's highlight
groups. This results into Nvim-specific highlight groups using
definitions from Nvim's default color scheme, which are not always
linked to a Vim's highlight group.

Solution:
Restore links to Vim's highlight groups which were present before Nvim's
default color scheme update.
2023-12-21 20:53:43 +08:00
Christian Clason
cc6a257c8c docs: apply current colorscheme to default highlight groups
Problem: Not all default highlight groups show their actual colors.
Solution: Refactor `vimhelp.lua` and apply it to all relevant lists (UI
groups, syntax groups, treesitter groups, LSP groups, diagnostic groups).
2023-12-20 18:58:40 +01:00
dundargoc
db4b0aeb92 docs: remove section on constants in style guide
It is needlessly restrictive and specific without good reason.
2023-12-20 18:49:54 +01:00
dundargoc
365e185606 docs: document header structure
Reference: https://github.com/neovim/neovim/issues/6371
2023-12-20 12:50:38 +01:00