Commit Graph

31818 Commits

Author SHA1 Message Date
zeertzjq
c9000a6b13
vim-patch:9.1.1028: too many strlen() calls in screen.c (#32083)
Problem:  too many strlen() calls in screen.c
Solution: refactor screen.c and remove calls to strlen(),
          verify that leadmultispace != NULL (John Marriott)

closes: vim/vim#16460

c15de972e8

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-18 02:03:13 +00:00
Yochem van Rosmalen
c6cc937512
docs: change augroup names to new convention #32061
Ref: 09e01437c9
2025-01-17 14:56:30 -08:00
Mathias Fussenegger
b9e6fa7ec8 fix(lsp): use filterText as word if textEdit/label doesn't match
Problem:

With language servers like lemminx, completing xml tags like `<mo` first
shows the right candidates (`modules`) but after typing `d` the
candidates disappear.

This is because the server returns:

    [...]
    filterText = "<module",
    label = "module",
    textEdit = {
      newText = "<module>$1</module>$0",

Which resulted in `module` being used as `word`, and `module` doesn't
match the prefix `<mo`. Typing `d` causes the `complete()` filtering
mechanism to kick in and remove the entry.

Solution:

Use `<module` from the `filterText` as `word` if the textEdit/label
heuristic doesn't match.
2025-01-17 18:34:58 +01:00
Christian Clason
3530182ba4 vim-patch:9.1.1026: filetype: swc configuration files are not recognized
Problem:  filetype: swc configuration files are not recognized
Solution: detect .swcrc files as json filetype (Marces Engel)

References:
https://swc.rs/docs/configuration/swcrc

closes: vim/vim#16462

3a738fccaa

Co-authored-by: Marces Engel <marces@facemurphy.com>
2025-01-17 16:45:59 +01:00
Christian Clason
97d5855351 docs(gh): use new issue types 2025-01-17 16:41:39 +01:00
Luuk van Baal
5dd60e01ac refactor(cmdline): more idiomatic way to avoid cmdline_show
Problem:  Fix applied in #32033 can be more idiomatic.
Solution: Unset redraw_state instead of cmdbuff.
2025-01-17 08:40:50 +01:00
Luuk van Baal
7ce27381fb fix(messages): lsp window/showMessage is not an error
Ref https://github.com/neovim/neovim/discussions/32015
2025-01-17 08:40:50 +01:00
zeertzjq
ac3859a441
vim-patch:a234a46: runtime(doc): fix typo in usr_02.txt (#32063)
fixes: vim/vim#16455

a234a46651

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-17 09:09:47 +08:00
zeertzjq
cd92924896
vim-patch:9.1.1021: string might be used without a trailing NUL (#32062)
Problem:  string might be used without a trailing NUL (after v9.1.0997)
Solution: Make sure that the buffer is NUL terminated

closes: vim/vim#16457

70dfc374ec

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-17 08:53:10 +08:00
zeertzjq
0d3a8e8c1a
vim-patch:9.1.1020: no way to get current selected item in a async context (#32056)
Problem:  no way to get current selected item in a async context
Solution: add completed flag to show the entries of currently selected
          index item (glepnir)

closes: vim/vim#16451

037b028a22

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-17 08:38:58 +08:00
Gregory Anders
bf098c12e3
Merge pull request #32038 from gpanders/push-nsrttwwnsqvm
feat(terminal): add support for kitty keyboard protocol
2025-01-16 18:33:22 -06:00
Gregory Anders
819337a13f test: use esc sequences in vterm unit tests 2025-01-16 16:41:37 -06:00
Gregory Anders
6f0bde11cc feat(terminal): add support for kitty keyboard protocol
This commit adds basic support for the kitty keyboard protocol to
Neovim's builtin terminal. For now only the first mode ("Disambiguate
escape codes") is supported.
2025-01-16 16:41:08 -06:00
Lewis Russell
fb564ddff0
refactor(options): generic expand and did_set callbacks (#32011)
* refactor(options): generic expand and did_set callbacks

Problem:

Many options have similar callbacks to check the values are valid.

Solution:

Generalize these callbacks into a single function that reads the option
table.

* refactor: gen_options.lua

refactor: gen_options.lua - inline get_cond

* refactor(options): use a simpler format for the common default
2025-01-16 20:53:17 +00:00
zeertzjq
92d3bf101d
Merge pull request #32051 from zeertzjq/vim-9.1.1013
vim-patch:9.1.{1013,1017}
2025-01-16 12:20:33 +08:00
zeertzjq
47a4e42392 vim-patch:9.1.1017: Vim9: Patch 9.1.1013 causes a few problems
Problem:  Vim9: Patch 9.1.1013 causes a few problems
Solution: Translate the function name only when it is a string
          (Yegappan Lakshmanan)

fixes: vim/vim#16453
closes: vim/vim#16450

9904cbca41

Cherry-pick call() change from patch 9.0.0345.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-01-16 11:17:14 +08:00
zeertzjq
f8680d0097 vim-patch:9.1.1013: Vim9: Regression caused by patch v9.1.0646
Problem:  Vim9: Regression caused by patch v9.1.0646
Solution: Translate the function name before invoking it in call()
          (Yegappan Lakshmanan)

fixes: vim/vim#16430
closes: vim/vim#16445

6289f91591

N/A patch:
vim-patch:8.2.4176: Vim9: cannot use imported function with call()

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-01-16 11:17:14 +08:00
zeertzjq
718e165360
vim-patch:9.1.1018: v9.1.0743 causes regression with diff mode (#32047)
Problem:  v9.1.0743 causes regression with diff mode
Solution: Fix the regression with overlapping regions

closes: vim/vim#16454

01f6509fb2

Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
2025-01-16 01:16:25 +00:00
Christian Clason
524be56042
vim-patch:9.1.1019: filetype: fd ignore files are not recognized (#32042)
Problem:  filetype: fd ignore files are not recognized
Solution: detect .fdignore files as gitignore filetype

closes: vim/vim#16444

3058087f6f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-16 07:34:25 +08:00
Christian Clason
f0fdc1de6c build(deps): bump libuv to v1.50.0 2025-01-15 19:54:54 +01:00
dundargoc
7c65224257 build: fix lint error on macos 2025-01-15 18:54:08 +01:00
luukvbaal
bbf36ef8ef
fix(cmdline): prevent cmdline_show events after exiting cmdline #32033
Problem:  If a (vim.ui_attach) cmdline_hide callback triggers a redraw,
          it may cause cmdline_show events for an already exited cmdline.
Solution: Avoid emitting cmdline_show event when ccline.cmdbuff is
          already NULL. Unset ccline.cmdbuff before emitting cmdline_hide.
2025-01-15 06:55:21 -08:00
luukvbaal
5cc93ef472
fix(marks): revise metadata for start mark of revalidated pair #32017
Problem:  Metadata may be revised for end mark of a revalidated pair.
Solution: Revise metadata for start mark of a revalidated pair.
2025-01-15 02:38:45 -08:00
Evgeni Chasnovski
09bcb31068
fix(docs): replace yxx mappings with g== #31947
Problem:
`yx` uses "y" prefix, which shadows a builtin operator.

Solution:
Use `g=` (in the form of `g==` currently), drawing from precedent of
CTRL-= and 'tpope/vim-scriptease'.
2025-01-15 02:36:00 -08:00
Justin M. Keyes
9552fe7ef9
Merge #32013 from luukvbaal/shellkind 2025-01-15 02:23:44 -08:00
Justin M. Keyes
3ee63edc1b
Merge #32001 from MariaSolOs/consistent-namespaces 2025-01-15 02:01:44 -08:00
Andrew Braxton
0a7e4e9e5f
fix(lsp): vim.lsp.enable(...,false) does not disable #32002
Problem:
Per the documentation, passing `false` as the `enable` parameter of
`vim.lsp.enable()` should disable the given LSP(s), but it does not work
due to a logic error.

Specifically, `enable == false and nil or {}` will always evaluate to
`{}` because `nil` is falsy.

Solution:
Correct the conditional statement.
2025-01-15 01:58:36 -08:00
Luuk van Baal
d55b17e2b4 fix(messages): verbose kind for nvim_echo()
Problem:  No "verbose" kind for nvim_echo() opts->verbose.
Solution: Pass NULL "kind" to indicate no new kind.
2025-01-15 10:51:55 +01:00
Luuk van Baal
5bae80899d feat(messages): add :!cmd shell message kinds
Also print stderr error messages with ErrorMsg highlight group.
2025-01-15 10:51:52 +01:00
Christian Clason
bc69f27237 vim-patch:045564d: runtime(colors): Update colorschemes, include new unokai colorscheme
- new unokai colorscheme (similar/inspired by monokai)
- the rest: add explicit PopupSelected link to PmenuSel

closes: vim/vim#16443

045564d0a7

Co-authored-by: Maxim Kim <habamax@gmail.com>
2025-01-15 09:48:55 +01:00
Maria José Solano
575f4bc7d5 docs: document namespace/augroup convention 2025-01-14 21:25:25 -08:00
Maria José Solano
09e01437c9 refactor: use nvim.foo.bar format for autocommand groups 2025-01-14 21:25:25 -08:00
zeertzjq
a78eddd541
vim-patch:9.1.1015: Coverity complains about dereferencing NULL value (#32020)
Problem:  Coverity complains about dereferencing NULL value
Solution: Check that cms2 is not null

closes: vim/vim#16438

1ac53b84ad

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-15 12:05:00 +08:00
Maria José Solano
850084b519 refactor: use nvim.foo.bar format for namespaces 2025-01-14 19:55:29 -08:00
Mike
611ef35491
feat(vim.fs): find(), dir() can "follow" symlinks #31551
Problem:
vim.fs.dir(), vim.fs.find() do not follow symlinks.

Solution:
- Add "follow" flag.
- Enable it by default.
2025-01-14 16:39:17 -08:00
Gregory Anders
e8a6c1b021
fix(lsp): schedule call to vim.lsp.start for async root_dir (#31998)
When `root_dir` is a function it can (and often will) call the provided
callback function in a fast API context (e.g. in the `on_exit` handler
of `vim.system`). When the callback function is executed we should
ensure that it runs vim.lsp.start on the main event loop.
2025-01-14 08:19:54 -06:00
Gregory Anders
f1c45fc7a4
feat(terminal): support theme update notifications (DEC mode 2031) (#31999) 2025-01-14 08:18:59 -06:00
bfredl
59da82abd9 fix(wininfo): when freeing windows, free the lowest priority wininfo
On master (and also before #31539) closing a window could cause the
used wininfo for a buffer to change. This is due to always removing the
previous NULL wininfo when deleting a window, even if that wininfo had
higher priority than the the deleted window's own wininfo.

Instead delete the wininfo with lowest priority. This retains the memory
saving efect while not affecting the effective value of window options
and so on.
2025-01-14 14:47:35 +01:00
bfredl
7eabc8899a
Merge pull request #31932 from bfredl/termtab
fix(getchar): do not simplify keycodes in terminal mode
2025-01-14 14:46:34 +01:00
luukvbaal
25d8c3a5ad
feat(api): nvim_open_win() relative to tabline and laststatus #32006
Problem:  Anchoring a floating window to the tabline and laststatus is
          cumbersome; requiring autocommands and looping over all
          windows/tabpages.
Solution: Add new "tabline" and "laststatus" options to the `relative`
          field of nvim_open_win() to place a window relative to.
2025-01-14 05:02:46 -08:00
Christian Clason
e8ddb7a469 vim-patch:30377e0: runtime(lyrics): support milliseconds in syntax script
The following tool creates LRC files using three fractional digits after
the seconds (i.e. milliseconds).

References:
https://github.com/magic-akari/lrc-maker
https://lrc-maker.github.io/

closes: vim/vim#16436

30377e0fe0

Co-authored-by: Denilson Sá Maia <denilsonsa@gmail.com>
2025-01-14 13:23:02 +01:00
zeertzjq
69ad6b12ec
vim-patch:9.1.1010: filetype: VisualCode setting file not recognized (#32003)
Problem:  filetype: VisualCode setting file not recognized
Solution: detect json files in VSCode config directory as jsonc filetype
          (Konfekt)

closes: vim/vim#16400

c200f53cbb

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-01-14 18:55:06 +08:00
Famiu Haque
c5f93d7ab0 refactor(options): remove code for multitype options
Problem: It was decided on Matrix chat that multitype options won't be necessary for Neovim options, and that options should only have a single canonical type. Therefore the code for supporting multitype options is unnecessary.

Solution: Remove the additional code that's used to provide multitype option support.
2025-01-14 09:34:17 +00:00
Riley Bruins
b192d58284 perf(treesitter): calculate folds asynchronously
**Problem:** The treesitter `foldexpr` runs synchronous parses to
calculate fold levels, which eliminates async parsing performance in the
highlighter.

**Solution:** Migrate the `foldexpr` to also calculate and apply fold
levels asynchronously.
2025-01-14 09:30:43 +00:00
Horror Proton
5a54681025 fix(treesitter): uv_dlclose after uv_dlerror 2025-01-14 09:15:35 +00:00
Christian Clason
0dfa4de993 build(deps): bump luajit to HEAD - a4f56a459 2025-01-14 09:00:50 +01:00
Xuyuan Pang
a4f575abd8
fix(lsp): minimum height for floating popup #31990
Problem:
The floating window for hover and signature help always cuts off a few lines,
because the `_make_floating_popup_size` function counts empty lines as having
zero height.

Solution:
Ensure the height is at least 1.
2025-01-13 15:17:23 -08:00
Lewis Russell
34e2185022 fix(options): better handling of empty values
Problem:

Whether an option is allowed to be empty isn't well defined and
isn't properly checked.

Solution:

- For non-list string options, explicitly check the option value
  if it is empty.
- Annotate non-list string options that can accept an empty value.
  - Adjust command completion to ignore the empty value.
- Render values in Lua meta files
2025-01-13 16:58:25 +00:00
luukvbaal
cb7b4e2962
feat(messages): "verbose" message kind #31991 2025-01-13 04:59:34 -08:00
dundargoc
47866cd8d2 refactor: delete duplicate utf8-functionality
Also remove British National Replacement Character Set.

We keep the DEC Special Graphics and ASCII despite it not being unicode
as some old software such as calcurse still rely on this functionality.

References:
- https://github.com/neovim/neovim/pull/31934#discussion_r1911046426
- https://en.wikipedia.org/wiki/DEC_Special_Graphics
- https://vt100.net/docs/vt220-rm/chapter2.html#S2.4.3
2025-01-13 13:16:41 +01:00