Commit Graph

26365 Commits

Author SHA1 Message Date
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
Gregory Anders
fcfe535e98
refactor(defaults): do not use C specific default values for options (#22500)
The options 'path', 'include', and 'define' all use C-specific default
values. This may have made sense a long time ago when Vim was mostly
used just for writing C, but this is no longer the case, and we have
ample support for filetype specific configuration. Make the default
values of these options empty and move the C-specific values into a
filetype plugin where they belong.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-06 11:26:29 -05:00
Alexandre Teoi
4382d2ed56
feat(health): fold successful healthchecks #22866
Problem:
checkhealth can be noisy, but we don't want to omit info.

Solution:
Fold OK results by default, if 'foldenable' is enabled.
Resolves #22796
2023-06-06 08:42:26 -07:00
zeertzjq
9d9af4fe27
vim-patch:9.0.1614: strlen() called too often for :spellrepall (#23940)
Problem:    strlen() called too often for :spellrepall.
Solution:   Store the result in a variable. (closes vim/vim#12497)

59f7038536
2023-06-06 23:31:29 +08:00
Justin M. Keyes
c48b1421af
refactor!: rename "playground" => "dev" #23919
Problem:
"playground" is new jargon that overlaps with existing concepts:
"dev" (`:help dev`) and "view" (also "scratch" `:help scratch-buffer`) .

Solution:
We should consistently use "dev" as the namespace for where "developer
tools" live. For purposes of a "throwaway sandbox object", we can use
the name "view".
- Rename `TSPlayground` => `TSView`
- Rename `playground.lua` => `dev.lua`
2023-06-06 08:23:20 -07:00
Famiu Haque
175e5c8b96
refactor(api): remove BOOL macro #23936
Remove redundant `BOOL` macro that does the same thing as `BOOLEAN_OBJ`.
2023-06-06 07:18:55 -07:00
Gianmaria Bajo
ca887b80a9
fix: version-range < and <= #23539
vim.version.range() couldn't parse them correctly.
For example, vim.version.range('<0.9.0'):has('0.9.0') returned `true`.

fix: range:has() accepts vim.version()
So that it's possible to compare a range with:

    vim.version.range(spec):has(vim.version())
2023-06-06 06:38:45 -07:00
dundargoc
f5d12889e8
refactor: adjust headers according to the style guide (#23934)
System headers should be included first to prevent naming conflicts.
2023-06-06 20:00:32 +08:00
zeertzjq
7b973c71ea
fix(statusline): redraw when VIsual_mode changes (#23933) 2023-06-06 19:24:42 +08:00
zeertzjq
780ab11b90
vim-patch:partial:8.2.4950: text properties position wrong after shifting text (#23930)
Problem:    Text properties position wrong after shifting text.
Solution:   Adjust the text properties when shifting a block of text.
            (closes vim/vim#10418)

4b93674159

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-06-06 11:15:27 +08:00
zeertzjq
eceb2dffce
fix(spell): splice extmarks on :spellrepall (#23929) 2023-06-06 10:32:30 +08:00
Gregory Anders
43f3209b07
vim-patch:9.0.1613: some make output gets picked up by 'errorformat' (#23926)
Problem:    Some make output gets picked up by 'errorformat'.
Solution:   Ignore make output by default. (Gregory Anders, closes vim/vim#12481)

d1911a8e2b
2023-06-05 20:36:21 -05:00
zeertzjq
9deef1aa22
vim-patch:9.0.1612: "skipcol" not reset when using multi-byte characters (#23928)
Problem:    "skipcol" not reset when using multi-byte characters.
Solution:   Compare with w_virtcol instead of w_cursor.col. (closes vim/vim#12457)

15d4747ffd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-06 07:13:08 +08:00
zeertzjq
30e9ddfd05
Merge pull request #23927 from zeertzjq/vim-9.0.1603
vim-patch:9.0.{1603,1610}: display wrong if scrolling multiple lines with 'smoothscroll'
2023-06-06 06:59:48 +08:00
zeertzjq
fc908b5006 vim-patch:9.0.1610: display is wrong when 'smoothscroll' is set
Problem:    Display is wrong when 'smoothscroll' is set and scrolling multiple
            lines.
Solution:   Redraw with UPD_NOT_VALID when "skipcol" is or was set.
            (closes vim/vim#12490, closes vim/vim#12468)

d9a92dc70b
2023-06-06 06:37:27 +08:00
zeertzjq
9978a9996d vim-patch:9.0.1603: display wrong if scrolling multiple lines with 'smoothscroll'
Problem:    Display wrong when scrolling multiple lines with 'smoothscroll'
            set.
Solution:   Redraw when w_skipcol changed. (closes vim/vim#12477, closes vim/vim#12468)

3c80227760
2023-06-06 06:37:23 +08:00
Lewis Russell
c1ee187f82
fix: vim.loop in luv threads (#23924)
Fixes #23914
2023-06-05 19:08:01 +01:00
Gregory Anders
cbbda3bcd7
fix(editorconfig): check that buffer is valid (#23922)
Fixes: https://github.com/neovim/neovim/issues/23921
2023-06-05 11:53:13 -05:00
luukvbaal
f959753e5c
vim-patch:9.0.1608: update_topline() is called twice (#23920)
Problem:    update_topline() is called twice.
Solution:   Do not call update_topline() before curs_columns(). (Luuk van
            Baal, closes vim/vim#12495)

5c606846b9
2023-06-05 22:45:33 +08:00
Gregory Anders
ca26ec3438
fix(lsp): use only utf-16 in default client positionEncodings (#23903)
The Nvim client does not yet support multiple offset encodings for
clients in the same buffer. Until it does, stick to utf-16 by default.
2023-06-05 08:21:23 -05:00