Commit Graph

32198 Commits

Author SHA1 Message Date
f4d9a2983a build(release.sh): fix hang when generating docs (#33026)
It's been hanging since the change in #32638.
2025-03-22 22:39:31 +08:00
4d9a1b9852 feat(provider/python)!: add python 3.13, drop 3.7 and 3.8 (EOL) #33022
https://devguide.python.org/versions/

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-03-22 07:20:46 -07:00
Au.
5187be81c2 fix(lsp): handle using array as open_floating_preview title (#33016) 2025-03-22 10:43:06 +08:00
b165ad0671 build(deps): bump tree-sitter-vim to v0.5.0 2025-03-21 17:53:13 +01:00
0ff630bfad build(deps): bump tree-sitter-markdown to v0.4.1 2025-03-21 17:53:13 +01:00
10c0f6257a build(deps): bump tree-sitter-lua to v0.3.0 2025-03-21 17:53:13 +01:00
e0cd8cfba4 docs: misc (#32928)
Co-authored-by: James Trew <j.trew10@gmail.com>
Co-authored-by: przepompownia <przepompownia@users.noreply.github.com>
2025-03-21 19:28:29 +08:00
264b4303a0 docs: LSP completion #33006 2025-03-21 03:34:28 -07:00
c908c2560d fix(log): unify error messages for vim.ui_attach/decor providers #33005
Problem:  Error messages that cause a vim.ui_attach() namespace to
          detach are not visible in the message history. Decoration
          provider and vim.ui_attach error messages are dissimilar.
Solution: Emit vim.ui_attach() errors as an actual message in addition
          to logging it. Adjust error message format.
2025-03-21 03:05:01 -07:00
fa85543e3b docs(treesitter): document TSNode:named_children()
This commit also gives an internal documentation description for
`TSNode:__has_ancestor()`.
2025-03-21 09:01:47 +01:00
175c09bd66 vim-patch:9.1.1226: "shellcmdline" completion doesn't work with input() (#32998)
Problem:  "shellcmdline" completion doesn't work with input().
Solution: Use set_context_for_wildcard_arg().  Fix indent in nextwild()
          (zeertzjq).

There are some other inconsistencies for input() completion (ref vim/vim#948),
but since "shellcmdline" currently doesn't work at all, it makse sense
to at least make it work.

fixes: vim/vim#16932
closes: vim/vim#16934

7a5115ce50
2025-03-20 07:21:17 +08:00
51853b82bc fix(messages): incorrect error message splitting and kind #32990
Problem:  Message kind logic for emitting an error message is convoluted
          and still results in emitting an unfinished message earlier than
          wanted.
Solution: Ensure emsg_multiline() always sets the kind wanted by the caller
          and doesn't isn't unset to logic for emitting the source message.
          Caller is responsible for making sure multiple message chunks are
          not emitted as multiple events by setting `msg_ext_skip_flush`...
2025-03-19 11:04:08 -07:00
c48cf18752 fix(checkhealth): module not found when &rtp has nested paths #32988
Problem: `:checkhealth` fail to find the module when `&rtp` have nested
paths.

Solution: find in order all existed `&rtp/lua` path rather than `&rtp`
to ensure prefix exist before trim `&rtp`.

In this case one module can be searched out from two different
`&rtp/lua`, we use the first `&rtp/lua` contain the module (like how
require() works).
2025-03-19 07:48:28 -07:00
424f4cc038 fix(snippet): wrong indentation when snippet contains "^" #32970
## Problem
The pattern used to match indentation is wrong as can be seen in

```lua
-- current pattern doesn't match starting space
print(vim.inspect(("   xyz"):match("(^%s+)%S")))
-- nil

-- instead, it matches characters `^ ` in text
print(vim.inspect(("x^ yz"):match("(^%s+)%S")))
-- "^ "

-- indentation could've been matched by, however not required
print(vim.inspect(("   xyz"):match("^(%s+)%S")))
-- "   "
```

## Solution
We don't even need to modify `base_indent` at every line. If every line's indentation is calculated by the previous line's indentation (which already has starting indentation) added to the starting indentation, we see that indentation is multiplied on every line.

Hence, we only add the starting line indentation to every line.
2025-03-19 14:47:59 +00:00
42db8b1759 fix(path): crash with nvim_get_runtime_file during wildcard expansion (#32992)
Problem:  Crash with nvim_get_runtime_file during wildcard expansion.
Solution: Ensure recursive gen_expand_wildcards() is allowed when
          calling os_breakcheck()
2025-03-19 22:36:08 +08:00
21cbd90007 fix(filetype): normalize full path before matching #32227
Problem:
On Windows, treesitter query files are not recognized as such when
opened from inside their directory, because the full path returned from
fnamemodify(_, ':p') contains backslashes, while the filetype patterns
expect forward slashes.

Solution:
Normalize the result of fnamemodify(_, ':p') before trying to match it
to filetype patterns.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-03-19 05:41:25 -07:00
f1fcf653cb fix(diagnostic): clear virtual_lines autocmd only for valid buf #32979 2025-03-19 05:27:20 -07:00
0e59f6f4c7 fix(api): don't use 'winborder' when reconfiguring float (#32984)
Problem: Reconfiguring a float window applies the global 'winborder'.
Solution:
- Ignore 'winborder' when reconfiguring a float window.
- Still apply 'winborder' when converting a split to a float window.
2025-03-19 12:16:20 +00:00
74fcc9452c fix(runtime): gO always says "Help TOC" #32971
Problem:
gO always says "Help TOC".

Solution:
Use a generic title instead.
2025-03-19 04:17:00 -07:00
d6653e1cc9 fix(marks): ensure decor is removed with proper range (#32973)
Problem:  Paired mark whose end is in front of its start should not have
          its decor removed (as fixed by 72f630f9), but may still need to
          have its range redrawn.
Solution: Still call `buf_decor_remove()` but ensure it is not called with
          an inverse range when `extmark_del()` is called on an end mark.
2025-03-19 10:00:42 +00:00
5ff8a2fa8b vim-patch:40ab82b: runtime(sh): remove invalid commented out line in syntax script
40ab82b974

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-19 10:24:51 +01:00
ef591f46bf vim-patch:711f4a0: runtime(sh): update sh indent script
fixes: vim/vim#16930

711f4a07f3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-19 10:24:51 +01:00
17d0420e65 vim-patch:11ab02c: runtime(go): use :term for keywordprg for nvim/gvim
Problem:
- The document from `go doc` can be very long, and you can scroll if
  using `!` to run shell command in Gvim.
- I realize that I didn't fully mimic behavior of default keywordprg
  in Nvim in the last commit.

Solution:
- Use builtin terminal for keywordprg in Gvim
- In Nvim (both TUI and GUI), it should mimic the behavior of Vim
  `:term`, `:Man`, and `:help`

closes: vim/vim#16911

11ab02c819

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-03-19 10:24:51 +01:00
ac2fcb5f76 vim-patch:ad2f6b6: runtime(keymap) Add forward slash (/) to russian-jcukenwin keymap
closes: vim/vim#16912

ad2f6b6662

Co-authored-by: Marat Amerov <maratamerov@gmail.com>
2025-03-19 10:24:51 +01:00
63bbb7c109 fix(api): fix 'winborder' preventing splits with nvim_open_win (#32981)
While at it, rename the p_winbd variable to p_winborder, as 'winbd' is
not the option's short name.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-19 07:28:24 +00:00
190d0241e2 fix(options): fix 'winborder' accepting multiple string values (#32978)
Problem:  'winborder' accepting multiple string values.
Solution: Use the fallback did_set_str_generic() callback instead of
          did_set_winborder() which calls opt_strings_flags() with
          incorrect last argument.
2025-03-19 14:17:53 +08:00
aafbd442b2 vim-patch:9.1.1220: filetype: uv.lock file not recognized (#32955)
Problem:  filetype: uv.lock file not recognized
Solution: detect uv.lock file as toml filetype
          (Acaibird)

closes: vim/vim#16924

18a6853a76
2025-03-18 23:34:56 +00:00
430d12a4fd vim-patch:9.1.1221: Wrong cursor pos when leaving Insert mode just after 'autoindent' (#32976)
Problem:  Wrong cursor position and '^' mark when leaving Insert mode
          just after 'autoindent' and cursor on last char of line.
Solution: Don't move cursor to NUL when it wasn't moved to the left
          (zeertzjq).

fixes: vim/vim#15581
related: neovim/neovim#30165 neovim/neovim#32943
closes: vim/vim#16922

a3a7d10bfb
2025-03-18 23:34:02 +00:00
4d83649d10 vim-patch:9.1.1222: using wrong length for last inserted string (#32975)
Problem:  using wrong length for last inserted string
          (Christ van Willegen, after v9.1.1212)
Solution: use the correct length in get_last_insert_save(), make
          get_last_insert() return a string_T (John Marriott)

closes: vim/vim#16921

8ac0f73eb1

N/A patches:
vim-patch:9.1.1129: missing out-of-memory test in buf_write()
vim-patch:9.1.1218: missing out-of-memory check in filepath.c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-03-19 07:08:39 +08:00
62d9fab9af feat(float): add winborder option (#31074)
Problem:
There is currently no global option to define the default border style for floating windows. This leads to repetitive code when developers need consistent styling across multiple floating windows.

Solution:
Introduce a global option winborder to specify the default border style for floating windows. When a floating window is created without explicitly specifying a border style, the value of the winborder option will be used. This simplifies configuration and ensures consistency in floating window appearance.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-03-18 16:05:35 -05:00
eefd72fff7 build(deps): bump tree-sitter-query to v0.5.1 2025-03-18 15:21:37 +01:00
d774fc6b33 build(deps): bump tree-sitter-vimdoc to v3.0.1 2025-03-18 14:44:38 +01:00
9177371014 fix(help): remove runnable code virtual text
Problem: Virtual text indicating runnable code examples in help files is
intrusive and non-configurable (and often denotes actually non-working
examples).

Solution: Remove virtual text.
2025-03-18 14:22:08 +01:00
6623b4e050 docs: misc #32959 2025-03-18 06:20:47 -07:00
7333c39e6c docs: misc #32959 2025-03-18 06:18:37 -07:00
29a47b39cc fix(runtime): E15: Invalid expression in lua file when gf
Problem:
after https://github.com/neovim/neovim/pull/32719, `gf` error in lua:
```
E15: Invalid expression: "v:lua.require"vim._ftplugin.lua".includeexpr()"
E447: Can't find file "vim._ftplugin.lua" in path
```

Solution:
* use single quote (no idea why there's two pair double quote in
  expression).
* add missing `v:fname`.
2025-03-18 10:10:36 +01:00
d40481322a fix(lua): ensure inspect_pos() only shows visible highlight extmarks
Problem:  Unpaired marks are shown with `filter.extmarks == true`, which
          should only return visible highlights. Misleading `end_col`
          included in `inspect_pos()` for unpaired mark; it is set to
          `start_col + 1` which would be a visible highlight, which it is
          not. Custom "is_here" filter used to get extmarks overlapping a
          position.

Solution: Exclude unpaired highlight extmarks with `filter.extmarks == true`.
          Set `end_col` to `start_col` for an unpaired mark. Supply
          appropriate arguments to nvim_buf_get_extmarks() to return
          overlapping extmarks; exclude marks whose end is at `{row, col}`
          with `filter.extmarks == true`.
2025-03-18 09:39:19 +01:00
1369d86812 test: cleanup ftplugin_spec.lua #32948
Problem:
- cannot run ftplugin_spec.lua by itself
- test leaves foo/ dir

Solution:
- fix setup and teardown
2025-03-17 17:13:04 -07:00
3b1d0e7f70 fix(diagnostic): remove deprecated severity_limit option
Deprecated to be removed in 0.11
2025-03-17 23:43:09 +01:00
97bbc49cda Merge pull request #32935 from zeertzjq/vim-3495497
vim-patch: too many strlen() calls in edit.c
2025-03-18 06:41:58 +08:00
08c328b8b0 feat(runtime): Lua ftplugin 'includeexpr' #32719
Problem:
Current `'includeexpr'` in runtime/ftplugin/lua.vim doesn't work with Nvim Lua.

Solution:
Provide an improved 'includeexpr' for Lua in "ftplugin/lua.lua".

Closes: https://github.com/neovim/neovim/issues/32490
2025-03-17 15:41:07 -07:00
d717f8605a vim-patch:9.1.1216: Pasting the '.' register multiple times may not work
Problem:  Pasting the '.' register multiple times may work incorrectly
          when the last insert starts with Ctrl-D and ends with '0'.
          (after 9.1.1212)
Solution: Restore the missing assignment (zeertzjq).

closes: vim/vim#16908

61b3544424
2025-03-18 06:12:40 +08:00
59d8d50c5b vim-patch:3495497: patch 9.1.1212: too many strlen() calls in edit.c
Problem:  too many strlen() calls in edit.c
Solution: refactor edit.c and remove strlen() calls
          (John Marriott)

This commit attempts to make edit.c more efficient by:

- in truncate_spaces() pass in the length of the string.
- return a string_T from get_last_insert(), so that the length of the
  string is available to the caller.
- refactor stuff_insert():

  - replace calls to stuffReadbuff() (which calls STRLEN() on it's
    string argument) with stuffReadbuffLen() (which gets the length of
    it's string argument passed in).
  - replace call to vim_strrchr() which searches from the start of the
    string with a loop which searches from end of the string to find the
    last ESC character.

- change get_last_insert_save() to call get_last_insert() to get the
  last_insert string (the logic is in one place).

closes: vim/vim#16863

34954972c2

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-03-18 06:12:29 +08:00
063b69bab4 fix(column): unnecessary redraws with resized 'statuscolumn' (#32944)
Problem:  Since 3cb1e825, all windows with 'statuscolumn' set, and a
          resized 'signcolumn' for a particular buffer are marked
          to be fully redrawn when the first window is encountered.
          The "resized" variable is only unset after all windows have
          been drawn, so this results in windows that have just been
          draw to be marked for redraw again, even though the
          signcolumn did not change size again.
Solution: Replace the `resized` variable with a `last_max` variable that
          is changed when the first window into buf is encountered.
2025-03-17 21:52:45 +01:00
5440e59247 Merge #32810 docs 2025-03-17 04:59:31 -07:00
f96606371c docs: misc 2025-03-17 12:31:53 +01:00
041a939eeb docs(api): rename "handle" => "id" 2025-03-17 12:06:38 +01:00
cab3950762 docs: OSC 133
The "end" termcode is not actually needed for our purposes. And the
suggested $PS1 has trouble with bash's "reverse find" (CTRL-r) feature,
probably because I did it wrong...
2025-03-17 12:06:38 +01:00
d0cda9d6c5 Merge pull request #32871 from ofseed/test-lsp
test(lsp): add some tests for LSP bugs
2025-03-17 09:11:05 +00:00
96e5b61be1 test(lsp): add a test for refreshing hints after being requested 2025-03-17 14:44:55 +08:00