Commit Graph

3909 Commits

Author SHA1 Message Date
Justin M. Keyes
6dd6c5b523 docs: rename l10n help files #36377 2025-10-28 20:15:16 -07:00
Jonny Kong
e2cb675705 fix(filetype): move fallback logic to vim.filetype.match() #30141
Problem:
Previously, the fallback logic to ".conf" was located outside of
`vim.filetype.match()` and directly within the AutoCmd definition. As a
result, `vim.filetype.match()` would return nil instead of ".conf" for
fallback cases (#30100).

Solution:
Added a boolean return value to `vim.filetype.match()` that indicates
whether the match was the result of fallback. If true, the filetype will
be set using `setf FALLBACK <ft>` instead of `setf <ft>`.
2025-10-28 18:45:50 -07:00
zeertzjq
3c14646896 vim-patch:9.1.1886: filetype: Android aconfig files are not recognized (#36374)
Problem:  filetype: Android aconfig files are not recognized
Solution: Detect *.aconfig files as pbtxt filetype (Bruno Belanyi)

Reference:
https://source.android.com/docs/setup/build/feature-flagging/declare-flag

closes: vim/vim#18656

7adeb09bb2

Co-authored-by: Bruno Belanyi <bruno@belanyi.fr>
2025-10-29 00:16:15 +00:00
zeertzjq
ee60bf6112 vim-patch:6be154f: runtime(doc): revert wrong 'incsearch' description
This reverts commit 3fc00c05fb464d3e806df53bdc1743faa337ddca.

related: vim/vim#18639

6be154f5e6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-10-29 08:05:28 +08:00
Justin M. Keyes
3fb53abe2a fix(health): attempt to concatenate table value #36369 2025-10-28 07:52:22 -07:00
yilisharcs
b9451dfd4c fix(ui2): emit FileType event after setting default pager options #36315
Problem: Setting a filetype before configuring default options for ui2
buffers (pager, cmd, ...) prevents users from setting their own options.

Solution: Call nvim_set_option_value after defaults are set.

Closes #36314

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-10-27 10:19:16 -07:00
tao
a768d0a95b fix(lsp): stop repeatedly resuming dead coroutine #35743
Problem:
Error extracting content-length causes all future coroutine resumes to
fail.

Solution:
Replace coroutine.wrap with coroutine.create in create_read_loop
so that we can check its status and catch any errors, allowing us to
stop the lsp client and avoid repeatedly resuming the dead coroutine.
2025-10-27 10:03:45 -07:00
zeertzjq
35d04394aa vim-patch:9.1.1878: filetype: Soy files are not recognized (#36346)
Problem:  filetype: Soy files are not recognized
Solution: Detect *.soy files as soy filetype,
          include a soy filetype plugin (Riley Bruins)

closes: vim/vim#18640

9fff99c3c2

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-10-27 02:52:56 +00:00
zeertzjq
155efabb15 vim-patch:9.1.1876: pre-inserted text not exposed in complete_info() (#36342)
Problem:  pre-inserted text not exposed in complete_info()
Solution: Add the pre-inserted text to the complete_info() Vim script
          function (Girish Palya)

closes: vim/vim#18571

Feat: expose preinserted text in complete_info()

ef5bf58d8c

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-10-27 01:34:52 +00:00
zeertzjq
d8326ed15d vim-patch:3fc00c0: runtime(doc): mention that 'incsearch' ignores addresses and offset
closes: vim/vim#18639

3fc00c05fb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-10-27 08:22:12 +08:00
skewb1k
e239179871 fix(lsp): ensure bufnr is passed for buffer-local requests (#36325)
Problem:
Some LSP method handlers were making requests without specifying a
bufnr, defaulting to 0 (current). This works in most cases but
fails when client attaches to background buffers, causing
assertions in handlers to fail.

Solution:
Ensure bufnr is passed to Client.request for buffer-local methods.
2025-10-25 14:51:13 -07:00
zeertzjq
520568f40f fix(terminal): adjust marks when deleting scrollback lines (#36294)
This also fixes inconsistent scrolling behavior on terminal output when
cursor is in the middle of the buffer and the scrollback is full.
2025-10-25 06:48:04 +08:00
xvzc
095b9f98f3 fix(filetype): handle invalid bufnr in _getlines(), _getline() #36272
**Problem:**
`vim.filetype.match({ filename = 'a.sh' })` returns `nil` because
an invalid buffer ID is passed to `vim.api.nvim_buf_get_lines()`.
For filetypes like `csh`, `txt`, or any other extensions that call
`_getlines()` or `_getline()` to detect their filetypes, the same
issue occurs.

When only the `filename` argument is passed, an error is raised
inside a `pcall()` that wraps the filetype detection function,
causing it to return no value without showing any error message.

**Solution:**
Validate the `bufnr` value in `_getlines()` and `_getline()`.
2025-10-23 17:34:12 -07:00
Justin M. Keyes
1f2883e879 fix(outline): use 2-space indent instead of 1-space
2 spaces is more visually distinct at very little cost.
2025-10-24 02:07:37 +02:00
Justin M. Keyes
7838c242e9 docs: types, news, lua-plugin
- mention "lua_ls", not "luals". https://github.com/neovim/neovim/discussions/36182

Co-authored-by: Maria Solano <majosolano99@gmail.com>
2025-10-24 02:07:37 +02:00
Justin M. Keyes
4129fa5bac Merge #36299 improve PackChanged event 2025-10-23 18:29:24 -04:00
zeertzjq
67832710a5 fix(terminal): wrong row in TermRequest with full scrollback (#36298)
Problem:  Wrong row in TermRequest with full scrollback.
Solution: Subtract by the number of lines deleted from scrollback.
2025-10-24 06:01:13 +08:00
Evgeni Chasnovski
83f7d98518 docs(pack): add plugin hooks example
Problem: No examples of how to use `PackChanged[Pre]` for plugin hooks.

Solution: Add examples of creating plugin hooks.
2025-10-23 20:28:13 +03:00
Evgeni Chasnovski
16a6559ec6 fix(pack)!: do not trigger PackChanged[Pre] kind=update during install
Problem: `PackChanged[Pre]` events with `kind=update` are triggered both
  during plugin's initial installation and after already installed
  plugin was updated.

  It was a deliberate decision to allow writing only a single update
  hook to act as a dedicated "build" entry point (like execute `make` or
  `cargo build —release`). This mimics how other plugin managers have a
  single "build" command.

  This was a result of 'mini.deps' experience with the different
  approach: "update" hooks are not run during install. This proved to be
  confusing as it requires to write two hooks. But also the reason might
  be that 'mini.deps' names it "checkout" hook instead of "update".

  However, the `vim.pack` event approach makes it lower cost to handle
  separate "update" and "install" events. Something like
  `if ev.data.kind == 'install' or ev.data.kind == 'update' then`
  instead of two autocommands.
  Plus this makes clearer separation of events.

Solution: do not trigger `PackChanged[Pre] kind=update` event during
  install.
2025-10-23 20:28:09 +03:00
Evgeni Chasnovski
a9db6ec6fa feat(pack): add active field to PackChanged event data
Problem: Inside `PackChanged[Pre]` callbacks it might be useful to tell
  if the affected plugin is active or not. It is already possible via
    extra `vim.pack.get({ 'plug-name' })[1].active`, but it is not quite
    user-friendly for something that might be needed frequently in real
    world use cases.

Solution: Supply extra `active` event data field.
2025-10-23 17:50:03 +03:00
Fredrik Lanker
323d5527ee fix(lsp): set 'linebreak' in floating windows (#36275)
Set linebreak to avoid splitting words.

Fix #36268
2025-10-22 13:38:47 -04:00
luukvbaal
c94b7b93c0 fix(ui2): start treesitter after deleting cmdline buffer (#36274)
Problem:  Treesitter is not started in new cmdline buffer after deletion.
Solution: Start treesitter when highlighter buffer no longer matches.
2025-10-22 16:16:36 +02:00
Robert
cf48741227 docs(vimfn): getcwd() behavior #36222 2025-10-21 10:40:02 -07:00
Riley Bruins
3c4acc0f1a fix(lsp): noisy log message when enabling server without config #36264
This warning doesn't really make sense, since the `enable()` call is
meant to be run before the `lsp.config` calls. It will be logged many
times (once for each enabled LSP) at startup.

This is especially annoying because calling `enable()` after
configuration causes the first opened buffer not to have its filetype
set in some situations. This is a separate bug which really needs to be
fixed, and makes this superfluous logging more likely.
2025-10-21 07:16:19 -07:00
Till Bungert
b67eff38fe fix(lsp): deduplicate completion items #36166
The current implementation has a race condition where items are appended
to the completion list twice when a second completion runs while the
first is still going. This hotfix just deduplicates the entire list.

Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
2025-10-20 15:45:37 -07:00
Maria Solano
c90135d6e5 docs(ui): 'pumborder' #36255 2025-10-20 15:10:03 -07:00
David
371ad48135 fix(lsp): replace string types with LSP method alias type annotations where appropriate. (#36180)
fix(lsp): replace `string` types with LSP method alias where appropriate
2025-10-16 12:39:53 -04:00
Davidyz
b459bf5961 fix(lsp): include missing LSP methods and update type annotations 2025-10-16 11:05:28 +01:00
Mathias Fußenegger
cdc3702f8d revert "fix(lsp): _get_workspace_folders does not handle root_dir() function" #36183
This reverts commit 97ab24b9c7.

See discussion in https://github.com/neovim/neovim/pull/36071
2025-10-14 19:26:01 -07:00
Justin M. Keyes
bf4710d8c3 fix(lsp): "attempt to index nil config" #36189
Problem:
If a client doesn't have a config then an error may be thrown.
Probably caused by: 2f78ff816b

    Lua callback: …/lsp.lua:442: attempt to index local 'config' (a nil value)
    stack traceback:
            …/lsp.lua:442: in function 'can_start'
            …/lsp.lua:479: in function 'lsp_enable_callback'
            …/lsp.lua:566: in function <…/lsp.lua:565>

Solution:
Not all clients necessarily have configs.
- Handle `config=nil` in `can_start`.
- If user "enables" an invalid name that happens to match a *client*
  name, don't auto-detach the client.
2025-10-15 00:43:25 +00:00
zeertzjq
fc74b9fb34 vim-patch:83eb1da: runtime(doc): Normalise formatting of builtin function descriptions (#36172)
- Column align tags
- Move tags to the same line as the function signature
- Move descriptions to the line below the function signature
- Add missing hyperlinks to builtins in the description text

closes: vim/vim#18478

83eb1da19e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-14 02:23:26 +00:00
zeertzjq
a65202e6bd vim-patch:partial:c58f91c: runtime(doc): Whitespace updates (#36160)
Use double sentence spacing and wrap lines at 'textwidth'.  Code
examples and tables were not wrapped unless this had already been done
locally.

closes: vim/vim#18453

c58f91c035

Fix incorrect docs in :h ModeChanged.
Cherry-pick :h bufnr() changes from patch 8.1.2080.

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-13 08:53:21 +00:00
Tomas Slusny
c6113da5a9 fix(difftool): fully resolve symlinks when comparing paths #36147
Fixes issue on mac where it was constantly reloading buffers as paths
were not being normalized and resolved correctly (in relation to buffer
name).

Quickfix entry:
/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue

Buffer name:
/private/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue

/var was synlinked to /private/var and this was not being properly
handled.

Also added lazy redraw to avoid too many redraws when this happens in
future and added test for symlink handling.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2025-10-12 18:25:14 +00:00
zeertzjq
f4e4799f27 docs: small fixes (#36146)
Close #35989
Close #36031
Close #36107

Co-authored-by: Kieran Moy <kfatyuip@gmail.com>
Co-authored-by: William Sprent <william@sprent.dk>
Co-authored-by: David Briscoe <43559+idbrii@users.noreply.github.com>
2025-10-12 12:16:14 +08:00
glepnir
072f126453 fix(ui): 'pumborder' parsing, shadow #36127
Problem:
1. Setting `pumborder=+,+,+,+,+,+,+,+` failed to render the custom
   border characters correctly. The issue occurred in `parse_winborder()`
   where it incorrectly used `p_winborder` instead of the `border_opt`
   parameter when the option value didn't contain commas.
2. In `pum_redraw()`, calling `parse_border_style()` directly with the
   option string failed to parse comma-separated border characters.
3. Missing documentation for PmenuShadow and PmenuShadowThrough
   highlight groups used by the shadow border style.
4. Coverity reports CID 631420: passing WinConfig (480 bytes) by value
   in `grid_draw_border()`.
5. crash when using `shadow` value on pumborder.

Solution:
1. Fix `parse_winborder()` to use `border_opt` parameter consistently,
   ensuring the correct option value is parsed regardless of which
   option (winborder/pumborder) is being set.
2. Update `pum_redraw()` to call `parse_winborder()` instead of
   `parse_border_style()`, properly handling both predefined styles
   and custom comma-separated border characters.
3. Add documentation for PmenuShadow (blended shadow areas) and
   PmenuShadowThrough (see-through corners) highlight groups.
4. Change `grid_draw_border()` to accept WinConfig by pointer.
5. When the "shadow" style is used, no additional row and column offset
   is applied, and the border width is reduced.
2025-10-11 19:48:27 -07:00
Tomas Slusny
fec02ae8e4 feat(plugins): nvim.difftool can compare directories #35448
Problem:
Built-in diff mode (nvim -d) does not support directory diffing
as required by git difftool -d. This makes it difficult to compare
entire directories, detect renames, and navigate changes efficiently.

Solution:
Add a DiffTool plugin and command that enables side-by-side diffing of
files and directories in Neovim. The plugin supports rename detection,
highlights changes in the quickfix list, and provides a user command for
easy invocation. This allows proper integration with git difftool -d for
directory comparison.

Example git config:

```ini
[diff]
    tool = nvim_difftool

[difftool "nvim_difftool"]
    cmd = nvim -c "packadd nvim.difftool" -c "DiffTool $LOCAL $REMOTE"
```

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-10-11 19:24:39 -07:00
atusy
97ab24b9c7 fix(lsp): _get_workspace_folders does not handle root_dir() function #36071
* fix(lsp): type of root_dir should be annotated with string|fun|nil
* feat(lsp): support root_dir as function in _get_workspace_folders
* feat(lsp): let checkhealth support root_dir() function

Examples:

    vim.lsp: Active Clients ~
    - lua_ls (id: 1)
      - Version: <Unknown>
      - Root directories:
          ~/foo/bar
          ~/dev/neovim

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-10-11 16:01:05 -07:00
Till Bungert
28157738e3 fix: vim.lsp.omnifunc should not throw away other items #35346 2025-10-11 12:42:14 -07:00
glepnir
fafc329bbd feat(ui): 'pumborder' (popup menu border) #25541
Problem:
Popup menu cannot have a border.

Solution:
Support 'pumborder' option.
Generalize `win_redr_border` to `grid_redr_border`,
which redraws border for window grid and pum grid.
2025-10-10 07:14:50 -07:00
luukvbaal
d8cea8d45d fix(ui2): don't scroll beyond eob in dialog window #36116
Problem:  Forward page scrolling reveals eob lines in the dialog window.
Solution: Check if the end of the buffer is visible before scrolling down.
2025-10-10 07:05:40 -07:00
Mickaël RAYBAUD-ROIG
8e740db70c fix(vim.pack): skip checkout on bad version #36038
Refs: #36037
2025-10-09 13:40:26 -07:00
Igor Lacerda
f67306cc67 fix(lsp): typos in method names #36077 2025-10-07 20:44:57 -07:00
Evgeni Chasnovski
3b860653ca fix(pack): handle lockfile in case of install errors #36064
Problem: If plugin was intended to install but there were errors (like
  if there is a typo in `src`), lockfile still includes its entry.
  This leads to all source of problems (like not correct `get()` output,
  not working `update()`, etc.).

Solution: Explicitly account for plugins that were not installed.
  Alternative solution might be to write a safe
  `lock_set(plug, field, value)` wrapper (which sets field for a correct
  `plugins` entry in the lockfile Lua table) and use it after install
  to detect the change in `version`. However, this always requires
  an extra pass through plugins on every startup, which is suboptimal.
  Optimizing for the "happy path" should be a priority in `add()`.
2025-10-07 12:24:23 -07:00
Maria Solano
006101360d fix(lsp): use LSP method type in more places (#36069) 2025-10-07 11:17:40 -04:00
zeertzjq
a4a8838178 vim-patch:9.1.1829: filetype: KerML and SysML files are not recognized (#36042)
Problem:  filetype: KerML and SysML files are not recognized
Solution: Detect *.kerml as kerml filetype, detect *.sysml as sysml
          filetype, include a kerml and sysml filetype plugin
          (Daumantas Kavolis)

closes: vim/vim#18476

b73ccf7ff0

Co-authored-by: Daumantas Kavolis <daumantas.kavolis@sensmetry.com>
2025-10-06 06:07:41 +08:00
Maria Solano
729e0acd26 feat(lsp): pass client ID in code action filter (#36046) 2025-10-05 15:02:00 -07:00
Maria Solano
bcc9242bc7 fix: remove quotes around nil deprecation alternatives (#36047) 2025-10-05 14:39:23 -07:00
Evgeni Chasnovski
98e3a571dd feat(pack): add code actions in confirmation buffer
Problem: No way to granularly operate on plugins when inside
confirmation buffer.

Solution: Implement code actions for in-process LSP that act on "plugin
at cursor":
  - Update (if has updates).
  - Skip updating (if has updates).
  - Delete.

  Activate via default `gra` or `vim.lsp.buf.code_action()`.
2025-10-05 19:20:06 +03:00
Evgeni Chasnovski
2728b4efe0 feat(pack): add [[ and ]] mappings in confirmation buffer
Problem: No easy/robust way to jump between plugin sections.

Solution: Add `[[` and `]]` mappings.
2025-10-05 19:20:05 +03:00
phanium
913b05bf63 fix(lsp): format_item should return string (#36025)
Problem: format_item return two value
Solution: `:h vim.ui.select()` say format_item should return string
2025-10-05 09:00:04 -07:00