Commit Graph

26334 Commits

Author SHA1 Message Date
zeertzjq
7abfb1f86e vim-patch:8.2.2949: tests failing because no error for float to string conversion
Problem:    Tests failing because there is no error for float to string
            conversion.
Solution:   Change the check for failure to check for correct result.  Make
            some conversions strict in Vim9 script.

3cfa5b16b0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:16 +08:00
Sean Dewar
1ffd20a26e test(unit/eval/typval_spec): don't dereference NULL last_msg_hist
If last_msg_hist is NULL, check_emsg will cause the running test process
to SIGSEGV from trying to access the msg member.
2023-06-12 13:27:16 +08:00
Sean Dewar
7f8c1e53a6 vim-patch:8.2.2948: substitute() accepts a number but not a float expression
Problem:    Substitute() accepts a number but not a float expression.
Solution:   Also accept a float. (closes vim/vim#8331)

7a2217bedd

Vim9script is N/A. No need to port the strict argument and
tv_get_string_buf_chk_strict(), as it's only used for Vim9script.

Like the patch, use vim_snprintf over snprintf, as the "%g" specifier in
snprintf removes the ".0" from integer floats.

This means similiar to numbers, floats are (mostly) convertable to
strings.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:07 +08:00
Sean Dewar
c690f10194 vim-patch:8.2.1524: no longer get an error for string concatenation with float
Problem:    No longer get an error for string concatenation with float.
            (Tsuyoshi Cho)
Solution:   Only convert float for Vim9 script. (closes vim/vim#6787)

2e0866128b

Vim9script is N/A.

Required for v8.2.2949.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:04 +08:00
zeertzjq
3c4890d1ef
test(old): reorder test_substitute.vim to match upstream (#23994) 2023-06-12 11:44:01 +08:00
Justin M. Keyes
6e1fa16dde
Merge #23954 vim.version() returns Version object 2023-06-11 16:32:37 -07:00
Justin M. Keyes
e688793253 feat: tostring(vim.version())
Problem:
tostring(vim.version()) returns "table: 0x…".

Solution:
Modify vim.version() to return a string prerelease instead of a boolean.

Fix #23863
2023-06-12 01:14:33 +02:00
Stanislav Asunkin
d3b9feccb3
docs: fix vim.tbl_get type annotations #23992 2023-06-11 15:48:13 -07:00
Gianmaria Bajo
ecdb6465e2 feat: vim.version() returns a Version object
- vim.version() returns a Version object.
  Makes it printable and removes the need of workarounds when passing it
  to other vim.version methods.
2023-06-12 00:09:10 +02:00
Justin M. Keyes
46fab3831b refactor: remove WINGUI_URL
nvim-qt was removed in 0370e4def0
2023-06-12 00:06:30 +02:00
treatybreaker
199a990c9e
feat: report "build" in vim.version() #23925
Problem:
Nvim version string typically has a "build" component
but vim.version() doesn't report it.

Solution:
Add the "build" field to vim.version().

Closes #23863
2023-06-11 14:57:23 -07:00
jdrouhard
385a1facf2
docs: semantic token methods in :h lsp-method #23991 2023-06-11 14:48:57 -07:00
Stephan Seitz
ceb37ff1d8
refactor(treesitter): use npcall in _query_linter.lua #23985 2023-06-11 14:46:22 -07:00
zeertzjq
bde59e8147
fix(remote): restore previous --remote-expr output formatting (#23988)
- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.
2023-06-11 22:12:32 +08:00
Matthieu Coudron
dcb341315a
Merge pull request #23968 from figsoda/bundle
build(nix): use the correct versions of the bundled treesitter parsers
2023-06-11 15:38:30 +02:00
zeertzjq
72de8fdeeb
vim-patch:f1dcd14fc5d4 (#23986)
Update runtime files

f1dcd14fc5

:autocmd-block is N/A (Vim9 script)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 20:04:59 +08:00
Sean Dewar
473a216a21
vim-patch:10e8ff9b2607 (#23977)
Update runtime files

10e8ff9b26

Also:
- fix a missing `<` in builtin.txt.
- edit `:function` `{name}` wording to match the change made for the docs above
  by Justin in #10619.
- link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua`
  may also be used).

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 12:40:22 +01:00
Chinmay Dalal
643546b82b
feat(lsp): add handlers for inlay hints (#23736)
initial support; public API left for a follow-up PR
2023-06-11 11:53:37 +02:00
zeertzjq
cce9460524
fix(remote): make --remote-expr print to stdout (#23980) 2023-06-11 15:29:51 +08:00
zeertzjq
4229bbe514
fix(helptags): make multibyte help tags work properly (#23975) 2023-06-11 12:23:11 +08:00
zeertzjq
2237b384e4
vim-patch:9.0.1626: Visual area not shown when using 'showbreak' (#23978)
Problem:    Visual area not shown when using 'showbreak' and start of line is
            not visible. (Jaehwang Jung)
Solution:   Adjust "fromcol" for the space taken by 'showbreak'.
            (closes vim/vim#12514)

f578ca2c8f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 11:29:39 +08:00
Mathias Fußenegger
302d3cfb96
feat(lua): use callable table as iterator in vim.iter (#23957)
A table passed to `vim.iter` can be a class instance with a `__call`
implementation for the iterator protocol.
2023-06-10 20:33:23 +02:00
Raphael
b302da9ad2
fix(lsp): use percentage format on lsp.status (#23971) 2023-06-10 20:32:41 +02:00
dundargoc
c53953b400
ci: add runner image version to cache key
This will ensure the cache isn't used when an image upgrade changes the
compiler version, causing the build to fail.
2023-06-10 16:36:37 +02:00
zeertzjq
b6d2f49b45
test: more tests for nvim_{set,del}_keymap with abbreviation (#23970) 2023-06-10 10:44:31 +08:00
Jonas Strittmatter
7154f0c986
docs: fix typos (#23917) 2023-06-10 09:37:05 +08:00
Christian Clason
5959b3c922
vim-patch:9.0.1622: filetype name t32 is a bit obscure (#23967)
Problem:    Filetype name t32 is a bit obscure.
Solution:   Rename t32 to trace32. (Christoph Sax, closes vim/vim#12512)

740df76c90

Co-authored-by: Christoph Sax <christoph.sax@mailbox.org>
2023-06-09 23:48:31 +02:00
figsoda
8df3381202 build(nix): use the correct versions of the bundled treesitter parsers 2023-06-09 16:51:26 -04:00
figsoda
9eef2b111d build(nix): update flake.lock
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02)
  → 'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31)
• Added input 'flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/abe7316dd51a313ce528972b104f4f04f56eefc4' (2023-04-14)
  → 'github:nixos/nixpkgs/a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd' (2023-06-08)
2023-06-09 16:51:10 -04:00
bfredl
aaec9cdd85
Merge pull request #23803 from bfredl/luaabbr
feat(api): support abbreviations in nvim_set_keymap
2023-06-09 22:00:03 +02:00
bfredl
42bbc4fabc feat(api): support abbreviations in nvim_set_keymap
closes #19198
2023-06-09 21:25:43 +02:00
zeertzjq
49019da86e
vim-patch:9.0.1621: FILETYPE_FILE is defined to the same value multiple times (#23965)
Problem:    FILETYPE_FILE is defined to the same value multiple times.  Same
            for a few similar macros.
Solution:   Define FILETYPE_FILE and others in feature.h only

c81dfaa69c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-09 21:30:29 +08:00
zeertzjq
106922898a
vim-patch:9.0.1617: charidx() result is not consistent with byteidx() (#23963)
Problem:    charidx() and utf16idx() result is not consistent with byteidx().
Solution:   When the index is equal to the length of the text return the
            lenght of the text instead of -1. (Yegappan Lakshmanan,
            closes vim/vim#12503)

577922b917

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-09 17:43:46 +08:00
Mathias Fußenegger
e5e0bda41b
feat(lsp)!: add vim.lsp.status, client.progress and promote LspProgressUpdate (#23958)
`client.messages` could grow unbounded because the default handler only
added new messages, never removing them.

A user either had to consume the messages by calling
`vim.lsp.util.get_progress_messages` or by manually removing them from
`client.messages.progress`. If they didn't do that, using LSP
effectively leaked memory.

To fix this, this deprecates the `messages` property and instead adds a
`progress` ring buffer that only keeps at most 50 messages. In addition
it deprecates `vim.lsp.util.get_progress_messages` in favour of a new
`vim.lsp.status()` and also promotes the `LspProgressUpdate` user
autocmd to a regular autocmd to allow users to pattern match on the
progress kind.

Also closes https://github.com/neovim/neovim/pull/20327
2023-06-09 11:32:43 +02:00
Christian Clason
f31dba93f9
vim-patch:9.0.1620: Nix files are not recognized from the hashbang line (#23961)
Problem:    Nix files are not recognized from the hashbang line.
Solution:   Add a hashbang check. (issue vim/vim#12507)

19548c6a74

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-09 08:59:28 +02:00
Christian Clason
be539f5fa8
vim-patch:9.0.1618: Trace32 files are not recognized (#23960)
Problem:    Trace32 files are not recognized.
Solution:   Add patterns for the t32 filetype. (Christoph Sax, closes vim/vim#12505)

7fbcee6f92

Co-authored-by: Christoph Sax <christoph.sax@mailbox.org>
2023-06-08 21:53:16 +02:00
Mathias Fußenegger
7c661207cc
feat(lua): add ringbuffer (#22894)
https://en.wikipedia.org/wiki/Circular_buffer
2023-06-08 12:11:24 +02:00
zeertzjq
38b0bb3c93
vim-patch:9.0.1616: quickfix text field is truncated (#23951)
Problem:    Quickfix text field is truncated.
Solution:   Fix output of text field after pattern field in quickfix buffer.
            (Shane Harper, closes vim/vim#12498)

5bf042810b

Co-authored-by: Shane Harper <shane@shaneharper.net>
2023-06-08 07:03:22 +08:00
Christian Clason
0329f5c2f4
vim-patch:9.0.1615: URL shortcut files are not recognized (#23950)
Problem:    URL shortcut files are not recognized.
Solution:   Add a pattern for URL shortcut files. (closes vim/vim#12474)

cdb7b4c508

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-06-07 20:53:02 +02:00
Lewis Russell
c0952e62fd
feat(lua): add vim.system()
feat(lua): add vim.system()

Problem:

  Handling system commands in Lua is tedious and error-prone:
  - vim.fn.jobstart() is vimscript and comes with all limitations attached to typval.
  - vim.loop.spawn is too low level

Solution:

  Add vim.system().
  Partly inspired by Python's subprocess module
  Does not expose any libuv objects.
2023-06-07 13:52:23 +01:00
Lewis Russell
4ecc71f6fc
fix(lsp): reduce diagnostics and add more types (#23948) 2023-06-07 13:39:41 +01:00
Jonathon
0381f5af5b
feat(diff): grouping optimization for linematch algorithm 2023-06-07 13:29:23 +01:00
max397574
5f4895200a
feat(scripts): add lsp_types.lua (#23750) 2023-06-07 12:32:39 +01:00
Famiu Haque
a217675a67
refactor(options): use slash separator for option_get_valid_types() (#23945)
`option_get_valid_types()` currently uses a comma separator for
multi-type options which does not fit well with the changed error
message for invalid option value type. A slash seperator is much more
suited for its current use-case.
2023-06-07 10:51:24 +08:00
zeertzjq
fcaf0d5f38
Merge pull request #23943 from zeertzjq/autocmd-fname
fix(events): don't expand non-file as file name
2023-06-07 10:17:19 +08:00
zeertzjq
dd24ea8195 fix(events): don't expand non-file as file name 2023-06-07 09:49:17 +08:00
zeertzjq
971049f318 revert: "refactor: eliminate autocmd_fname_full global"
This reverts commit 82cd0be2ea.
2023-06-07 09:26:46 +08:00
zeertzjq
0e0a166a0c
refactor(api): adjust errors for setting options (#23942) 2023-06-07 09:00:55 +08:00
Famiu Haque
b3d5138fd0
refactor(options): remove getoption_T and introduce OptVal (#23850)
Removes the `getoption_T` struct and also introduces the `OptVal` struct
to unify the methods of getting/setting different option value types.
This is the first of many PRs to reduce code duplication in the Vim
option code as well as to make options easier to maintain. It also
increases the flexibility and extensibility of options. Which opens the
door for things like Array and Dictionary options.
2023-06-07 08:05:16 +08:00
dundargoc
0370e4def0
build!: remove neovim qt
Neovim QT was originally bundled on Windows as a response to the then
lackluster terminal options. The situation has dramatically changed,
with viable options such as Windows terminal, Alacritty and Wezterm to
name a few. The Windows build no longer needs this special treatment for
neovim to be usable.

Pros:
  - Release builds will be smaller.
  - Less maintenance burden.
  - Clearer separation of responsibility (neovim issues go to the neovim
    repo and neovim-qt issues to the neovim-qt repo).
  - More consistent treatment between platforms.

Cons:
  - Users who've come to expect neovim-qt to be bundled with nvim will
    need to adjust and download neovim-qt from
    https://github.com/equalsraf/neovim-qt instead.
  - Similarly, build scripts will need to be adjusted to reflect this
    change.

Closes https://github.com/neovim/neovim/issues/21209.
2023-06-06 19:19:00 +02:00