Commit Graph

3808 Commits

Author SHA1 Message Date
VanaIgr
fd08de4b85 docs(news): expand the list of performance improvements
When computing on-screen size or position, the size 'breakindent' and 'showbreak' is now cached,
and checks for whether a faster character size function can be used are performed only once at the start.
Multibyte characters are not decodes multiple times anymore, and character decoding functions are more efficient.
Additionally, the amount of trailing spaces for pasted blockwise text is now calculated correctly for multibyte characters.
Internal lisp formatting now doesn't erroneously use inline virtual text from a different line.
2024-01-22 09:05:01 +08:00
notomo
ab3a7fc3e3
docs(vim.iter): correct bool to boolean (#27018) 2024-01-18 07:01:57 -06:00
Justin M. Keyes
95cbedaa17
docs: various #25289
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
Co-authored-by: Benoit de Chezelles <bew@users.noreply.github.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-18 00:14:48 -08:00
zeertzjq
780dd88b68
vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070)
Problem:  too vague errors for 'listchars'/'fillchars'
Solution: Include the field name in error message.
          (zeertzjq)

related: #27050
closes: vim/vim#13877

6a8d2e1634

Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
2024-01-18 07:14:12 +08:00
dundargoc
b3e5587b7f
docs: various fixes (#26929)
Co-authored-by: Patrick Bollinger <owner@pjbollinger.com>
Co-authored-by: vilo1839 <139687192+vilo1839@users.noreply.github.com>
2024-01-17 14:01:39 +08:00
Jongwook Choi
3973a5e405 refactor(lsp): deprecate vim.lsp.util.lookup_section
This function is used only in the `workspace/configuration` handler,
and does not warrant a public API because of its confusing return types.

The only caller `vim.lsp.handlers["workspace.configuration"]` is also
refactored to use `vim.tbl_get()` instead.
2024-01-16 20:14:17 +00:00
Sean Dewar
91dc04a5e1
vim-patch:9.1.0013: Modula2 filetype support lacking (#27020)
Problem:  Modula2 filetype support lacking
Solution: Improve the Modula-2 runtime support, add additional modula2
          dialects, add compiler plugin, update syntax highlighting,
          include syntax tests, update Makefiles (Doug Kearns)

closes: vim/vim#6796
closes: vim/vim#8115

68a8947069

- Luaify the detection script:

  - Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns,
    as Lua capture groups cannot be used with `?` and friends (as they only work
    on character classes).

  - Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure
    `b:modula2` is set for the given bufnr.

- Skip the syntax screendump tests. (A shame as they test some of the detection
  from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work)

- Port the synmenu.vim changes from Vim9 script. (Also tested this locally)

- (And also add the missing comma for `b:browsefilter` from earlier.)

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-16 17:45:57 +00:00
Luuk van Baal
463cb28a22 docs(column): 'statuscolumn' redraw interaction with 'relativenumber' 2024-01-16 12:14:00 +01:00
Lewis Russell
50284d07b6 fix(diagnostic): typing 2024-01-16 09:33:10 +00:00
zeertzjq
92672a161c
docs(builtin): remove signatures of undocumented functions (#27039)
Having an empty signature causes an empty line in generated docs,  so
remove it.

Also change ">" to ">vim" in foreach() docs.
2024-01-16 12:07:35 +08:00
zeertzjq
46a7c1b319
vim-patch:partial:9.1.0027: Vim is missing a foreach() func (#27037)
Problem:  Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
          which applies {expr2} for each item in {expr1}
          without changing it (Ernie Rael)

closes: vim/vim#12166

e79e207760

Partial port as this doesn't handle non-materialized range() lists.

vim-patch:c92b8bed1fa6

runtime(help): delete duplicate help tag E741 (vim/vim#13861)

c92b8bed1f

Co-authored-by: Ernie Rael <errael@raelity.com>
2024-01-16 11:30:35 +08:00
zeertzjq
73e1942abe
vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)
Problem:  Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
          functions (Yegappan Lakshmanan)

closes: vim/vim#13766

Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.

f93b1c881a

vim-patch:eb3475df0d92

runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)

eb3475df0d

Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
2024-01-16 08:00:08 +08:00
Daniel Steinberg
7589336120
feat(terminal): respond to OSC background and foreground request (#17197)
The motivation for this update is Issue #15365, where background=light
is not properly set for Nvim running from an Nvim :terminal. This can be
encountered when e.g., opening a terminal to make git commits, which
opens EDITOR=nvim in the nested terminal.

Under the implementation of this commit, the OSC response always
indicates a black or white foreground/background. While this may not
reflect the actual foreground/background color, it permits 'background'
to be retained for a nested Nvim instance running in the terminal
emulator. The behaviour matches Vim.
2024-01-15 10:12:07 -06:00
Christian Clason
7ed6966023 vim-patch:93197fde0f1d
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"

Problem:  The "*.*" browsefilter pattern only matches all files on
	  Windows (Daryl Lee)
Solution: Use "*" to filter on all platforms but keep "*.*" as the label
	  text on Windows. (Fixes vim/vim#12685, Doug Kearns)

The *.* browsefilter pattern used to match "All Files" on Windows is a
legacy of the DOS 8.3 filename wildcard matching algorithm.  For reasons
of backward compatibility this still works on Windows to match all
files, even those without an extension.

However, this pattern only matches filenames containing a dot on other
platforms.  This often makes files without an extension difficult to
access from the file dialog, e.g., "Makefile"

On Windows it is still standard practice to use "*.*" for the filter
label so ftplugins should use "All Files (*.*)" on Windows and "All
Files (*)" on other platforms.  This matches Vim's default browsefilter
values.

This commit also normalises the browsefilter conditional test to check
for the Win32 and GTK GUI features and an unset b:browsefilter.

closes: vim/vim#12759

93197fde0f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-15 11:40:44 +01:00
Jongwook Choi
4d91604c88 docs: add lua typing for vim.NIL 2024-01-15 08:45:30 +00:00
Jongwook Choi
2cdea852e8 docs: auto-generate docs for vim.lpeg and vim.re
- Add section `VIM.LPEG` and `VIM.RE` to docs/lua.txt.

- Add `_meta/re.lua` which adds luadoc and type annotations, for the
  vendored `vim.re` package.

- Fix minor style issues on `_meta/lpeg.lua` luadoc for better vimdocs
  generation.

- Fix a bug on `gen_vimdoc` where non-helptags in verbatim code blocks
  were parsed as helptags, affecting code examples on `vim.lpeg.Cf`,
  etc.

- Also move the `vim.regex` section below so that it can be located
  closer to `vim.lpeg` and `vim.re`.
2024-01-14 11:08:33 +00:00
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