Commit Graph

26350 Commits

Author SHA1 Message Date
zeertzjq
d90f5ab9ac
test(statusline): add test with control characters (#24197) 2023-06-29 11:18:56 +08:00
zeertzjq
421c66f741
vim-patch:9.0.1671: Termdebug: error with more than 99 breakpoints (#24194)
Problem:    Termdebug: error with more than 99 breakpoints.
Solution:   Use a different sign for breakpoint 100 and over. (closes vim/vim#12589,
            closes vim/vim#12588)

e7d9ca2b3b

Co-authored-by: skywind3000 <skywind3000@163.com>
2023-06-29 07:04:46 +08:00
luukvbaal
a878e02d5d
fix(column): use maxwidth to allocate/fill 'statuscolumn' click defs #24190
Use the actual width of the 'statuscolumn' to allocate and fill its click definition array.
The returned width of the built statuscolumn string may be shorter (and is padded later).
2023-06-28 14:16:03 -07:00
Justin M. Keyes
e0453d7f57
fix(api): nvim_cmd{cmd="win_getid"} parsed as :winsize #24181
Problem:
`:lua vim.cmd.win_getid(30,10)` is interpreted as `:win[size] 30 10`.
User intention was to call `vim.fn.win_getid(30,10)`.

Solution:
Check that the `cmd` actually matches the resolved command.
2023-06-28 04:51:55 -07:00
zeertzjq
42f9573e5d
vim-patch:9.0.1670: resetting local option to global value is inconsistent (#24185)
Problem:    Resetting local option to global value is inconsistent.
Solution:   Handle "<" specifically for 'scrolloff' and 'sidescrolloff'.
            (closes vim/vim#12594)

bf5f189e44

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-28 08:13:14 +08:00
Jaehwang Jung
e85e7fc7bc
fix(treesitter): handle empty region when logging (#24173) 2023-06-27 19:05:44 +01:00
Jaehwang Jung
c7e7f1d4b4
fix(treesitter): make foldexpr work without highlighting (#24167)
Problem: Treesitter fold is not updated if treesitter hightlight is not
active. More precisely, updating folds requires `LanguageTree:parse()`.

Solution: Call `parse()` before computing folds and compute folds when
lines are added/removed.

This doesn't guarantee correctness of the folds, because some changes
that don't add/remove line won't update the folds even if they should
(e.g. adding pair of braces). But it is good enough for most cases,
while not introducing big overhead.

Also, if highlighting is active, it is likely that
`TSHighlighter._on_buf` already ran `parse()` (or vice versa).
2023-06-27 19:05:09 +01:00
Justin M. Keyes
ab65a98adb
fix(docs): ignore_invalid #24174
Regex bug in scripts/gen_help_html.lua:ignore_invalid()
2023-06-27 10:21:27 -07:00
NAKAI Tsuyoshi
929e4865d1
docs(diagnostic): return value of get() #24144 2023-06-27 08:14:17 -07:00
ObserverOfTime
8ea9a70d05
vim-patch:9.0.1668: PEM files are not recognized (#24169)
Problem:    PEM files are not recognized.
Solution:   Add patterns to match PEM files. (closes vim/vim#12582)

0256d76a33
2023-06-27 09:14:34 +02:00
zeertzjq
2e055e49a3
Merge pull request #24170 from zeertzjq/vim-9.0.1664
vim-patch:9.0.{1664,1667}: divide by zero when scrolling with 'smoothscroll' set
2023-06-27 08:55:59 +08:00
zeertzjq
116b09ac04 vim-patch:9.0.1667: regression test doesn't fail when fix is reverted
Problem:    Regression test doesn't fail when fix is reverted.
Solution:   Add "n" to 'cpoptions' instead of using :winsize. (closes vim/vim#12587,
            issue vim/vim#12528)

e429893741
2023-06-27 08:26:11 +08:00
zeertzjq
3b6fb3fefd vim-patch:9.0.1664: divide by zero when scrolling with 'smoothscroll' set
Problem:    Divide by zero when scrolling with 'smoothscroll' set.
Solution:   Avoid using a negative width. (closes vim/vim#12540, closes vim/vim#12528)

8154e642aa

Co-authored-by: fullwaywang <fullwaywang@tencent.com>
2023-06-27 08:26:10 +08:00
Jonas Strittmatter
0ca2d11c1f
vim-patch:9.0.1632: not all cabal config files are recognized (#24025)
Problem:    Not all cabal config files are recognized.
Solution:   Add a couple of patterns. (Marcin Szamotulski, closes vim/vim#12463)

166cd7b801

Also:
- Do not expand Lua patterns in environment variables used in file patterns.
- Test $XDG_CONFIG_HOME on Windows, as it can be used by Nvim (and the runner
  sets it).

Co-authored-by: Marcin Szamotulski <coot@coot.me>
2023-06-26 11:19:13 +01:00
Justin M. Keyes
7578144cbd
Merge #24153 from justinmk/doc 2023-06-26 02:56:42 -07:00
Mike
aa65bd478a
fix(startup): "nvim -l foo.lua" may not set arg0 #24161
Problem:
Using "nvim -l args.lua" without passing extra script args, does not set `_G.arg[0]`.

Steps to reproduce:
```
cat > args.lua<<EOF
vim.print(_G.arg, '')
vim.print(vim.v.argv, '')
EOF

nvim --clean -l args.lua
```

Solution:
Fix condition in command_line_scan.
2023-06-26 02:38:48 -07:00
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