Commit Graph

26334 Commits

Author SHA1 Message Date
Justin M. Keyes
17c59e417f fix(docs): vimdoc syntax errors
Prepare for https://github.com/neovim/tree-sitter-vimdoc/pull/108 which improves
`{arg}` highlighting in many common cases:

    vim.foo({bar})
    vim.foo( {bar})
    nvim_foo({bar})
    nvim_foo({bar},{baz})
    nvim_foo({bar}, {baz})
    foo[{buf}]

The tradeoff is that things like `"[{"` are flagged as parse errors.
We could avoid if we drop support for `foo[{buf}]`, but that is rather common
(see `builtin.txt`).
2023-06-26 11:29:12 +02:00
Justin M. Keyes
99cb1f0c37 build(deps): tree-sitter-vimdoc v2.0.1 2023-06-26 11:29:12 +02:00
Christian Clason
b6878f5d63
docs: fix misparsed headings (#24162)
Problem: vimdoc parser requires space between column heading and `~`.

Solution: Add space to docs (and mention it). Also edit `luaref.txt`
headings for consistency.
2023-06-26 11:16:55 +02:00
Christian Clason
b697c0cd4f
fix(treesitter): update lua parser and queries (#24148) 2023-06-26 09:25:46 +02:00
zeertzjq
cd6458123f
fix(charset): fix wrong display of 0xffff (#24158) 2023-06-26 11:52:52 +08:00
zeertzjq
91aeaeef64
Merge pull request #24154 from zeertzjq/vim-9.0.1665
vim-patch:8.2.3833,9.0.1665
2023-06-26 07:55:49 +08:00
zeertzjq
dc3ee122dc vim-patch:9.0.1665: empty CmdlineEnter autocommand causes errors in Ex mode
Problem:    Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution:   Save and restore ex_pressedreturn. (Christian Brabandt,
            closes # 12581, closes vim/vim#12578)

590aae3557

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-26 07:19:36 +08:00
zeertzjq
7966020f70 vim-patch:8.2.3833: error from term_start() not caught by try/catch
Problem:    Error from term_start() not caught by try/catch.
Solution:   save and restore did_emsg when applying autocommands. (Ozaki
            Kiichi, closes vim/vim#9361)

c3f91c0648

Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-06-26 07:18:54 +08:00
Justin M. Keyes
957d05d16b
fix(docs): too much whitespace around <pre> blocks #24151
Problem:
In the generated docs HTML there is too much whitespace before/after `<pre>`
blocks.
- In the old layout (fixed-width), all text in `.old-help-para` is formatted as
  `white-space:pre`.
- In the new layout, when `<pre>` is at the end of a `<div>`, the margins of
  both are redundant, causing too much space.

Solution:
- In the old layout, always remove `<pre>` margin.
- In the new layout, disable `<pre>` margin if it is the last child.
2023-06-25 12:29:56 -07:00
Justin M. Keyes
5ceb2238d3
Merge #24116 from justinmk/doc 2023-06-25 09:17:47 -07:00
Justin M. Keyes
49a7585981 docs: autocmds, misc 2023-06-25 17:25:47 +02:00
Justin M. Keyes
036da0d079 fix(docs): vimdoc syntax errors
gen_help_html: truncate parse-error sample text
2023-06-25 17:14:28 +02:00
zeertzjq
e59cf3b3a9
vim-patch:9.0.1663: Termdebug on MS-Windows: some file names are not recognized (#24145)
Problem:    Termdebug on MS-Windows: some file names are not recognized.
Solution:   Do not always change \t and \n. (Christian Brabandt,
            closes vim/vim#12565, closes vim/vim#12560, closes vim/vim#12550)

c9a4a8ab28

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-25 08:12:41 +08:00
Christian Clason
cc624fac68
vim-patch:9.0.1661: BUCK files are not recognized (#24142)
Problem:    BUCK files are not recognized.
Solution:   Recognize BUCK files as "bzl". (Son Luong Ngoc, closes vim/vim#12564)

b46e0f3263

Co-authored-by: Son Luong Ngoc <sluongng@gmail.com>
2023-06-24 20:04:30 +02:00
zeertzjq
8182384205
test(extmarks): add a test for #23848 (#24140) 2023-06-24 22:15:13 +08:00
zeertzjq
57fda7688b
vim-patch:9.0.1659: Termdebug: default highlight cleared if changing colorscheme (#24139)
Problem:    Termdebug: default highlight cleared when changing colorscheme.
Solution:   Use a ColorScheme autocommand. (Christian Brabandt, closes vim/vim#12566,
            closes vim/vim#12555)

279de0cd1f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-24 22:14:57 +08:00
Christian Clason
c2d696f009
Merge pull request #24082 from smjonas/fix_24064
fix(filetype): correctly detect bash-fc-{id} files as "sh" (vim-patch:9.0.1644)
2023-06-24 13:41:50 +02:00
Ibby
31a51acdc3
fix(extmarks): fix heap buffer overflow caused by inline virtual text (#23851)
also fixes an edge case where the extends character would not be drawn if the real text exactly fits the grid.
2023-06-24 11:39:16 +01:00
Chinmay Dalal
fa0a25dcb3
fix(lsp): error in reset_timer on second detach #24117
Problem:
On running `zig fmt` manually, the on_lines callback and the
server both detach (for some reason), and both of them call
`clear()`. This fixes it, otherwise the second one to detach
has an error in `reset_timer` since the bufstate doesn't exist

Solution:
* exit early in clear if `bufstates[bufnr]` is nil
* set bufstatte.enabled to true on reload instead of making bufstate nil
2023-06-23 16:33:15 -07:00
dundargoc
46e95909bf
ci: introduce CI_LINT option
This will abort if lint programs are not found, and is meant primarily
for the lint job in CI. Supersedes the REQUIRED argument in
add_glob_target as it's a superior replacement by being a built-in
solution.
2023-06-24 00:29:53 +02:00
smjonas
fdf5013e21 fix(filetype): correctly detect bash-fc-{id} files as "sh" 2023-06-23 18:18:33 +02:00
smjonas
771dad7a05 vim-patch:9.0.1644: not all filetype file name matches are tested
Problem:    Not all filetype file name matches are tested.
Solution:   Add more file names to test with. (Jonas Strittmatter,
            closes vim/vim#12569)

bd087ae8f0

Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
2023-06-23 18:18:33 +02:00
Raphael
4dc86477b6
build(luarc.json): disable luadoc-miss-see-name #24108 2023-06-23 04:54:47 -07:00
Chinmay Dalal
94a904b453
fix(lsp): reapplying already-applied hints #24114
Problem:
The decoration provider clears the whole buffer then redraws all the hints every
time the window was redrawn. This may lead to an infinite loop.

Solution:
Store the last applied version for a line and only clear and redraw the line if
the buffer version has changed.
2023-06-23 04:49:54 -07:00
zeertzjq
3688735c2b
fix(cmdline): don't redraw 'tabline' in Ex mode (#24123)
Redrawing of 'statusline' and 'winbar' are actually already inhibited by
RedawingDisabled in Ex mode.

In Vim there is a check for `msg_scrolled == 0` (which is false in Ex
mode) since Vim doesn't have msgsep. Add a `!exmode_active` check here
in Nvim instead.
2023-06-23 06:40:26 +08:00
Mathias Fußenegger
12c2c16acf
feat(lsp): opt-in to dynamicRegistration for inlay hints (#24102)
Since https://github.com/neovim/neovim/pull/23681 there is dynamic
registration support. We should use that for new features unless there
is a good reason to turn it off.
2023-06-22 19:39:57 +02:00
Christian Clason
904ad5458d
vim-patch:9.0.1645: zserio files are not recognized (#24120)
Problem:    zserio files are not recognized.
Solution:   Add a pattern for zserio files. (Dominique Pellé,
            closes vim/vim#12544)

2b994da57a

Co-authored-by: =?UTF-8?q?Dominique=20Pell=C3=A9?= <dominique.pelle@gmail.com>
2023-06-22 19:38:49 +02:00
zeertzjq
f0884f21fa
feat(extmarks): support hl_mode "combine" for inline virt_text (#24099) 2023-06-22 20:39:35 +08:00
Mathias Fußenegger
134b9ec483
feat(lsp): soft deprecate vim.lsp.for_each_buffer_client (#24104)
There is no need for two ways to access all clients of a buffer.

This doesn't add a `vim.deprecate` call yet, as the function is probably
used a lot, but removes it from the documentation and annotates it with
`@deprecated`
2023-06-22 13:54:35 +02:00
Justin M. Keyes
2f17ef1fc4
fix(messages): use "Vimscript" instead of "VimL" #24111
followup to #24109
fix #16150
2023-06-22 04:09:14 -07:00
Justin M. Keyes
4e6356559c
test: spellcheck :help (vimdoc) files #24109
Enforce consistent terminology (defined in
`gen_help_html.lua:spell_dict`) for common misspellings.

This does not spellcheck English in general (perhaps a future TODO,
though it may be noisy).
2023-06-22 03:44:51 -07:00
zeertzjq
f4f1ce1d16
fix(extmarks): hide inline virt_text properly with 'smoothscroll' (#24106) 2023-06-22 18:15:04 +08:00
zeertzjq
958cc22836
fix(extmarks): empty inline virt_text interfering with DiffText (#24101) 2023-06-22 17:48:53 +08:00
Justin M. Keyes
130b8c801a
Merge #24087 from justinmk/doc
docs: lsp, fix errors, gen_help_html features
2023-06-22 01:51:20 -07:00
Mathias Fußenegger
4d3a04279d
perf(lsp): remove grouping logic from lsp.status (#24096)
With the title carry-over logic in the `$/progress` handler it's not
necessary to group again in vim.lsp.status
2023-06-22 10:18:49 +02:00
Justin M. Keyes
b0cf9c5fee feat(gen_help_html): ignore pi_netrw.txt errors
IDGAF about netrw
2023-06-22 10:18:24 +02:00
Justin M. Keyes
81d8fce8f9 feat(gen_help_html): non-default vimdoc.so parser
Callers can specify a non-default vimdoc.so file path.
2023-06-22 10:18:24 +02:00
Justin M. Keyes
d931b829e9 fix(docs): vimdoc syntax errors
Since https://github.com/neovim/tree-sitter-vimdoc/pull/97
the many cases of *.foo cause parser errors. But even before that, these
were erroneously highlighted as (argument), so fixing them is good.
2023-06-22 10:18:24 +02:00
Justin M. Keyes
5c73b1bb4c docs: lsp, vim_diff
- quickstart
- mark lsp.txt as `new_layout`
- remove lsp-handler documentation for notifications: they don't have
  handlers because they don't have server responses.
2023-06-22 10:18:17 +02:00
zeertzjq
a41883bfbe
Merge pull request #24098 from zeertzjq/fix-extmark
Fix two extmark bugs
2023-06-22 15:37:32 +08:00
Julian Grinblat
43e76cc346
fix: tostring(vim.version()) fails if build is NIL #24097
Problem:
Since #23925, Version.build may be vim.NIL, which causes tostring() to fail:
    E5108: Error executing lua E5114: Error while converting print argument #1: …/version.lua:129:
    attempt to concatenate field 'build' (a userdata value)
    stack traceback:
            [C]: in function 'print'
            [string ":lua"]:1: in main chunk

Solution:
Handle vim.NIL in Version:__tostring().
2023-06-22 00:36:38 -07:00
zeertzjq
a9cd8467cb fix(api): wrong nvim_buf_set_extmark error for invalid hl_mode 2023-06-22 15:04:46 +08:00
zeertzjq
0534ad8ca5 fix(extmarks): empty inline virt_text interfering with Visual highlight 2023-06-22 15:04:46 +08:00
Gregory Anders
08db61b19b
feat(man): respect 'wrapmargin' when wrapping man pages (#24091) 2023-06-21 14:42:23 -05:00
Justin M. Keyes
e27377e33e
Merge #24086 LSP ctx.version, report full Nvim version 2023-06-21 03:36:39 -07:00
Justin M. Keyes
59048814fd docs(lsp): mention ctx.version
Since 643546b82b the request handler
context (`ctx`) includes a `version` field.
2023-06-21 12:32:54 +02:00
zeertzjq
ded01a819a
fix(folds): don't show search or match highlighting on fold (#24084) 2023-06-21 18:28:12 +08:00
Justin M. Keyes
21b074feb0 refactor(lsp): report full Nvim version string in clientInfo 2023-06-21 12:16:26 +02:00
Justin M. Keyes
8d4a53fe6e
fix(vim.json)!: remove global options, "null", "array_mt" #24070
Problem:
- `vim.json` exposes various global options which:
  - affect all Nvim Lua plugins (especially the LSP client)
  - are undocumented and untested
  - can cause confusing problems such as: cc76ae3abe
- `vim.json` exposes redundant mechanisms:
  - `vim.json.null` is redundant with `vim.NIL`.
  - `array_mt` is redundant because Nvim uses a metatable
    (`vim.empty_dict()`) for empty dict instead, which `vim.json` is
    configured to use by default (see `as_empty_dict`).
    Example:
    ```
    :lua vim.print(vim.json.decode('{"bar":[],"foo":{}}'))
    --> { bar = {},  foo = vim.empty_dict() }
    ```
    Thus we don't need to also decorate empty arrays with `array_mt`.

Solution:
Remove the functions from the public vim.json interface.
Comment-out the implementation code to minimize drift from upstream.

TODO:
- Expose the options as arguments to `vim.json.new()`
2023-06-21 01:10:32 -07:00
Akin
e42fdaad21
fix(lsp): add spacing for inlay hints separately #24079
Problem:
Spacing around inlay hints has the same highlight as the hint itself.
The LSP spec for inlay hints specifically mentions the padding should not be
coloured:

    /**
    Render padding before the hint.
    Note: Padding should use the editor's background color, not the
    background color of the hint itself. That means padding can be used
    to visually align/separate an inlay hint.
    */
    paddingLeft?: boolean;
    /**
    Render padding after the hint.
    Note: Padding should use the editor's background color, not the
    background color of the hint itself. That means padding can be used
    to visually align/separate an inlay hint.
    */
    paddingRight?: boolean;

Solution:
Add the space as separate parts of the virtual text, don't add the space to the
text itself.
2023-06-21 00:55:19 -07:00