Commit Graph

8056 Commits

Author SHA1 Message Date
zeertzjq
17e00d0cc6
fix(startup): report --startuptime error to stderr (#31131)
Problem:  Crash when initializing for --startuptime errors.
Solution: Report the error to stderr, as neither logging nor messages
          have been initialized yet.
2024-11-13 13:22:40 +08:00
zeertzjq
1643c49514
vim-patch:9.1.0860: tests: mouse_shape tests use hard code sleep value (#31184)
Problem:  tests: mouse_shape tests use hard code sleep value
          (Bram Moolenaar)
Solution: Use WaitForAssert() instead (Yee Cheng Chin)

related: vim/vim#12157
closes: vim/vim#16042

24078e39cd

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2024-11-13 07:28:40 +08:00
Christian Clason
295f98c8e0 vim-patch:9.1.0853: filetype: kubernetes config file not recognized
Problem:  filetype: kubernetes config file not recognized
Solution: detect '/.kube/config' file as yaml filetype
          (Jonathan Lopez)

closes: vim/vim#11076

6fbf63de86

Co-authored-by: Jonathan Lopez <jonathanglopez@gmail.com>
2024-11-12 08:18:38 +01:00
bfredl
72a1df6065
Merge pull request #31137 from bfredl/hlagain
refactor(tests): use more global highlight definitions
2024-11-11 20:08:26 +01:00
Luuk van Baal
9fa3a0964e fix(messages): pass previous highlight id to ext chunks 2024-11-11 15:15:33 +01:00
bfredl
29fd5ed606 refactor(tests): use more global highlight definitions 2024-11-11 14:27:25 +01:00
bfredl
d0e78b5871
Merge pull request #27813 from luukvbaal/msgid
feat(ext_messages): add hl_id to ext_messages chunks
2024-11-11 12:26:35 +01:00
zeertzjq
adbffff5d0
vim-patch:9.1.0849: there are a few typos in the source (#31159)
Problem:  there are a few typos in the source.
Solution: Correct typos (zeertzjq).

closes: vim/vim#16026

7c5152826f
2024-11-11 08:20:41 +08:00
Luuk van Baal
4f9260d06a feat(ext_messages): add hl_id to ext_messages chunks
Problem:  Ext_messages chunks only contain the highlight attr id, which
          is not very useful for vim.ui_attach() consumers.
Solotion: Add highlight group id to message chunks, which can easily be
          used to highlight text in the TUI through nvim_buf_set_extmark():
          hl_group = synIDattr(id, "name").
2024-11-09 14:28:17 +01:00
bfredl
dd4c828c86
Merge pull request #31118 from bfredl/merehl
refactor(tests): continue the global highlight definition work
2024-11-09 13:48:45 +01:00
dundargoc
5a27d02584
docs: misc (#30914)
Co-authored-by: Ernie Rael <errael@raelity.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Jade <spacey-sooty@proton.me>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-09 08:10:56 +08:00
Lewis Russell
ad3472e291 fix(vim.system): resolve executable paths on windows
Fixes #31107
2024-11-08 16:29:44 +00:00
Luuk van Baal
5cfa7a72f8 refactor(message): propagate highlight id instead of attrs
Problem:  Highlight group id is not propagated to the end of the message call
          stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
          instead of attr id.
2024-11-08 13:21:35 +01:00
bfredl
abe6a07c54 refactor(tests): continue the global highlight definition work 2024-11-08 13:19:15 +01:00
bfredl
092042b43d fix(cmdline): simplify and correct grapheme cluster adjustment 2024-11-08 11:25:34 +01:00
bfredl
8ab1903092
Merge pull request #31040 from luukvbaal/cmdpreviewcurs
fix(inccommand): ensure cursor is where it belongs
2024-11-08 11:22:14 +01:00
Luuk van Baal
59e130b6ca fix(inccommand): ensure cursor is where it belongs
Problem:  Inccommand preview callback may flush inaccurate cmdline cursor position.
Solution: Ensure cursor is where it belongs when doing command preview.
2024-11-07 13:12:30 +01:00
zeertzjq
5a86360400
test: add test for key following ignored mouse move (#31104) 2024-11-07 17:53:30 +08:00
errael
000129201c
perf(mouse): only generate <MouseMove> for a new cell positon (#31103)
Problem: Can receive dozens of <MouseMove> events for same cell position. #30965
Solution: Leverage check_multiclick() to detect if cell position is unchanged.
2024-11-07 16:21:28 +08:00
Lewis Russell
f7e32fb6e6 fix(test): better management of tmpfiles
Problem:

When tmpdir is local. The returned values from tmpname may already
exist. This can cause problems for tests which pass `create=false` as
they may require the file to not exist yet.

Solution:

When creating tmp names, always remove it to ensure it doesn't exist,
and optionally open it if `create~=false`

Additionally refactor the tmpname code and flattrn some functions into
constants.

Also while debugging this issue. It was discovered that `exec_lua()`
doesn't report error messages properly. This has been fixed.
2024-11-06 11:37:33 +00:00
Christian Clason
ba40a6dbe3 vim-patch:9.1.0839: filetype: leo files are not recognized
Problem:  filetype: leo files are not recognized
Solution: detect '*.leo' files as leo filetype, include
          a filetype plugin (Riley Bruins)

References:
https://github.com/ProvableHQ/leo

closes: vim/vim#15988

93f65a4ab8

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-05 08:31:45 +01:00
Christian Clason
65b9499e4a vim-patch:9.1.0840: filetype: idris2 files are not recognized
Problem:  filetype: idris2 files are not recognized
Solution: detect '*.idr' files as idris2, '*.lidr' files as lidris2
          and '*.ipkg' files as ipkg filetype (Serhii Khoma)

closes: vim/vim#15987

c04bc64ba6

Co-authored-by: Serhii Khoma <srghma@gmail.com>
2024-11-05 08:31:32 +01:00
zeertzjq
f5b84c1a44
vim-patch:9.1.0841: tests: still preferring python2 over python3 (#31083)
Problem:  tests: still preferring python2 over python3
Solution: prefer Python 3 when picking a Python program in Vim tests,
          by checking for the more specific python version first and
          only when python3 not found, check for the python binary
          (Yee Cheng Chin)

Most OSes have Python 3 mapped to `python3` instead of `python`. Vim
tests should prioritize using that instead of Python 2 in case that is
still installed on the host system.

closes: vim/vim#15986

cef8ab2c75

Cherry-pick test changes from patch 8.2.{2824,4684}.

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2024-11-04 23:26:33 +00:00
Yochem van Rosmalen
079e5f4f9b
feat(defaults): unimpaired empty line below/above cursor #30984 2024-11-04 06:06:18 -08:00
Famiu Haque
a27419f3fc
feat(options)!: disallow setting hidden options #28400
Problem:
There are three different ways of marking an option as hidden, `enable_if
= false`, `hidden = true` and `immutable = true`. These also have different
behaviors. Options hidden with `enable_if = false` can't have their value
fetched using Vim script or the API, but options hidden with `hidden = true` or
`immutable = true` can. On the other hand, options with `hidden = true` do not
error when trying to set their value, but options with `immutable = true` do.

Solution:
Remove `enable_if = false`, remove the `hidden` property for options, and use
`immutable = true` to mark an option as hidden instead. Also make hidden option
variable pointers always point to the default value, which allows fetching the
value of every hidden option using Vim script and the API. This does also mean
that trying to set a hidden option will now give an error instead of just being
ignored.
2024-11-04 05:00:12 -08:00
bfredl
23290e7676 feat(editor): handle new multibyte sequences in normal mode replacement
while the implementation is not tied to screen chars, it is a reasonable
expectation to support the same size. If nvim is able to display a
multibyte character, it will accept the same character as input,
including in normal mode commands like r{char}
2024-11-04 13:12:33 +01:00
zeertzjq
fe565ca382 vim-patch:9.1.0835: :setglobal doesn't work properly for 'ffu' and 'tsrfu'
Problem:  :setglobal doesn't work properly for 'ffu' and 'tsrfu' when
          the local value is set (after v9.1.0831)
Solution: Check os_flags instead of buffer option variable (zeertzjq).

closes: vim/vim#15980

6eda269600
2024-11-03 17:04:34 +08:00
zeertzjq
981fa11c91 vim-patch:9.1.0832: :set doesn't work for 'cot' and 'bkc' after :setlocal
Problem:  :set doesn't work for 'cot' and 'bkc' after :setlocal.
Solution: clear the local flags when using :set (zeertzjq).

closes: vim/vim#15981

46dcd84d24
2024-11-03 16:58:22 +08:00
zeertzjq
3075c69ff0
vim-patch:9.1.0831: 'findexpr' can't be used as lambad or Funcref (#31058)
Problem:  'findexpr' can't be used for lambads
          (Justin Keyes)
Solution: Replace the findexpr option with the findfunc option
          (Yegappan Lakshmanan)

related: vim/vim#15905
closes: vim/vim#15976

a13f3a4f5d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-03 10:06:41 +08:00
zeertzjq
ed3fb1bb9a
vim-patch:9.1.0830: using wrong highlight group for spaces for popupmenu (#31054)
Problem:  using wrong highlight group for spaces for popupmenu
Solution: use original attribute instead of combined attributed
          (glepnir)

closes: vim/vim#15978

bc10be7a40

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-03 08:27:15 +08:00
Christian Clason
db46b58569 vim-patch:9.1.0826: filetype: sway files are not recognized
Problem:  filetype: sway files are not recognized
Solution: detect '*.sw' files as sway filetype, include
          a filetype plugin (Riley Bruins)

References:
 https://github.com/FuelLabs/sway.

Comments taken from their syntax documentation. File extension taken
from the same documentation/GitHub's own recognition of these file types

closes: vim/vim#15973

84b5b1c660

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-02 23:33:38 +01:00
zeertzjq
3688a33354
fix(lua): show stacktrace for error in vim.on_key() callback (#31021) 2024-11-02 10:11:06 +08:00
Lewis Russell
9b357e30fd feat(lsp)!: remove client-server handlers from vim.lsp.handlers
- Partition the handlers in vim.lsp.handlers as:
  - client to server response handlers (RCS)
  - server to client request handlers (RSC)
  - server to client notification handlers (NSC)

  Note use string indexes instead of protocol.methods for improved
  typing in LuaLS (tip: use hover on RCS, RSC or NSC).
2024-11-01 09:17:39 +00:00
errael
b34e137e43
feat(lua): allow vim.on_key() callback to consume the key (#30939) 2024-11-01 09:11:15 +08:00
Christian Clason
82e5066a7f vim-patch:9.1.0823: filetype: Zephyr overlay files not recognized
Problem:  filetype: Zephyr overlay files not recognized
Solution: detect '*.overlay' files as dts filetype,
          include syntax tests for DTS files
          (Xudong Zheng)

Reference:
https://docs.zephyrproject.org/latest/build/dts/howtos.html

closes: vim/vim#15963

a68bd6f089

Co-authored-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2024-10-31 10:24:37 +01:00
zeertzjq
8df6822507
test: fix files being left behind (#31004) 2024-10-31 00:04:51 +00:00
zeertzjq
05d9e6a9e8
vim-patch:9.1.0822: topline might be changed in diff mode unexpectedly (#30988)
Problem:  topline might be changed in diff mode unexpectedly
          (Jaehwang Jung)
Solution: do not re-calculate topline, when using line() func
          in diff mode.

fixes: vim/vim#15812
closes: vim/vim#15950

05a40e07c2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-30 09:05:11 +08:00
Gregory Anders
ff93cccbc1
fix(defaults): omit extraneous info from unimpaired mapping errors (#30983) 2024-10-29 10:06:14 -05:00
zeertzjq
4a4b52dca4
vim-patch:9.1.0820: tests: Mac OS tests are too flaky (#30980)
Problem:  tests: Mac OS tests are too flaky
Solution: Increase max test timeout to 25 minutes,
          allow up to 10 retries on Mac OS runners,
          refactor runtest.vim (Milly).

closes: vim/vim#15940

baab7c0865

Co-authored-by: Milly <milly.ca@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2024-10-29 09:08:05 +08:00
zeertzjq
60b3ccd850 vim-patch:9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline argument
Problem:  'findexpr' completion doesn't set v:fname to cmdline argument.
Solution: Set v:fname to the cmdline argument as-is (zeertzjq).

closes: vim/vim#15934

20e045f781
2024-10-29 08:20:00 +08:00
zeertzjq
6b8c3d146e vim-patch:9.1.0811: :find expansion does not consider 'findexpr'
Problem:  :find expansion does not consider 'findexpr'
Solution: Support expanding :find command argument using 'findexpr'
          (Yegappan Lakshmanan)

closes: vim/vim#15929

2f6efaccfd

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-29 08:20:00 +08:00
zeertzjq
378d9135e7 vim-patch:9.1.0810: cannot easily adjust the |:find| command
Problem:  cannot easily adjust the |:find| command
Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan)

closes: vim/vim#15901
closes: vim/vim#15905

aeb1c97db5

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-29 08:20:00 +08:00
zeertzjq
ff29fd8c6e
test(pum): add test for item selection with 'rightleft' (#30968) 2024-10-28 17:20:00 +08:00
zeertzjq
d24fb72c33
fix(pum): don't select item when clicking to the left/right (#30967)
Problem:  Selecting an item in the right-click menu when clicking to the
          left/right of it is confusing, especially in a UI that doesn't
          support 'mousemoveevent'.
Solution: Don't select an item when clicking to the left/right of the
          right-click menu.
2024-10-28 14:29:59 +08:00
Donatas
a9e725b26e
feat(diagnostics)!: sort underline severity_sort (#30898)
feat(diagnostics)!: sort underline with severity_sort

BREAKING CHANGE: underline will be applied with a higher value than `vim.hl.priorities.diagnostics`
2024-10-27 11:36:39 -05:00
Tristan Knight
25b53b593e
refactor(lsp): drop str_byteindex/str_utfindex wrappers #30915
* deprecate old signatures
* move to new str_byteindex/str_utfindex signature
* use single-underscore name (double-underscore is reserved for Lua itself)
2024-10-26 07:38:25 -07:00
Famiu Haque
b922b7d6d7
refactor(options)!: use OptVal for option defaults #26691
Problem: We use `void *` for option default values, which is confusing and can cause problems with type-correctness. It also doesn't accomodate for multitype options. On top of that, it also leads to default boolean option values not behaving correctly on big endian systems.

Solution: Use `OptVal` for option default values.

BREAKING CHANGE:
- `:set {option}<` removes the local value for all global-local options instead of just string global-local options.
- `:setlocal {option}<` copies the global value to the local value for number and boolean global-local options instead of removing the local value.
2024-10-25 07:10:40 -07:00
zeertzjq
e4a74e986c
vim-patch:9.1.0814: mapset() may remove unrelated mapping (#30941)
Problem:  mapset() may remove unrelated mapping whose {rhs} matches the
          restored mapping's {lhs}.
Solution: only match by {lhs} when unmapping for mapset() (zeertzjq).

closes: vim/vim#15935

fdf135a052
2024-10-24 23:16:54 +00:00
Mathias Fussenegger
3c51058d76 fix(lsp): set tagstack on jump via goto methods
Follow up to https://github.com/neovim/neovim/pull/30877
Fixes https://github.com/neovim/neovim/issues/30926
2024-10-24 13:43:49 +02:00
zeertzjq
50e63c8171
fix(options): missing error check for global 'scl' and 'winhl' (#30919) 2024-10-24 10:03:38 +08:00
zeertzjq
fffcb88ad6
test(012_directory_spec): fix flakiness on Windows (#30920)
Problem:  012_directory_spec is flaky on Windows.
Solution: Use :%bwipe! instead :qall!.
2024-10-24 10:03:23 +08:00
zeertzjq
19204ebde9 test(old): remove unnecessary :setglobal skips 2024-10-24 06:56:12 +08:00
zeertzjq
6b63fe798b vim-patch:9.1.0806: tests: no error check when setting global 'briopt'
Problem:  tests: no error check when setting global 'briopt'
Solution: also parse and check global 'briopt' value (Milly)

closes: vim/vim#15911

b38700ac81

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:12 +08:00
zeertzjq
5436d9b3c6 vim-patch:9.1.0804: tests: no error check when setting global 'cc'
Problem:  tests: no error check when setting global 'cc'
Solution: also parse and check global 'cc' value (Milly)

closes: vim/vim#15914

a441a3eaab

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:12 +08:00
zeertzjq
3d2aca83de vim-patch:9.1.0803: tests: no error check when setting global 'isk'
Problem:  tests: no error check when setting global 'isk'
Solution: also parse and check global 'isk' value (Milly)

closes: vim/vim#15915

5e7a6a4a10

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:12 +08:00
zeertzjq
6d2cf5ad31 vim-patch:9.1.0802: tests: no error check when setting global 'fdm' to empty value
Problem:  tests: no error check when setting global 'fdm' to empty value
Solution: Also check global 'fdm' value for being empty (Milly).

closes: vim/vim#15916

142cad1f88

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:11 +08:00
Tristan Knight
230b0c7f02
feat(stdlib): overload vim.str_byteindex, vim.str_utfindex #30735
PROBLEM:
There are several limitations to vim.str_byteindex, vim.str_utfindex:
1. They throw given out-of-range indexes. An invalid (often user/lsp-provided)
   index doesn't feel exceptional and should be handled by the caller.
   `:help dev-error-patterns` suggests that `retval, errmsg` is the preferred
   way to handle this kind of failure.
2. They cannot accept an encoding. So LSP needs wrapper functions. #25272
3. The current signatures are not extensible.
    * Calling: The function currently uses a fairly opaque boolean value to
      indicate to identify the encoding.
    * Returns: The fact it can throw requires wrapping in pcall.
4. The current name doesn't follow suggestions in `:h dev-naming` and I think
   `get` would be suitable.

SOLUTION:
- Because these are performance-sensitive, don't introduce `opts`.
- Introduce an "overload" that accepts `encoding:string` and
  `strict_indexing:bool` params.

```lua
local col = vim.str_utfindex(line, encoding, [index, [no_out_of_range]])
```

Support the old versions by dispatching on the type of argument 2, and
deprecate that form.

```lua
vim.str_utfindex(line)                             -- (utf-32 length, utf-16 length), deprecated
vim.str_utfindex(line, index)                      -- (utf-32 index, utf-16 index), deprecated
vim.str_utfindex(line, 'utf-16')                   -- utf-16 length
vim.str_utfindex(line, 'utf-16', index)            -- utf-16 index
vim.str_utfindex(line, 'utf-16', math.huge)        -- error: index out of range
vim.str_utfindex(line, 'utf-16', math.huge, false) -- utf-16 length
```
2024-10-23 06:33:57 -07:00
Christian Clason
02749de7d5 vim-patch:9.1.0809: filetype: petalinux config files not recognized
Problem:  filetype: petalinux config files not recognized
Solution: detect 'project-spec/*.conf' files as bitbake filetype
          (Wu, Zhenyu)

References:
https://www.amd.com/en/products/software/adaptive-socs-and-fpgas/embedded-software/petalinux-sdk.html

closes: vim/vim#15926

626b6ab486

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-23 10:00:52 +02:00
zeertzjq
da45827787 vim-patch:9.1.0805: tests: minor issues in gen_opt_test.vim
Problem:  tests: minor issues in gen_opt_test.vim
Solution: fix restore value for 'undolevels', fix comment, fix
          wrong cpo value, add equality test for global-local options on
          switchback (Milly).

closes: vim/vim#15913

231480f975

Cherry-pick gen_opt_test.vim change from patch 9.1.0807.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-23 07:38:11 +08:00
zeertzjq
c1330816dc vim-patch:9.1.0799: tests: gettwinvar()/gettabwinvar() tests are not comprehensive
Problem:  tests: gettwinvar()/gettabwinvar() tests are not comprehensive
Solution: Add more tests (Milly)

closes: vim/vim#15920

ceec8640df

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-23 07:38:10 +08:00
dundargoc
4c25e60767 test: port libvterm unit test to neovim test suite
These were imported from the v0.3.3 git tag
https://github.com/neovim/libvterm/tree/v0.3.3 and not the latest
commit. This is for compatibility reasons as the libvterm code was
imported from v0.3.3.
2024-10-22 21:20:11 +02:00
zeertzjq
8c532a9ea8
fix(options): fix 'winhl' still accepting invalid value (#30896) 2024-10-22 08:10:15 +00:00
Christian Clason
a6d1165771 vim-patch:9.1.0796: filetype: libtool files are not recognized
Problem:  filetype: libtool files are not recognized
Solution: detect '*.{lo,la,lai}' as sh filetype
          (Wu, Zhenyu)

closes: vim/vim#15751

bfe568d8c4

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-22 08:55:39 +02:00
Christian Clason
b7779aad41 vim-patch:9.1.0795: filetype: Vivado memory info file are not recognized
Problem:  filetype: Vivado memory info file are not recognized
Solution: detect '*.mmi' memory info file as xml filetype
          (Wu, Zhenyu)

References: https://docs.amd.com/r/en-US/ug1580-updatemem/MMI-File-Syntax

closes: vim/vim#15906

0887e62bce

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-22 08:55:39 +02:00
zeertzjq
1b9dafa67b
fix(options): fix :setglobal not working for 'spelloptions' (#30894) 2024-10-22 11:34:09 +08:00
zeertzjq
f663243e95
vim-patch:9.1.0797: testing of options can be further improved (#30893)
Problem:  testing of options can be further improved
Solution: split the generated option test into test_options_all.vim,
          add more test cases, save and restore values, fix use-after-free

closes: vim/vim#15894

6eca04e9f1

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-22 09:05:14 +08:00
Lewis Russell
3572319b4c feat(vim.validate): improve fast form and deprecate spec form
Problem:

`vim.validate()` takes two forms when it only needs one.

Solution:

- Teach the fast form all the features of the spec form.
- Deprecate the spec form.
- General optimizations for both forms.
- Add a `message` argument which can be used alongside or in place
  of the `optional` argument.
2024-10-21 11:32:06 +01:00
Christian Clason
6fd13eedda test(rpc): retry flaky 'vim.rpcrequest and vim.rpcnotify' test
Problem: 'vim.rpcrequest and vim.rpcnotify' is flaky on Windows.

Solution: retry it.
2024-10-21 11:24:34 +02:00
Justin M. Keyes
18b43c331d refactor: rename vim.highlight => vim.hl
Problem:
- `vim.highlight` module does not follow `:help dev-name-common`, which
  documents the name for "highlight" as "hl".
- Shorter names are usually preferred.

Solution:
Rename `vim.highlight` to `vim.hl`.

This is not a breaking change until 2.0 (or maybe never).
2024-10-21 00:54:43 +02:00
Justin M. Keyes
960fdc775a fix(lua): vim.deprecate does not support major>0 2024-10-21 00:54:42 +02:00
Mathias Fußenegger
0083e03d6f
feat(lsp)!: support multiple clients in goto methods (#30877)
Relates to:

- https://github.com/neovim/neovim/issues/30034
- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/16363

Closes:

- https://github.com/neovim/neovim/issues/26936 (but only provides bufnr
  and method)
- https://github.com/neovim/neovim/issues/22318

Might fix: https://github.com/neovim/neovim/issues/30737
2024-10-20 23:40:44 +02:00
zeertzjq
9b8907d905
feat(float): allow enabling mouse for non-focusable window (#30844)
Problem:  Cannot allow mouse interaction for non-focusable float window.
Solution: Add a "mouse" field to float window config.
2024-10-20 22:18:26 +08:00
zeertzjq
ce9a9b4700
vim-patch:9.1.0794: tests: tests may fail on Windows environment (#30874)
Problem:  tests: tests may fail on Windows environment
Solution: use shellcmdflag=/D to skip executing autorun from
          the registry (Milly)

closes: vim/vim#15900

4f5681dbdf

Cherry-pick Test_cursorhold_insert_with_timer_interrupt() change from
patch 8.2.1836.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-20 18:02:05 +08:00
zeertzjq
ed794c9a10
vim-patch:9.1.0792: tests: Test_set_values() is not comprehensive enough (#30870)
Problem:  tests: Test_set_values() is not comprehensive enough
Solution: Add a lot more test cases (Milly)

closes: vim/vim#15892

cc15bbcbc4

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-20 08:18:38 +08:00
zeertzjq
3cf602486c
feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859)
vim-patch:8.2.4744: a terminal window can't use the bell
vim-patch:8.2.4745: using wrong flag for using bell in the terminal

BREAKING CHANGE: Bells from :terminal are now silent by default, unless
'belloff' option doesn't contain "term" or "all".
2024-10-20 07:59:43 +08:00
zeertzjq
395f420fc6
fix(options): fix some 'belloff' flags not working properly (#30856)
Problem:  Some 'belloff' flags don't work properly.
Solution: Keep BO_ flags and p_bo_values[] in sync.
2024-10-18 14:39:27 +00:00
zeertzjq
b5e69b32d7
vim-patch: make gen_opt_test.vim work with Nvim (#30850)
Problem:  Insufficient test coverage for validation of option values.
Solution: Port Vim's gen_opt_test.vim and make it work with Nvim.

vim-patch:9.1.0760: tests: no error reported, if gen_opt_test.vim fails
vim-patch:9.1.0791: tests: errors in gen_opt_test.vim are not shown
2024-10-18 17:38:29 +08:00
Uthman Mohamed
f4b620c4e6
feat(vim.ui.open): support lemonade #30845 2024-10-18 02:22:15 -07:00
Lewis Russell
fa6ab0d909
Merge pull request #30825 from lewis6991/refactor/lsputil 2024-10-17 13:35:02 +01:00
Lewis Russell
acbc6a7f91 fix(lsp.util): inconsistent handling of offset_encoding 2024-10-17 12:52:45 +01:00
Lewis Russell
f0973d4227 feat(lsp.util): refactor symbols_to_items()
- Remove the trivial function vim.lsp.util._get_symbol_kind_name()
  and its tests.
2024-10-17 12:52:45 +01:00
zeertzjq
852954ff6d
vim-patch:9.1.0789: tests: ':resize + 5' has invalid space after '+' (#30835)
Problem:  tests: ':resize + 5' has invalid space after '+'
Solution: Correct the test (Milly)

closes: vim/vim#15884

c0cba184f5

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-17 07:28:25 +08:00
zeertzjq
f72dc2b4c8
vim-patch:9.1.0786: tests: quickfix update test does not test location list (#30828)
Problem:  tests: quickfix update test does not test location list
          (after: v9.1.0.785)
Solution: update Test_quickfix_buffer_contents to test with location
          lists (Yegappan Lakshmanan)

closes: vim/vim#15879

6a1deaf5ad

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-16 08:01:08 +08:00
zeertzjq
84623dbe93
vim-patch:9.1.0785: cannot preserve error position when setting quickfix list (#30820)
Problem:  cannot preserve error position when setting quickfix lists
Solution: Add the 'u' action for setqflist()/setloclist() and try
          to keep the closes target position (Jeremy Fleischman)

fixes: vim/vim#15839
closes: vim/vim#15841

27fbf6e5e8

Co-authored-by: Jeremy Fleischman <jeremyfleischman@gmail.com>
2024-10-15 18:53:59 +08:00
Maria José Solano
e0a5c3bb58
fix(lsp): handle multiline signature help labels #30460 2024-10-15 02:36:04 -07:00
Christian Clason
74a1614772 vim-patch:9.1.0782: tests: using wrong neomuttlog file name
Problem:  tests: using wrong neomuttlog file name
Solution: use correct file name

related: vim/vim#15858

0c59c30271

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-15 08:32:29 +02:00
zeertzjq
f25ebc2290
vim-patch:9.1.0783: 'spell' option setting has problems (#30818)
Problem:  'spell' option setting has problems
Solution: correctly check for comma for 'spellfile' option,
          remove unnecessary checks, refactor slightly (Milly)

closes: vim/vim#15873

322ad0c953

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-15 09:40:54 +08:00
zeertzjq
4846bf05dc
fix(tui): avoid flushing buffer halfway an OSC 2 sequence (#30793)
Problem:  Setting title while TUI buffer is almost full may cause the
          end of a flush to be treated as a part of an OSC 2 or OSC 0
          sequence, leading to problems like invisible cursor.
Solution: Make the whole sequence to set title a unibi_ext string.
2024-10-15 07:34:13 +08:00
Christian Clason
b7e8966715 vim-patch:9.1.0781: tests: test_filetype fails
Problem:  tests: test_filetype fails (clason)
          (after v9.1.0779)
Solution: Use correct filename for neomuttlog filetype

related: vim/vim#15845

7d755d8ef3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-14 09:31:24 +02:00
Christian Clason
d04d7bf65d vim-patch:9.1.0779: filetype: neomuttlog files are not recognized
Problem:  filetype: neomuttlog files are not recognized
Solution: detect '*.neomuttdebug' file as neomuttlog filetype,
          include neomuttlog syntax script (Richard Russon)

closes: vim/vim#15858

a2aa921f76

Co-authored-by: Richard Russon <rich@flatcap.org>
Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-10-14 09:31:24 +02:00
Christian Clason
15aa27bc1f vim-patch:9.1.0778: filetype: lf config files are not recognized
Problem:  filetype: lf config files are not recognized
Solution: detect lfrc files as lf filetype, include a syntax
          script for lf files (Andis Spriņķis).

References:
- https://github.com/gokcehan/lf

closes: vim/vim#15859

0f146b7925

Co-authored-by: Andis Spriņķis <spr.andis@protonmail.com>
2024-10-14 08:27:37 +02:00
zeertzjq
1189c5ce59
test(tui_spec): use Unicode in cursor_address test (#30807)
Now that #16425 is fixed, use Unicode again to reduce screen height.
Unfortunately composing chars still can't be used, as it turns out that
composing chars may be missing when sent separately from the base char
at the last char a screen line.
2024-10-14 06:10:14 +00:00
zeertzjq
a6d5e6b105
vim-patch:a420547: runtime(misc): Use consistent "Vim script" spelling (#30805)
References: https://groups.google.com/g/vim_dev/c/3Z5yM8KER2w/m/wAqws0QSEAAJ

closes: vim/vim#15863

a4205471ad

Co-authored-by: h-east <h.east.727@gmail.com>
2024-10-14 09:27:29 +08:00
zeertzjq
73309048cf vim-patch:8.2.0986: MS-Windows: functions test fails
Problem:    MS-Windows: functions test fails.
Solution:   Only simplify ///path on Unix.

c70222d12a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-10-13 18:52:46 +08:00
zeertzjq
8c8c6fb05a vim-patch:8.2.0985: simplify() does not remove slashes from "///path"
Problem:    Simplify() does not remove slashes from "///path".
Solution:   Reduce > 2 slashes to one. (closes vim/vim#6263)

fdcbe3c3fe

Omit Test_readdirex() change: changed again in patch 9.0.0323.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-10-13 18:52:46 +08:00
zeertzjq
fb74fd2954
test(autocmd/termxx_spec): properly setup TextChangedT tests (#30787) 2024-10-13 11:02:28 +08:00
zeertzjq
b56aa80a26
vim-patch:9.1.0775: tests: not enough tests for setting options (#30785)
Problem:  tests: not enough tests for setting options
Solution: Add more comprehensive tests to test_options (Milly).

closes: vim/vim#15856

484facebe4

Restore behavior of &l:option for unset local boolean options that was
accidentally changed in #26429.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-13 08:09:53 +08:00
Christian Clason
06625f9b3a vim-patch:9.1.0777: filetype: Some upstream php files are not recognized
Problem:  filetype: Some upstream php files are not recognized
Solution: Detect more config files from the PHP source
          distribution as filetype ini (nisbet-hubbard).

closes: vim/vim#15840

367499c5c3

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-10-13 00:46:29 +02:00
zeertzjq
b0ddc1783a
vim-patch:9.1.0776: test_strftime may fail because of missing TZ data (#30780)
Problem:  test_strftime may fail because of missing TZ data
Solution: Use GMT offsets to validate timezone differences (James McCoy)

Some systems only provide timezones that follow the geographical region
naming (e.g. America/New_York) by default and require an additional
install for other names (like EST).

The GMT+<offset> format must always be honored, so use that to generate
distinct data for the test.

closes: vim/vim#15848

ea997edc7a

Co-authored-by: James McCoy <jamessan@jamessan.com>
2024-10-13 06:30:20 +08:00
Riley Bruins
e049c6e4c0
feat(ui): statusline text inherits highlights #29976
Changes apply to the winbar, statusline, and tabline text.
2024-10-12 10:57:31 -07:00
Riley Bruins
4b90952851 fix(treesitter): mark supertype nodes as named
**Problem:** Tree-sitter 0.24.0 introduced a new symbol type to denote
supertype nodes (`TSSymbolTypeSupertype`). Now, `language.inspect()`
(and the query `omnifunc`) return supertype symbols, but with double
quotes around them.

**Solution:** Mark a symbol as "named" based on it *not* being an
anonymous node, rather than checking that it is a regular node (which a
supertype also is not).
2024-10-12 09:59:44 +02:00
zeertzjq
0e42c81c7f
fix(lua): avoid recursive vim.on_key() callback (#30753) 2024-10-12 08:07:05 +08:00
bfredl
486076a0e1 fix(build): remove USE_FNAME_CASE, redundant with CASE_INSENSITIVE_FILENAME
It stands to reason, you need to "fix" case-insensitive filenames
if-and-only-if you have case-insensitive filenames.
2024-10-11 20:26:54 +02:00
Riley Bruins
d3193afc25 fix(treesitter): remove duplicate symbol names in language.inspect()
**Problems:**

- `vim.treesitter.language.inspect()` returns duplicate
  symbol names, sometimes up to 6 of one kind in the case of `markdown`
- The list-like `symbols` table can have holes and is thus not even a
  valid msgpack table anyway, mentioned in a test

**Solution:** Return symbols as a map, rather than a list, where field
names are the names of the symbol. The boolean value associated with the
field encodes whether or not the symbol is named.

Note that anonymous nodes are surrounded with double quotes (`"`) to
prevent potential collisions with named counterparts that have the same
identifier.
2024-10-11 18:15:07 +02:00
Riley Bruins
267c7525f7 feat(treesitter): introduce child_with_descendant()
This commit also marks `child_containing_descendant()` as deprecated
(per upstream's documentation), and uses `child_with_descendant()` in
its place. Minimum required tree-sitter version will now be `0.24`.
2024-10-11 17:29:45 +02:00
zeertzjq
c4762b3097
test(tui_spec): use child_exec_lua() more (#30757)
It is more readable.
2024-10-11 08:23:14 +00:00
Christian Clason
79c036747a vim-patch:9.1.0773: filetype: some Apache files are not recognized
Problem:  filetype: some Apache files are not recognized
Solution: Detect more config files from the Apache source
          distribution as filetype apache (nisbet-hubbard)

closes: vim/vim#15810

e58e9015cc

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-10-11 08:59:37 +02:00
Riley Bruins
a0e3fe5741
feat(ui): cascading style inheritance for Pmenu* highlights #29980
- `PmenuSel` and `PmenuMatch` inherit from `Pmenu`
- `PmenuMatchSel` inherits from both `PmenuSel` and `PmenuMatch`
2024-10-10 23:26:25 -07:00
zeertzjq
25665b365c
test(tui_spec): better prevent race between paste and input (#30751)
Problem:
Using a single RPC request to child server isn't enough to prevent race
between nvim_paste and nvim_input.

Solution:
Ensure both child client and child server have processed pending events
by sending an empty DCS response to the child client and waiting for
TermResponse autocommand on the child server.
2024-10-11 09:45:44 +08:00
zeertzjq
6f1601a1b9
vim-patch:9.1.0774: "shellcmdline" doesn't work with getcompletion() (#30750)
Problem:  "shellcmdline" doesn't work with getcompletion().
Solution: Use set_context_for_wildcard_arg() (zeertzjq).

closes: vim/vim#15834

85f36d61e0
2024-10-10 22:48:45 +00:00
Tomasz N
b3109084c2
fix(lsp): fix cursor position after snippet expansion (#30659)
Problem: on `CompleteDone` cursor can jump to the end of line instead of
the end of the completed word.

Solution: remove only inserted word for snippet expansion instead of everything
until eol.

Fixes #30656

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-10-10 11:40:03 +02:00
zeertzjq
8450752f46 vim-patch:9.1.0771: completion attribute hl_group is confusing
Problem:  Currently completion attribute hl_group is combined with
          all items, which is redundant and confusing with kind_hlgroup
Solution: Renamed to abbr_hlgroup and combine it only with the abbr item
          (glepnir).

closes: vim/vim#15818

0fe17f8ffb

Co-authored-by: glepnir <glephunter@gmail.com>
2024-10-10 07:21:02 +08:00
Christian Clason
0264870c0a vim-patch:9.1.0769: filetype: MLIR files are not recognized
Problem:  filetype: MLIR files are not recognized
Solution: Detect '*.mlir' files as mlir filetype,
          include a mlir filetype plugin
          (Wu, Zhenyu)

closes: vim/vim#15826

347d43bd33

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-09 10:10:39 +02:00
zeertzjq
f449a38f6a
vim-patch:9.1.0770: current command line completion is a bit limited (#30728)
Problem:  current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
          function (Ruslan Russkikh).

closes: vim/vim#15823

0407d621bb

Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
2024-10-09 08:14:18 +08:00
zeertzjq
e98b1b0235
vim-patch:9.1.0767: A condition is always true in ex_getln.c (#30726)
Problem:  A cmdlen == 0 condition is always true as ccline.cmdlen == 0
          was already checked above (after v9.1.0766).
Solution: Remove the condition and the variable.
          (zeertzjq)

closes: vim/vim#15830

c9aa6e4f2a
2024-10-08 23:16:43 +00:00
zeertzjq
5805716ca4
vim-patch:9.1.0765: No test for patches 6.2.418 and 7.3.489 (#30713)
Problem:  No test for patches 6.2.418 and 7.3.489
Solution: Add a test.  Fix some whitespace problems in test_mapping.vim.
          Document the behavior (zeertzjq).

closes: vim/vim#15815

5df3cb2898
2024-10-07 22:51:57 +00:00
zeertzjq
376de1483e
fix(drawline): correct highlight priority with Visual selection (#30706) 2024-10-08 06:24:36 +08:00
zeertzjq
2377443cd2
vim-patch:9.1.0764: [security]: use-after-free when closing a buffer (#30705)
Problem:  [security]: use-after-free when closing a buffer
Solution: When splitting the window and editing a new buffer,
          check whether the newly to be edited buffer has been marked
          for deletion and abort in this case

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rj48-v4mq-j4vg

51b62387be

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-07 10:40:44 +08:00
zeertzjq
40ec3d7bc0
vim-patch:9.1.0761: :cd completion fails on Windows with backslash in path (#30703)
Problem:  :cd completion fails on Windows with backslash in path
Solution: switch no_bslash argument to FALSE in file_pat_to_reg_pat()

Note: only fixes the problem on Windows. For Unix, we still need to
escape backslashes since those are taken as regex atoms (and could be
invalid regex atoms).

fixes: vim/vim#15643
closes: vim/vim#15808

1a31c430bb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-07 10:16:47 +08:00
Justin M. Keyes
27f3750817
feat(lsp): improve LSP doc hover rendering #30695
Problem:
- Some servers like LuaLS add unwanted blank lines after multiline
  `@param` description.
- List items do not wrap nicely.

Solution:
- When rendering the LSP doc hover, remove blank lines in each `@param`
  or `@return`.
  - But ensure exactly one empty line before each.
- Set 'breakindent'.
2024-10-06 12:20:40 -07:00
dundargoc
00d1078ede ci: bump macos runner version to macos-15 2024-10-06 16:06:28 +02:00
zeertzjq
a4ebea18f1
vim-patch:9.1.0003: Cannot build against Ruby 33 dynamically (#30683)
Problem:  Cannot build against Ruby 33 dynamically
Solution: Ruby 33 removed transient heap, so do not use
          rb_ary_transient anymore, NoMethodError format changed,
          so update test for expected error message
          (Isao Sato)

- ruby-3.3 removed transient heap for ruby/dyn

when +ruby/dyn with ruby-3.3 do command :ruby, E448 occur.
ruby-3.3 has no transient heap anymore, so disable rb_ary_transient etc.

$ LC_ALL=C VIMRUNTIME=runtime ./src/vim -u NONE -c 'ruby puts RUBY_VERSION'
"=> Error detected while processing command line:
"=> E448: Could not load library function rb_ary_detransient
"=> E266: Sorry, this command is disabled, the Ruby library could not be
    loaded.

- ruby-3.3 changed NoMethodError format:

$ rvm 3.2.2, 3.3.0-rc1 do ruby -e 'begin; nil.name; rescue => e; puts "%s : %s"%[RUBY_VERSION, e.message]; end '
=> 3.2.2 : undefined method `name' for nil:NilClass
=> 3.3.0 : undefined method `name' for nil

so loose pattern in Test_ruby_Vim_buffer_get()

closes: vim/vim#13741

443657b32b

Co-authored-by: Isao Sato <svardew@gmail.com>
2024-10-05 23:28:28 +00:00
zeertzjq
9f26bdc416
vim-patch:9.1.0759: screenpos() may return invalid position (#30681)
Problem:  screenpos() may return invalid position
          after switching buffers (Greg Hurrell)
Solution: reset w_leftcol if wrapping has been set
          after copying wrap option

fixes: vim/vim#15792
closes: vim/vim#15803

b065a10e24

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-06 06:49:23 +08:00
Jongwook Choi
d5ae5c84e9
feat(lua): completion for vim.fn, vim.v, vim.o #30472
Problem: Lua accessors for
- global, local, and special variables (`vim.{g,t,w,b,v}.*`), and
- options (`vim.{o,bo,wo,opt,opt_local,opt_global}.*`),

do not have command-line completion, unlike their vimscript counterparts
(e.g., `g:`, `b:`, `:set`, `:setlocal`, `:call <fn>`, etc.).

Completion for vimscript functions (`vim.fn.*`) is incomplete and does
not list all the available functions.

Solution: Implement completion for vimscript function, variable and
option accessors in `vim._expand_pat` through:

- `getcompletion()` for variable and vimscript function accessors, and
- `nvim_get_all_options_info()` for option accessors.

Note/Remark:

- Short names for options are yet to be implemented.

- Completions for accessors with handles (e.g. `vim.b[0]`, `vim.wo[0]`)
  are also yet to be implemented, and are left as future work, which
  involves some refactoring of options.

- For performance reasons, we may want to introduce caching for
  completing options, but this is not considered at this time since the
  number of the available options is not very big (only ~350) and Lua
  completion for option accessors appears to be pretty fast.

- Can we have a more "general" framework for customizing completions?
  In the future, we may want to improve the implementation by moving the
  core logic for generating completion candidates to each accessor (or
  its metatable) or through some central interface, rather than writing
  all the accessor-specific completion implementations in a single
  function: `vim._expand_pat`.
2024-10-04 06:48:31 -07:00
zeertzjq
86c5c8724b
fix(mouse): indicate X1 and X2 button clicks on statusline (#30655) 2024-10-04 21:31:28 +08:00
Justin M. Keyes
b45c50f314
docs: render @since versions, 0 means experimental #30649
An implication of this current approach is that `NVIM_API_LEVEL` should be
bumped when a new Lua function is added.

TODO(future): add a lint check which requires `@since` on all new functions.

ref #25416
2024-10-04 02:13:31 -07:00
James Trew
385fbfb3e7
docs: improve luacats support #30580
Some composite/compound types even as basic as `(string|number)[]` are
not currently supported by the luacats LPEG grammar used by gen_vimdoc.
It would be parsed & rendered as just `string|number`.

Changeset adds better support for these types.
2024-10-03 03:45:51 -07:00
glepnir
cc300e553b
vim-patch:9.1.0756: missing change from patch v9.1.0754 (#30636)
Problem:  missing change from patch v9.1.0754
Solution: use correct width for the actual item
          in pum_redraw() (glepnir)

closes: vim/vim#15786

a6d9e3c4e0
2024-10-03 09:58:15 +00:00
zeertzjq
ae0e4071a8
vim-patch:9.1.0755: quickfix list does not handle hardlinks well (#30637)
Problem:  quickfix list does not handle hardlinks well
Solution: store original file name with quickfix entry
          (Austin Chang)

Quickfix list shows entries with duplicate name if the file is opened
with the path of hard links.

The major cause is that qflist assumed that the filename passed into
`qf_add_entry` matches the filename opened with the buffer.

This patch handles this case by introduce a `qf_fname` into `qfline_S`
structure. It stores the filename from `qf_add_entry` for each quickfix
line.

closes: vim/vim#15687

2982299699

Co-authored-by: Austin Chang <austin880625@gmail.com>
2024-10-03 09:44:04 +00:00
fredizzimo
7eba016c86
fix(ui): ensure screen update before waiting for input #30576
Ensure the screen is fully updated before blocking for input. This did
not always happen before, for example when setting `cursorline
scrolloff=9999`, which lead to jerky movement when using some GUI
applications.

Because of the duality of redraw_later, this can't be done in
command-line or when waiting for "Press ENTER". In many of those cases
the redraw is expected AFTER the key press, while normally it should
update the screen immediately. So, those special cases are excluded.
2024-10-03 02:31:17 -07:00
glepnir
6a2f8958e8
vim-patch:9.1.0754: fixed order of items in insert-mode completion menu (#30619)
Problem:  fixed order of items in insert-mode completion menu
Solution: Introduce the 'completeitemalign' option with default
          value "abbr,kind,menu" (glepnir).

Adding an new option `completeitemalign` abbr is `cia` to custom
the complete-item order in popupmenu.

closes: vim/vim#14006
closes: vim/vim#15760

6a89c94a9e
2024-10-03 06:45:01 +08:00
Justin M. Keyes
bbf208784c tests: skip watch.watchdirs test on macos 14 CI
Problem:
Strange failure only in macos 14 CI

    FAILED   test/functional/lua/watch_spec.lua @ 82: vim._watch watchdirs() detects file changes
    test/functional/lua/watch_spec.lua:149: Expected objects to be the same.
    Passed in:
    (table: 0x0116023758) {
     *[1] = {
        [change_type] = 3
       *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/nvim_KFMvPbXk9a' }
      [2] = {
        [change_type] = 3
        [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } }
    Expected:
    (table: 0x010d9d6548) {
     *[1] = {
        [change_type] = 1
       *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' }
      [2] = {
        [change_type] = 3
        [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } }

    stack traceback:
            test/functional/lua/watch_spec.lua:149: in function <test/functional/lua/watch_spec.lua:82>

Solution:
Skip test for that exact version.
2024-10-02 16:41:01 +02:00
Justin M. Keyes
9e23b4e185 fix(watch): ignore nonexistent paths (ENOENT)
Problem:
The `_watch.watch()` strategy may fail if the given path does not exist:

    …/vim/_watch.lua:101: ENOENT: no such file or directory
    stack traceback:
        [C]: in function 'assert'
        …/vim/_watch.lua:101: in function <…/vim/_watch.lua:61>
        [string "<nvim>"]:5: in main chunk

- `_watch.watch()` actively asserts any error returned by `handle:start()`.
- whereas `_watch.watchdirs()` just ignores the result of `root_handle:start()`.

Servers may send "client/registerCapability" with "workspace/didChangeWatchedFiles"
item(s) (`baseUri`) which do not actually exist on the filesystem:
https://github.com/neovim/neovim/issues/28058#issuecomment-2189929424

    {
      method = "client/registerCapability",
      params = {
        registrations = { {
            method = "workspace/didChangeWatchedFiles",
            registerOptions = {
              watchers = { {
                  globPattern = {
                    baseUri = "file:///Users/does/not/exist",
                    pattern = "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}"
                  }
                },
    ...
    }

Solution:
- Remove the assert in `_watch.watch()`.
- Show a once-only message for both cases.
- More detailed logging is blocked until we have `nvim_log` / `vim.log`.

fix #28058
2024-10-02 16:41:01 +02:00
zeertzjq
0e484c2041
vim-patch:9.1.0753: Wrong display when typing in diff mode with 'smoothscroll' (#30614)
Problem:  Wrong display when typing in diff mode with 'smoothscroll'.
Solution: Use adjust_plines_for_skipcol() (zeertzjq).

closes: vim/vim#15776

47f8584a80
2024-10-01 22:55:43 +00:00
zeertzjq
1c30d86c33
fix(tabline): restore behavior of click after last tabpage (#30602)
Also correct the comments about tabpage labels in custom tabline.
2024-10-01 19:46:30 +08:00
Christian Clason
ea9d61b80d vim-patch:9.1.0749: filetype: http files not recognized
Problem:  filetype: http files not recognized
Solution: detect '*.http' as http filetype, include
          http filetype plugin (Riley Bruins)

Based on the specification found
[here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md)

closes: vim/vim#15762

de6c1d1182

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-10-01 07:33:08 +02:00
Lewis Russell
0fb5299e53 test: refactor exec_lua in xdiff_spec 2024-09-30 11:51:33 +01:00
Lewis Russell
c65646c247 fix(diff): use mmfile_t in linematch
Problem:

Linematch used to use strchr to navigate a string, however strchr does
not supoprt embedded NULs.

Solution:

Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`.

Also remove heap allocations from `matching_char_iwhite()`

Fixes: #30505
2024-09-30 11:51:33 +01:00
Christian Clason
99e0facf3a feat(treesitter)!: use return values in language.add()
Problem: No clear way to check whether parsers are available for a given
language.

Solution: Make `language.add()` return `true` if a parser was
successfully added and `nil` otherwise. Use explicit `assert` instead of
relying on thrown errors.
2024-09-29 15:27:16 +02:00
zeertzjq
df915f3afc
fix(float): properly find last window of tabpage (#30571) 2024-09-29 10:38:17 +00:00
dundargoc
2c937d723d
docs: misc (#30177)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-09-29 09:54:12 +00:00
Christian Clason
1405034ba3 vim-patch:9.1.0745: filetype: bun and deno history files not recognized
Problem:  filetype: bun and deno history files not recognized
Solution: detect '.bun_repl_history' and 'deno_history.txt' as
          javascript filetype (Wu, Zhenyu)

closes: vim/vim#15761

8a2aea8a62

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-09-29 11:13:27 +02:00
zeertzjq
1ff0a1712a
vim-patch:9.1.0746: tests: Test_halfpage_longline() fails on large terminals (#30567)
Problem:  Test_halfpage_longline() fails on large terminals
          (lazypingu)
Solution: Use a window with known width (zeertzjq).

fixes: vim/vim#15755
closes: vim/vim#15756

fa117387ee
2024-09-29 17:05:56 +08:00
bfredl
2dfa6f6033 refactor(multibyte): neo-casefolding without allocation
fixes #30400
2024-09-29 10:14:16 +02:00
zeertzjq
d5f6f61879
fix(column): set signcolumn width after splitting window (#30556) 2024-09-28 17:16:22 +08:00
zeertzjq
4f9311b759
fix(window): making float with title/footer non-float leaks memory (#30551) 2024-09-28 10:21:06 +08:00
Riley Bruins
0f067cd34d fix(treesitter): suppress get_parser warnings via opts.error 2024-09-28 00:31:45 +02:00
glepnir
7b71fdbc1e
fix(window): respect hide flag of float windows when switching (#30507) 2024-09-28 06:02:14 +08:00
Justin M. Keyes
09d76afe84
feat(defaults): pretty :help headings #30544
Problem:
Headings in :help do not stand out visually.

Solution:
Define a non-standard `@markup.heading.1.delimiter` group and
special-case it in `highlight_group.c`.

FUTURE:
This is a cheap workaround until we have #25718 which will enable:
- fully driven by `vimdoc/highlights.scm` instead of using highlight
  tricks (`guibg=bg guifg=bg guisp=fg`)
- better support of "cterm" ('notermguicolors')
2024-09-27 08:53:30 -07:00
zeertzjq
f55213ce0e
fix(api): fix crash/leak with float title/footer on error (#30543) 2024-09-27 14:33:24 +00:00