Commit Graph

8061 Commits

Author SHA1 Message Date
zeertzjq
ab9cfc4dc3
Merge pull request #31370 from glepnir/vim-9.1.0867
vim-patch:9.1.{0867,0891,0896}
2024-11-30 20:46:46 +08:00
Christian Clason
9d174a7dac vim-patch:9.1.0898: runtime(compiler): pytest compiler not included
Problem:  runtime(compiler): pytest compiler not included
Solution: include pytest compiler, update the compiler completion test
          (Konfekt)

closes: vim/vim#16130

3c2596a9e9

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-30 13:40:08 +01:00
glepnir
1af1e918d3 vim-patch:9.1.0896: completion list wrong after v9.1.0891
Problem:  completion list wrong after v9.1.0891
Solution: update compl_mach_array after leader change
          (glepnir)

compl_shown_match update not correct after refactoring in v9.1.0891
Unfortunately, this regressed what item is selected after leader change.

So generate compl_match_array before updating compl_shown_match range,
and split generate compl_match_array into range match_head

fixes: https://github.com/vim/vim/issues/16128
closes: https://github.com/vim/vim/pull/16129

a49c077a88
2024-11-30 20:22:53 +08:00
Christian Clason
4426a326e2 vim-patch:9.1.0897: filetype: pyrex files are not detected
Problem:  filetype: pyrex files are not detected
Solution: detect '*.pxi' and '*.pyx+' as pyrex filetype
          (user202729)

References:
https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types
https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/using_with_c++.html

closes: vim/vim#16136

aa16b30552

Co-authored-by: user202729 <25191436+user202729@users.noreply.github.com>
2024-11-30 11:41:23 +01:00
Yi Ming
a1e313ded6
feat(lsp): support textDocument/foldingRange (#31311)
* refactor(shared): extract `vim._list_insert` and `vim._list_remove`

* feat(lsp): add `vim.lsp.foldexpr()`

* docs(lsp): add a todo for state management

* feat(lsp): add `vim.lsp.folding_range.foldclose()`

* feat(lsp): schedule `foldclose()` if the buffer is not up-to-date

* feat(lsp): add `vim.lsp.foldtext()`

* feat(lsp): support multiple folding range providers

* refactor(lsp): expose all folding related functions under `vim.lsp.*`

* perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once
2024-11-29 12:40:32 +00:00
zeertzjq
b1c907f219
vim-patch:9.1.0892: the max value of 'cmdheight' is limited by other tabpages (#31378)
Problem:  the max value of 'cmdheight' is limited by other tabpages
Solution: Limit the maximum value of 'cmdheight' to the current tabpage only.
          (Milly)

The Help says that cmdheight is local to the tab page, but says nothing
about the maximum value depending on the state of all tab pages. Users
may wonder why they can't increase cmdheight when there are still rows
available on the current tab page. This PR changes the behavior of
cmdheight so that its maximum value depends only on the state of the
current tab page.

Also, since magic numbers were embedded in various places with the
minimum value of cmdheight being 1, we defined a constant to make it
easier to understand.

closes: vim/vim#16131

2cddf0e85a

Cherry-pick Test_cmdheight_not_changed() from patch 9.0.0187.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-29 10:12:30 +08:00
zeertzjq
1536f79d86
vim-patch:8.2.2993: 'fileencodings' default value should depend on 'encoding' (#31379)
Problem:    'fileencodings' default value should depend on 'encoding'. (Gary
            Johnson)
Solution:   When 'encoding' is "utf-8" use a different default value for
            'fileencodings'.

5ffefbb35a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-11-29 02:06:12 +00:00
zeertzjq
cfa8418c21 vim-patch:9.1.0894: No test for what the spotbug compiler parses
Problem:  No test for what the spotbug compiler parses
          (after commit: 65311c6f472de67b368)
Solution: Test &makeprg for the SpotBugs compiler plugin
          (Aliaksei Budavei)

closes: vim/vim#16096

60ddb1a140

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-11-29 08:58:47 +08:00
vanaigr
731f83ea4a test: add decor benchmarks 2024-11-28 14:11:52 -06:00
zeertzjq
5897994cb7
vim-patch:9.1.0890: %! item not allowed for 'rulerformat' (#31369)
Problem:  %! item not allowed for 'rulerformat'
          (yatinlala)
Solution: also allow to use %! for rulerformat option
          (Yegappan Lakshmanan)

fixes: vim/vim#16091
closes: vim/vim#16118

ac023e8baa

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-28 09:02:10 +08:00
Gregory Anders
99b5ffd688
perf(vim.text): use lookup table implementation for hex encoding (#30080)
Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-26 13:56:01 -06:00
Justin M. Keyes
3d707e6f14
fix(lua): remove vim.loader.disable() #31344
Problem:
`vim.loader.disable` does not conform to `:help dev-name-common` and
`:help dev-patterns`.

Solution:
- Add `enable` parameter to `vim.loader.enable`
- Remove `vim.loader.disable`
- Note the change in `:help news-breaking-dev` (HEAD changes).
  - This is not a breaking change (except to "HEAD") because
    `vim.loader` is marked "experimental".

previous: 26765e8461
2024-11-26 06:15:50 -08:00
zeertzjq
66bb1e577c
vim-patch:9.1.0888: leftcol property not available in getwininfo() (#31349)
Problem:  leftcol property not available in getwininfo()
Solution: add leftcol property property (glepnir)

closes: vim/vim#16119

0a850673e3

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-26 07:53:07 +08:00
Marcus Caisey
c644228e1d
fix(defaults): omit empty line from unimpaired mapping messages (#31347)
Problem:
The default unimpaired mappings display an empty line after the
command's output. This results (with default configuration) in the
`Press ENTER or type command to continue` prompt to be displayed, like
so:
```
(2 of 16): item2

Press ENTER or type command to continue
```

Solution:
The cause is that we're checking the second return value from
`pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was
successful. `nvim_cmd` returns an empty string on success, so this value
is an empty string in the successful path which we then display.

The fix is simple: check the first return value instead which is the
"status code" of the call.
2024-11-25 16:33:11 -06:00
Gregory Anders
29c72cdf4a
fix(lsp): retrigger diagnostics request on server cancellation (#31345)
Co-authored-by: Jesse <github@jessebakker.com>
2024-11-25 11:48:11 -06:00
Yi Ming
165b099fa3
refactor(lsp): rename offset_encoding to position_encoding #31286
Problem:
LSP spec uses the term "position encoding" where we say "offset encoding".

Solution:
- Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking).
- Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
2024-11-25 08:06:05 -08:00
luukvbaal
b47b0b3f75
fix(grid): double grid_line_start() with ext_messages #31292
Problem:  Hit double grid_line_start() assert when redrawing from
          ext_messages msg_ruler event.
Solution: Do not start() batched grid calls when win_redr_ruler() will not
          puts() anything.
2024-11-25 05:54:43 -08:00
Christian Clason
ff00d583af vim-patch:9.1.0886: filetype: debian control file not detected
Problem:  filetype: debian control file not detected
Solution: detect 'debian/control' files as debcontrol filetype
          (author)

closes: vim/vim#16067

57b947e3c3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-25 00:05:12 +01:00
zeertzjq
5c60306442
vim-patch:9.1.0883: message history cleanup is missing some tests (#31331)
Problem:  message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
          (Shougo Matsushita)

closes: vim/vim#16078

9f860a14c3

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-24 14:36:33 +00:00
glepnir
2a1f604c77 fix(lsp): delete bufvar inside WinClosed event
Problem: floaing preview window can be closed by some
ex commands like `only` `fclose` which will not clean the bufvar

Solution: use WinClosed event with floating_winnr for clean
bufnr, and add test cases for vim.lsp.util.open_floating_preview
2024-11-24 10:47:05 +00:00
andrew snelling
9a681ad09e
fix(lsp): hover keymap (#31208)
* fix: use function call in keymap

* fix: test
2024-11-22 12:51:30 +00:00
Famiu Haque
bff07f6dd0
fix(api): don't try to get/set option for invalid option name (#31302)
Problem:
`validate_option_value_args()` returns `OK` even if option name is
invalid or if option doesn't have the supported scope, which leads to
Neovim still trying to erroneously get/set the option in those cases,
which can lead to an assertion failure when `option_has_scope()` is
invoked. This issue miraculously doesn't exist in release builds since
the assertion is skipped and `(get/set)_option_value_for` returns if
there is an error set, but that is not the intended location for that
error to be caught.

Solution:
Make `validate_option_value_args()` return `FAIL` if there is an error
set, which causes the API option functions to return early instead of
trying to get/set an invalid option.
2024-11-22 20:32:51 +08:00
zeertzjq
c697c49a76
test(filetype): symlink detection works after expand('<afile>') (#31307)
Also add a test for #31306, which currently fails.
2024-11-22 11:16:54 +00:00
Christian Clason
6e44a6a289 fix(treesitter): update queries 2024-11-22 09:39:45 +01:00
zeertzjq
3597633075
test(autocmd/termxx_spec): fix TextChangedT test flakiness (#31296)
Problem:  The E937 error appears for too short in TextChangedT test.
Solution: Only feed an Enter key after seeing the error.
2024-11-22 08:08:12 +08:00
zeertzjq
ff75f345ab
fix(highlight): 'winhl' shouldn't take priority over API (#31288) 2024-11-22 06:52:32 +08:00
bfredl
92a83f671b
Merge pull request #31193 from bfredl/winrt
refactor(windows)!: only support UCRT, even for mingw
2024-11-21 18:58:51 +01:00
bfredl
be89d520d7 refactor(windows)!: only support UCRT, even for mingw
The newer UCRT runtime has native support for UTF-8, including forcing
it as the active codepage even before `main()` is called. This means
the c runtime will properly convert windows WCHAR:s into UTF-8 bytes,
as early as the argv/argc params to `main()` . Whereas MSVCRT does not
support this reliably and required us to use `wmain()`.

Only MSVC supports using manifest files directly as source files.
The solution for other Windows toolchains is to use a .rc file.
2024-11-21 12:41:15 +01:00
Lewis Russell
534544cbf7 test: move exec_lua logic to separate module
By making it a separate module, the embedded Nvim session can require
this module directly instead of setup code sending over the module via
RPC.

Also make exec_lua wrap _G.print so messages can be seen
in the test output immediately as the exec_lua returns.
2024-11-21 11:35:16 +00:00
dundargoc
07db909eb5
docs: misc (#31138)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-21 06:50:30 +08:00
luukvbaal
1b6442034f
fix(messages): more ext_messages kinds #31279
Add kinds for various commands that output a list, the 'wildmode'
list, and for number prompts.
2024-11-20 12:11:20 -08:00
Lewis Russell
454ae672aa feat(lsp): deprecate non-method client functions
Deprecated:
- `client.request()` -> `client:request()`
- `client.request_sync()` -> `client:request_sync()`
- `client.notify()` -> `client:notify()`
- `client.cancel_request()` -> `client:cancel_request()`
- `client.stop()` -> `client:stop()`
- `client.is_stopped()` `client:is_stopped()`
- `client.supports_method()` -> `client:supports_method()`
- `client.on_attach()` -> `client:on_attach()`

Fixed docgen to link class fields to the full function doc.
2024-11-20 08:51:45 +00:00
Christian Clason
f55c842ec7 vim-patch:9.1.0880: filetype: C3 files are not recognized
Problem:  filetype: C3 files are not recognized
Solution: detect '*.c3*' files as c3 filetype (Turiiya)

closes: vim/vim#16087

c8dfcfc53b

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
2024-11-20 09:31:15 +01:00
Christian Clason
23ead4f2cb vim-patch:9.1.0876: filetype: openCL files are not recognized
Problem:  filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
          include a opencl syntax and filetype plugin (Wu, Zhenyu)

closes: vim/vim#15825

e2c27ca8ef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-20 09:31:15 +01:00
Christian Clason
4c85c217d3 vim-patch:9.1.0875: filetype: hyprlang detection can be improved
Problem:  filetype: hyprlang detection can be improved
Solution: detect '/hypr/*.conf' files as hyprlang filetype,
          include basic syntax highlighting (Luca Saccarola)

fixes: vim/vim#15875
closes: vim/vim#16064

a13bd294ab

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-20 09:31:15 +01:00
Christian Clason
de9ed1ca54 vim-patch:9.1.0874: filetype: karel files are not detected
Problem:  filetype: karel files are not detected
Solution: detect '*.kl' files as karel filetype,
          include syntax and filetype plugin
          (Kirill Morozov)

closes: vim/vim#16075

fdac54d7bb

Co-authored-by: Kirill Morozov <kirill@robotix.pro>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
2024-11-20 09:31:15 +01:00
zeertzjq
ac7e0ff32f
fix(move): redraw for 'concealcursor' after changing w_wcol (#31276) 2024-11-20 08:24:58 +08:00
Tomasz N
f111c32ff9
fix(messages): no message kind for search pattern #31272 2024-11-19 16:06:36 -08:00
Christian Clason
c12be1249f vim-patch:9.1.0873: filetype: Vivado files are not recognized
Problem:  filetype: Vivado files are not recognized
Solution: detect '*.mss' files as 'mss' filetype
          (Wu, Zhenyu)

references:
https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS

closes: vim/vim#15907

a87462a498

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-19 10:44:30 +01:00
altermo
e2ad251c8d
fix(api): nvim_get_option_value does not clean up on FileType error #31219
Problem:
If there's an error in `FileType` autocmd, the filetype get-opt buffer
doesn't get cleaned up.

Solution:
Call `aucmd_restbuf`.
2024-11-18 06:40:51 -08:00
zeertzjq
1763eddede
vim-patch:9.1.0869: Problem: curswant not set on gm in folded line (#31247)
Problem:  curswant not set on gm in folded line
          (citizenmatt)
Solution: in a folded line, call update_curswant_force()

fixes: vim/vim#11596
closes: vim/vim#11994
closes: vim/vim#15398

9848face74

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-18 09:52:11 +08:00
Peter Aronoff
cc6992f1ca
feat(defaults): dot-repeat [<Space> #31186
Problem: `[<Space>` and `]<Space>` do not support repetition.

Solution: use `operatorfunc` and `g@l` to make these mappings dot
repeatable.
2024-11-17 13:31:24 -08:00
luukvbaal
e025f5a5b3
fix(messages): proper multiline Lua print() messages #31205
Problem:  Separate message emitted for each newline present in Lua
          print() arguments.
Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use
          msg_multiline(). Refactor vim.print() to use print().
2024-11-17 10:21:50 -08:00
luukvbaal
9c718bc2bc
fix(api): validation, documentation of hl_group #31195
Problem:  Documentation for "hl_group" in nvim_buf_set_extmark() is
          unclear. "hl_group" in nvim_echo() does not accept
          highlight group id.
Solution: Move documentation for highlight group name/id to first
          mention of hl_group. Update nvim_echo() to accept highlight
          group id.
2024-11-16 15:36:11 -08:00
luukvbaal
f85bc41c80
feat(ui): don't show unfocusable windows in :tabs, 'tabline' #27984
Problem:  Floating windows with focusable set to false can reasonably be
          expected to be UI elements but are listed in some outputs that
          should contain only regular windows.
Solution: Hide unfocusable floating windows from the default tabline and
          :tabs.
2024-11-16 15:32:36 -08:00
zeertzjq
2eb227f5b6
test(lua/ui_event_spec): avoid polluting log file (#31229) 2024-11-16 08:56:42 +08:00
zeertzjq
fbbb9d6f7b
vim-patch:9.1.0866: filetype: LLVM IR files are not recognized (#31228)
Problem:  filetype: LLVM IR files are not recognized
Solution: detect '*.ll' files either as lifelines or llvm filetype
          (Wu, Zhenyu)

closes: vim/vim#15824

bc32bbddcf

N/A patch:
vim-patch:7e4b861: runtime(filetype): remove duplicated *.org file pattern

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-16 00:42:12 +00:00
luukvbaal
6e4df18b45
fix(ui): no fast context for prompt message kinds #31224
Problem:  No longer able to show prompt messages with vim.ui_attach().
Solution: Do not execute callback in fast context for prompt message
          kinds. These events must be safe to show the incoming message
          so the event itself serves to indicate that the message
          should be shown immediately.
2024-11-15 14:34:42 -08:00
Christian Clason
f0fd9acc4b vim-patch:9.1.0865: filetype: org files are not recognized
Problem:  filetype: org files are not recognized
Solution: detect '*.org' files as 'org' filetype,
          include filetype and syntax plugin
          (Luca Saccarola)

closes: vim/vim#16054

0684800c85

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-15 09:07:37 +01:00
zeertzjq
54c85bcb6d
vim-patch:9.1.0855: setting 'cmdheight' may missing output (#31216)
Problem:  setting 'cmdheight' may cause hit-enter-prompt and echo output
          to be missing
Solution: Before cleaning the cmdline, check the need_wait_return flag
          (nwounkn)

closes: vim/vim#13432

2e48567007

Co-authored-by: nwounkn <nwounkn@gmail.com>
2024-11-15 00:18:53 +00:00
zeertzjq
fa0dcde3d9
vim-patch:9.1.0864: message history is fixed to 200 (#31215)
Problem:  message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
          value to 500 (Shougo Matsushita)

closes: vim/vim#16048

4bd9b2b246

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-15 08:04:49 +08:00
Luuk van Baal
de48fbbd5f fix(messages)!: vim.ui_attach message callbacks are unsafe
Problem:  Lua callbacks for "msg_show" events with vim.ui_attach() are
          executed when it is not safe.
Solution: Disallow non-fast API calls for "msg_show" event callbacks.
          Automatically detach callback after excessive errors.
          Make sure fast APIs do not modify Nvim state.
2024-11-14 13:23:11 +01:00
bfredl
e61228a214 fix(tests): needing two calls to setup a screen is cringe
Before calling "attach" a screen object is just a dummy container for
(row, col) values whose purpose is to be sent as part of the "attach"
function call anyway.

Just create the screen in an attached state directly. Keep the complete
(row, col, options) config together. It is still completely valid to
later detach and re-attach as needed, including to another session.
2024-11-14 12:40:57 +01:00
Kristijan Husak
33d10db5b7
fix(lsp): filter completion candidates based on completeopt (#30945) 2024-11-13 15:18:29 +00:00
Riley Bruins
36990f324d fix(treesitter): show proper node name error messages
**Problem:** Currently node names with non-alphanumeric, non
underscore/hyphen characters (only possible with anonymous nodes) are
not given a proper error message. See tree-sitter issue 3892 for more
details.

**Solution:** Apply a different scanning logic to anonymous nodes to
correctly identify the entire node name (i.e., up until the final double
quote)
2024-11-13 13:32:58 +01:00
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