Commit Graph
6202 Commits
Author SHA1 Message Date
Christian Clasonandrhysd 9e2248ab58 vim-patch:9.0.2104: wast filetype should be replaced by wat filetype
Problem:  wast filetype should be replaced by wat filetype
Solution: start using the official wat filetype name

runtime: rename `wast` filetype to `wat` (Wasm text format)

The problem is the name of the current filetype wast. When the plugin
was initially created, the file extension for Wasm text format was not
fixed and .wast was more popular.

However, recently .wat became the official file extension for
WebAssembly text (WAT) format and .wast is now a file extension for the
unofficial WAST format, which is a superset of .wat for the convenience
to describe the Wasm specification conformance tests.

https://webassembly.js.org/docs/contrib-wat-vs-wast.html

However for now, let's keep using the `wat` filetype even for the .wast
extension, so that we at least do not lose the filetype settings and
syntax highlighting. This can be adjusted later, if it turns out to have
a separate need for.

closes: vim/vim#13533

https://github.com/vim/vim/commit/bc8f79d36a456054ed29f46585830af6d71f57c8

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2023-11-14 21:51:28 +01:00
Gregory Anders ac8ed77afb feat(tui): add 'termsync' option (#25871)
The 'termsync' option enables a mode (provided the underlying terminal
supports it) where all screen updates during a redraw cycle are buffered
and drawn together when the redraw is complete. This eliminates tearing
or flickering in cases where Nvim redraws slower than the terminal
redraws the screen.
2023-11-14 08:53:58 -06:00
Justin M. Keyes b73a829837 refactor: vim.ui.clipboard #26040
Problem:
Platform-specific UI providers should live in `vim.ui.*`. #24164

Solution:
- Move `vim.clipboard.osc52` module to `vim.ui.clipboard.osc52`.
- TODO: move all of `clipboard.vim` to `vim.ui.clipboard`.

ref #25872
2023-11-14 05:15:45 -08:00
Ploum 5b45efbee6 fix(defaults): set 'fsync' #26034
Problem:
'nofsync' may lose data if the system has a hard shutdown. #9888

Solution:
Change default to 'fsync'. This may be revisited in the future when
'nofsync' can be made safer.
2023-11-14 02:56:50 -08:00
Gregory Anders 8d9789a0f3 docs: deprecate the "term_background" UI field 2023-11-13 19:04:47 -06:00
Gregory Anders ab102f188e refactor: move background color detection into Lua 2023-11-13 19:04:46 -06:00
Chris Simon 48bcc7b971 fix(lsp): advertise workspace.didChangeConfiguration capability (#26028)
This ensures workspace/didChangeConfiguration notification sent after init is correctly handled
2023-11-13 19:39:43 +01:00
zeertzjqandChristian Brabandt 2a58aa5709 vim-patch:9.0.2102: matchparen highlight not cleared in completion mode (#26019)
Problem:  matchparen highlight not cleared in completion mode
Solution: Clear matchparen highlighting in completion mode

Remove hard-coded hack in insexpand.c to clear the :3match before
displaying the completion menu.

Add a test for matchparen highlighting. While at it, move all test tests
related to the matchparen plugin into a separate test file.

closes: vim/vim#13493
closes: vim/vim#13524

https://github.com/vim/vim/commit/9588666360e94de3ff58d4bc79aa9148fbf5fc44

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-13 10:47:12 +08:00
zeertzjq d2983dcdb1 fix(clipboard): make osc52 work with PUC Lua (#26014) 2023-11-13 07:27:45 +08:00
zeertzjqandChristian Brabandt 6d14f3ddab vim-patch:9.0.2103: recursive callback may cause issues on some archs (#26013)
Problem:  recursive callback may cause issues on some archs
Solution: Decrease the limit drastically to 20

Recursive callback limit causes problems on some architectures

Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test
that causes a recursive popup callback function to be executed. However
it seems the current limit of 'maxfuncdepth' option value is still too
recursive for some 32bit architectures (e.g. 32bit ARM).

So instead of allowing a default limit of 100 (default value for
'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a
use case where one would need such a high recursive callback limit and a
limit of 20 seems reasonable (although it is currently hard-coded).

closes: vim/vim#13495
closes: vim/vim#13502

https://github.com/vim/vim/commit/2076463e383901cef44685aaf4b63e4306444f9e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-13 06:33:34 +08:00
zeertzjqandShane-XB-Qian 74e23b3b2a vim-patch:2dd613f57bf1 (#26009)
runtime(termdebug): improve the breakpoint sign label (vim/vim#13525)

// related vim/vim#12589
// that should be the last chat (I) with Bram, r.i.p

https://github.com/vim/vim/commit/2dd613f57bf17eb8ff050bcb5510eb0279f5c9ab

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2023-11-13 05:44:30 +08:00
dundargoc 4f8941c1a5 refactor: replace manual header guards with #pragma once
It is less error-prone than manually defining header guards. Pretty much
all compilers support it even if it's not part of the C standard.
2023-11-12 22:01:28 +01:00
LW 448907f65d feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512
refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()`

Problem:
The LSP specification allows inlay hints to include tooltips, clickable
label parts, and code actions; but Neovim provides no API to query for
these.

Solution:
Add minimal viable extension point from which plugins can query for
inlay hints in a range, in order to build functionality on top of.

Possible Next Steps
---

- Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for
  usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
2023-11-12 04:54:27 -08:00
Christian Clasonanddkearns c6b317dd13 vim-patch:2c133f6c1a16
runtime(lynx): Update for Lynx 2.8.9 (vim/vim#13510)

https://github.com/vim/vim/commit/2c133f6c1a165a74678a89722ed8c42967c295e4

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-12 10:53:57 +01:00
zeertzjqanddkearns b331302442 vim-patch:9358b8d99349 (#25998)
runtime(vim): Improve :let-heredoc syntax highlighting (vim/vim#12923)

"trim" and "eval" are allowed in any order and whitespace is not
required after "=<<".

https://github.com/vim/vim/commit/9358b8d99349818666718f513655c2bf53d43754

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-12 08:26:56 +08:00
ObserverOfTime c23dd7c9ef vim-patch:9.0.2098: No filetype support for xcompose files (#25983)
Problem:  No filetype support for xcompose files
Solution: Add filetype detection

closes: vim/vim#13508

https://github.com/vim/vim/commit/4f9074b96cc7efb1c829ca74902a851551dcf4e8
2023-11-12 07:51:25 +08:00
zeertzjqandChristian Brabandt 2494009885 vim-patch:1b08d2cd0789 (#25993)
runtime(doc): clarify when formatoptions applies

closes: vim/vim#13503

https://github.com/vim/vim/commit/1b08d2cd0789fd9aaae148a64ff46342730022d7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12 07:49:57 +08:00
Christian ClasonandGerrit Meier 84688ec372 vim-patch:9.0.2097: No support for cypher files
Problem:  No support for cypher files
Solution: Add cypher filetype detection

Cypher query language support to work with (mostly) graph databases.

Already existing lsp support in Neovim's nvim-lspconfig:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cypher_ls

closes: vim/vim#13516

https://github.com/vim/vim/commit/8f0fe20ff1a13b468fdfaf85c434475f75c7a615

Co-authored-by: Gerrit Meier <meistermeier@gmail.com>
2023-11-12 00:22:28 +01:00
be83cd73b2 vim-patch:5994329667a6
runtime(i3config): Update for i3 4.23 (vim/vim#13522)

https://github.com/vim/vim/commit/5994329667a630b85fae07b9121668456e86b22d

Co-authored-by: Ivan Grimaldi <grimaldi.ivan@gmail.com>
Co-authored-by: Ivan Grimaldi <grimaldi.ivam@gmail.com>
2023-11-11 15:11:49 +01:00
Christian Clasonanddkearns ae8ca79920 vim-patch:d56f15caf602
runtime(wget): Update for Wget2 2.1.0 (vim/vim#13497)

https://github.com/vim/vim/commit/d56f15caf602a061f5f9f0a3c6a4537ab2dc6acc

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-09 19:17:11 +01:00
zeertzjqandErnie Rael 04d299c170 vim-patch:8.2.4932: not easy to filter the output of maplist()
Problem:    Not easy to filter the output of maplist().
Solution:   Add mode_bits to the dictionary. (Ernie Rael, closes vim/vim#10356)

https://github.com/vim/vim/commit/d8f5f766219273a8579947cc80b92580b6988a4b

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjqandErnie Rael f748a73a35 vim-patch:8.2.4861: it is not easy to restore saved mappings
Problem:    It is not easy to restore saved mappings.
Solution:   Make mapset() accept a dict argument. (Ernie Rael, closes vim/vim#10295)

https://github.com/vim/vim/commit/51d04d16f21e19d6eded98f9530d84089102f925

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjqandErnie Rael d4dbfb092b vim-patch:8.2.4825: can only get a list of mappings
Problem:    Can only get a list of mappings.
Solution:   Add the optional {abbr} argument. (Ernie Rael, closes vim/vim#10277)
            Rename to maplist().  Rename test file.

https://github.com/vim/vim/commit/09661203ecefbee6a6f09438afcff1843e9dbfb4

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjqandErnie Rael 2dfcd5a22b vim-patch:8.2.4820: not simple programmatic way to find a specific mapping
Problem:    Not simple programmatic way to find a specific mapping.
Solution:   Add getmappings(). (Ernie Rael, closes vim/vim#10273)

https://github.com/vim/vim/commit/659c240cf769925ff432b88df8719e7ace4629b0

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjqandBram Moolenaar a4b80c71ea vim-patch:8.2.4140: maparg() does not indicate the type of script
Problem:    maparg() does not indicate the type of script where it was defined.
Solution:   Add "scriptversion".

https://github.com/vim/vim/commit/a9528b39a666dbaa026320f73bae4b1628a7fe51

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-09 21:34:02 +08:00
zeertzjq 610f50ddaf vim-patch:20a94f44b3cd (#25946)
runtime(doc): fix grammar in termdebug doc, remove trailing spaces (vim/vim#13505)

https://github.com/vim/vim/commit/20a94f44b3cd4a33fb7d2ce5faf07a5244ba2cae
2023-11-09 15:46:14 +08:00
zeertzjqandshane.xb.qian 77bb69d7b0 vim-patch:7fbbd7fdc6df (#25944)
runtime(termdebug):  handle buffer-local mappings properly

closes: vim/vim#13475

https://github.com/vim/vim/commit/7fbbd7fdc6df9dc198b3735cfbe8dbe8afd646f9

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-09 08:38:25 +08:00
zeertzjqandshane.xb.qian 89d785e530 vim-patch:ca48202b6f46
runtime(termdebug): improve window handling, shorten var types

closes vim/vim#13474

https://github.com/vim/vim/commit/ca48202b6f46cfb40a0d1d80033a2f3e8cb7b813

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-09 07:24:31 +08:00
zeertzjqandChristian Brabandt f7b2ea59a6 vim-patch:9.0.2095: statusline may look different than expected (#25941)
Problem:  statusline may look different than expected
Solution: do not check for highlighting of stl and stlnc characters

statusline fillchar may be different than expected

If the highlighting group for the statusline for the current window
|hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared
(or do not differ from each other), than Vim will use the hard-coded
fallback values '^' (for the non-current windows) or '=' (for the
current window).  I believe this was done, to make sure the statusline
will always be visible and be distinguishable from the rest of the
window.

However, this may be unexpected, if a user explicitly defined those
fillchar characters just to notice that those values are then not used
by Vim.

So, let's assume users know what they are doing and just always return
the configured stl and stlnc values.  And if they want the statusline to
be non-distinguishable from the rest of the window space, so be it.  It
is their responsibility and Vim shall not know better what to use.

fixes: vim/vim#13366
closes: vim/vim#13488

https://github.com/vim/vim/commit/6a650bf696f1df3214b3d788947447c5bbf1a77d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 06:34:34 +08:00
Gregory Anders 3128cff6b1 fix(clipboard): increase OSC 52 wait timeout (#25936)
When pasting with OSC 52 some terminals show a prompt to the user asking
for permission to read from the system clipboard. When this prompt
appears, 1s is not long enough to wait.

Increase the timeout to 10s and show a message to the user indicating
how to interrupt the wait after 1s.
2023-11-08 12:42:47 -06:00
Gregory Anders 08847a9ea1 refactor: move defaults into separate module (#25929)
Move default mappings and autocommands into a separate module and add
comments and docstrings to document each of the defaults.
2023-11-08 09:33:37 -06:00
bfredl 1b0fd377ab Merge pull request #25767 from luukvbaal/signdel
feat(extmarks): add 'invalidate' property
2023-11-08 12:17:25 +01:00
Luuk van Baal 4e6f559b8c feat(extmarks): add 'invalidate' property to extmarks
Problem:  No way to have extmarks automatically removed when the range it
          is attached to is deleted.
Solution: Add new 'invalidate' property that will hide a mark when the
          entirety of its range is deleted. When "undo_restore" is set
          to false, delete the mark from the buffer instead.
2023-11-08 02:53:49 +01:00
Gregory Anders 748bc4d22d feat(clipboard): add OSC 52 clipboard support
This is opt-in as not all terminal emulators support OSC 52, so it is up
to the user to enable it explicitly.
2023-11-07 08:25:33 -06:00
zeertzjq 6f936c9d85 fix(man): make :Man with a range work (#25922) 2023-11-07 10:39:27 +08:00
altermo 3198038224 fix(lua): correct return value for on_key with no arguments (#25911) 2023-11-07 08:33:38 +08:00
Gregory Anders 56627ca242 feat(tui): use TermResponse event for OSC responses (#25868)
When the terminal emulator sends an OSC sequence to Nvim (as a response
to another OSC sequence that was first sent by Nvim), populate the OSC
sequence in the v:termresponse variable and fire the TermResponse event.
The escape sequence is also included in the "data" field of the
autocommand callback when the autocommand is defined in Lua.

This makes use of the already documented but unimplemented TermResponse
event. This event exists in Vim but is only fired when Vim receives a
primary device attributes response.

Fixes: https://github.com/neovim/neovim/issues/25856
2023-11-06 12:42:40 -06:00
zeertzjqandChristian Brabandt 0774d0cfe1 vim-patch:da4e433dc3be (#25912)
runtime(doc): document vim-script library function

https://github.com/vim/vim/commit/da4e433dc3bee7fa521df3c7235d49a6732134ef

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-06 19:03:08 +08:00
Christian Clasonandavidseeker bbd7ec9e64 vim-patch:caee7956a21a
runtime(keymap): Switch Hindu-Arabic to Arabic numerals in arabic keymap (vim/vim#13430)

https://github.com/vim/vim/commit/caee7956a21a8c1102266b31af44c432522bdb53

Co-authored-by: avidseeker <avidseeker7@protonmail.com>
2023-11-05 21:56:56 +01:00
Christian ClasonandChristian Brabandt b329a21bd3 vim-patch:3d37231437fc
runtime(tar): improve the error detection

Do not rely on the fact, that the last line matches warning, error,
inappropriate or unrecognized to determine if an error occurred. It
could also be a file, contains such a keyword.

So make the error detection slightly more strict and only assume an
error occured, if in addition to those 4 keywords, also a space matches
(this assumes the error message contains a space), which luckily on Unix
not many files match by default.

The whole if condition seems however slightly dubious.  In case an error
happened, this would probably already be caught in the previous if
statement, since this checks for the return code of the tar program.

There may however be tar implementations, that do not set the exit code
for some kind of error (but print an error message)? But let's keep this
check for now, not many people have noticed this behaviour until now, so
it seems to work reasonably well anyhow.

related: vim/vim#6425
fixes: vim/vim#13489

https://github.com/vim/vim/commit/3d37231437fc0f761664a7cabc8f7b927b468767

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:56:56 +01:00
Christian ClasonandSean Dewar dcf5999fcd vim-patch:b2a4c110a5d1
runtime(dist): Make dist/vim.vim work properly when lacking vim9script support (vim/vim#13487)

`:return` cannot be used outside of `:function` (or `:def`) in older Vims
lacking Vim9script support or in Neovim, even when evaluation is being skipped
in the dead `:else` branch.

Instead, use the pattern described in `:h vim9-mix`, which uses `:finish` to end
script processing before it reaches the vim9script stuff.

https://github.com/vim/vim/commit/b2a4c110a5d13bc794f4eddb2e88a4e8fe9dfbea

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-11-05 21:52:02 +01:00
Christian ClasonandChristian Brabandt 2a47dbe228 vim-patch:4f174f0de90b
runtime(dist): add legacy version for central vim library

Also, enable the zip and gzip plugins by default, unless those variables
were not explicitly set by the user.

related: vim/vim#13413

https://github.com/vim/vim/commit/4f174f0de90b52937ddaf1e6db98e9731930ff7c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:52:02 +01:00
Christian ClasonandD. Ben Knoble 26cdff0e92 vim-patch:cd8a3eaf5348
runtime(dist): centralize safe executable check and add vim library (vim/vim#13413)

Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes,
2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when
loading ftplugins, 2023-09-06).

This puts the logic for safe executable checks in a single place, by introducing
a central vim library, so all filetypes benefit from consistency.

Notable changes:
- dist#vim because the (autoload) namespace for a new runtime support
  library. Supporting functions should get documentation. It might make
  life easier for NeoVim devs to make the documentation a new file
  rather than cram it into existing files, though we may want
  cross-references to it somewhere…
- The gzip and zip plugins need to be opted into by enabling execution
  of those programs (or the global plugin_exec). This needs
  documentation or discussion.
- This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed
  in f7ac0ef50 (runtime: don't execute external commands when loading
  ftplugins, 2023-09-06), but the variable was still referenced. Since
  the new function takes care of that automatically, the variable is no
  longer needed.

https://github.com/vim/vim/commit/cd8a3eaf5348feacfecab4b374b7ea4ce6a97422

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2023-11-05 21:52:02 +01:00
bfredl 68cb4a7405 feat(extmarks): add "undo_restore" flag to opt out of undo-restoring
It is a design goal of extmarks that they allow precise tracking
of changes across undo/redo, including restore the exact positions
after a do/undo or undo/redo cycle. However this behavior is not useful
for all usecases. Many plugins won't keep marks around for long after
text changes, but uses them more like a cache until some external source
(like LSP semantic highlights) has fully updated to changed text and
then will explicitly readjust/replace extmarks as needed.

Add a "undo_restore" flag which is true by default (matches existing
behavior) but can be set to false to opt-out of this behavior.

Delete dead u_extmark_set() code.
2023-11-05 12:18:29 +01:00
L Lllvvuu 6c150e0b93 docs(treesitter): add disclaimer about needing to parse before get_node()
Problem:
---
Misuse of `get_node()` is common:
https://github.com/search?q=get_node_at_cursor+language%3Alua&type=code

Solution:
---
Add a note clarifying proper usage.
2023-11-04 14:55:44 +01:00
Christian ClasonandLucien Grondin d3e9cbedc7 vim-patch:ce3b0136c6d9
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (vim/vim#13480)

Add shDerefOffset to shDerefVarArray.

Example code:

```bash
declare -a a=({a..z})

echo "${a[@]:1:3}"
```

https://github.com/vim/vim/commit/ce3b0136c6d9d09af41969d3dc9634f115505a32

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-04 12:55:54 +01:00
e960fa2412 vim-patch:2f54c13292af
runtime(script.vim): make strace ft check less strict (vim/vim#13482)

Strace output, depending on parameters (-ttf this time), can dump both
times and pid:
  1038  07:14:20.959262 execve("./e.py", ["./e.py"], 0x7ffca1422840 /* 51 vars */) = 0 <0.000150>

So loose the regexp matching this, so that the above is matched too.

Fixes vim/vim#13481.

https://github.com/vim/vim/commit/2f54c13292af053ec00c18e5fded87b1bc602822

Co-authored-by: Jiri Slaby <jirislaby@gmail.com>
Co-authored-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
2023-11-04 12:55:25 +01:00
Mathias Fussenegger 9281edb334 fix(lsp): create per client params in lsp.buf.code_action
`code_action` used the same parameters for all clients, which led to the
following warning and incorrect start/end column locations if using
clients with mixed encodings:

    warning: multiple different client offset_encodings detected for
    buffer, this is not supported yet
2023-11-04 08:17:42 +01:00
Christian ClasonandLucien Grondin d4dc1355ed vim-patch:1858e2b22ad1
runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469)

https://github.com/vim/vim/commit/1858e2b22ad168b1fd44a4efcd3a2b6cd9f6772d

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-03 10:04:55 +01:00
Christian ClasonandJames McCoy 80cf1ee2c5 vim-patch:2b89afd5eb63
runtime(debversions): Add noble (24.04 LTS) as Ubuntu release name (vim/vim#13472)

https://github.com/vim/vim/commit/2b89afd5eb63864154d973e7991a56a53b87a767

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-11-03 10:04:55 +01:00