Commit Graph

26649 Commits

Author SHA1 Message Date
zeertzjq
3cd5ef63fd
vim-patch:9.0.1714: getcompletion() "cmdline" fails after :autocmd (#24727)
Problem:  getcompletion() "cmdline" fails after :autocmd
Solution: Use set_cmd_context() instead of set_one_cmd_context().

closes: vim/vim#12804

e4c79d3615
2023-08-16 06:07:01 +08:00
Gregory Anders
e72c0cd920
feat(highlight): Allow hyphens (-) in highlight group names (#24714)
Fixes: https://github.com/neovim/neovim/issues/23184
2023-08-15 09:25:51 -05:00
zeertzjq
fc14928719
fix(printf): make positional %zd and %zu work (#24722) 2023-08-15 20:54:28 +08:00
zeertzjq
842a47d6a4
vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting

closes: vim/vim#12140

0c6181fec4

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-15 19:16:19 +08:00
Christian Clason
7aad4643f9 fix(deps): remove stray conflict marker
fixup for 22d397c233
2023-08-15 12:32:20 +02:00
Christian Clason
22d397c233 build(deps): bump tree-sitter-lua to v0.0.19 2023-08-15 11:43:17 +02:00
zeertzjq
389165cac1
vim-patch:8.2.0066: some corners of vim_snprintf() are not tested (#24718)
Problem:    Some corners of vim_snprintf() are not tested.
Solution:   Add a test in C. (Dominique Pelle, closes vim/vim#5422)

d2c946bacf
2023-08-15 14:46:05 +08:00
Christian Clason
6d93bdd458 build(deps): bump tree-sitter-c to v0.20.6 2023-08-14 09:53:25 +02:00
zeertzjq
dd09630a21
vim-patch:9.0.1711: dead code in charset.c (#24706)
Problem: dead code in charset.c
Solution: remove it

linetabsize_col() calls init_chartabsize_arg() with 0 as "lnum", so
cts.cts_has_prop_with_text is always FALSE.

closes: #PR

d3515a1e88

N/A patches for version.c:
vim-patch:9.0.1702: Undo test is flaky
2023-08-14 06:47:51 +08:00
zeertzjq
fbc644ba31
vim-patch:9.0.1708: getcompletion() failes for user-defined commands (#24707)
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function

closes: vim/vim#12681
closes: vim/vim#12680

8ef1fbc0c3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-14 06:47:32 +08:00
zeertzjq
06bce8bf5c
test(terminal): fix scrollback test flakiness (#24708)
Problem:    Terminal scrollback test is flaky.
Solution:   Use INTERACT flag so the job doesn't exit immediately.
2023-08-14 06:47:09 +08:00
Christian Clason
fc0ee871de fix(treesitter)!: remove deprecated legacy injection format 2023-08-14 00:14:35 +02:00
Justin M. Keyes
006152ff7a
ci: run codeql on pull requests #24545
Also use cache to save 1 minute.
2023-08-13 12:11:39 -07:00
Christian Clason
11590543eb
Merge pull request #24681 from clason/update-c
feat(treesitter): update C parser and queries
2023-08-13 18:19:01 +02:00
zeertzjq
017ff93b02
fix(keycodes): recognize <t_xx> as a key (#24700)
Problem:    The result of keytrans() sometimes can't be translated back.
Solution:   Recognize <t_xx> as a key.
2023-08-13 22:14:48 +08:00
Sean Dewar
cbf54ec2a5
vim-patch:e978b4534a5e (#24697)
Farewell to Bram and dedicate upcoming Vim 9.1 to him (vim/vim#12749)

e978b4534a

Also update the header for the following files that were converted to Vim9
script upstream:

- autoload/ccomplete.lua (vim9jitted)
- ftplugin.vim
- ftplugof.vim
- indent.vim
- indent/vim.vim
- makemenu.vim

This also updates the "Last Change" dates, even if some changes (due to rewrites
to Vim9 script) were not ported.

There's still a few other places where Bram is still mentioned as a maintainer
in the files we and Vim have:

- ftplugin/bash.vim
- indent/bash.vim
- indent/html.vim
- indent/mail.vim
- macros/accents.vim
- macros/editexisting.vim
- syntax/bash.vim
- syntax/shared/typescriptcommon.vim
- syntax/tar.vim
- syntax/typescript.vim
- syntax/typescriptreact.vim
- syntax/zimbu.vim

Maybe future patches will address that.

Also exclude changes to .po files that didn't apply automatically (the
`:messages` maintainer string isn't used in Nvim anyway).

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-13 13:25:10 +01:00
Justin M. Keyes
0fe921663f
Merge #15440 close 'shell' :terminal automatically 2023-08-13 05:23:15 -07:00
Christian Clason
3836eeb901 feat(treesitter): update C queries from upstream 2023-08-13 12:30:47 +02:00
Christian Clason
c3dd84e76f build(deps): bump tree-sitter-c to v0.20.5 2023-08-13 12:30:47 +02:00
Lewis Russell
8179d68dc1 fix(treesitter): logger memory leak 2023-08-13 11:23:17 +01:00
Christian Clason
e3ce025e55 build(deps): bump luajit to HEAD - 72efc42ef 2023-08-13 11:55:12 +02:00
Christian Clason
380ffd6b7c vim-patch:9ad1bf7afd5c
runtime(pymanifest): fix mistake in syntax definition

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

9ad1bf7afd

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 11:53:51 +02:00
Christian Clason
a600ac5263 vim-patch:2f339aad6c80
Add syntax & ftplugin for pymanifest (vim/vim#12773)

2f339aad6c

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 11:53:51 +02:00
Christian Clason
4a936ad2dc vim-patch:f9c4c2f97db9
Update iss syntax file (vim/vim#11890)

- Add 'ExternalSize:' parameter
- Add 'setntfscompression' files flag
- Fix escaped left brace highlight
- Fix 'String:' parameter highlight
- Remove trailing whitespace

f9c4c2f97d

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 11:53:51 +02:00
Lewis Russell
d8e330bcec fix(test): remove test/compat.lua 2023-08-13 10:20:05 +01:00
shafouz
7b0123dd6a
feat(remote): avoid --remote-ui infinite loop (#24465) 2023-08-13 14:14:08 +08:00
zeertzjq
e551d623d2
build(vim-patch.sh): rename locale.c to os/lang.c (#24687) 2023-08-13 11:27:31 +08:00
zeertzjq
3ce3218fb4
build(vim-patch.sh): group co-authors together (#24686) 2023-08-13 10:34:25 +08:00
zeertzjq
165c4c9e57
vim-patch:cd4e4e169ab3 (#24685)
.cirrus.yml: skip pkg update for FreeBSD 13.1 (vim/vim#12767)

cd4e4e169a

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-13 07:34:23 +08:00
zeertzjq
d39361f5e0
vim-patch:9.0.1698: Test_map_restore_sid fails in GUI (#24682)
Problem: Test_map_restore_sid fails in GUI
Solution: Feed an unsimplified Ctrl-B

closes: vim/vim#12770

7fe1089904
2023-08-13 07:10:43 +08:00
zeertzjq
7542286d6a
vim-patch:9.0.1697: incsearch test not sufficient (#24683)
Problem: incsearch test not sufficient (after 9.0.1691)
Solution: add an additional test

73b8209266

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-13 07:10:24 +08:00
Lewis Russell
2ca076e45f feat(treesitter)!: incremental injection parsing
Problem:

Treesitter highlighting is slow for large files with lots of injections.

Solution:

Only parse injections we are going to render during a redraw cycle.

---

- `LanguageTree:parse()` will no longer parse injections by default and
  now requires an explicit range argument to be passed.

- `TSHighlighter` now parses injections incrementally during on_win
  callbacks for the line range being rendered.

- Plugins which require certain injections to be parsed must run
  `parser:parse({ start_row, end_row })` before using the tree.
2023-08-12 16:11:36 +01:00
Jaehwang Jung
5a25dcc5a4
fix(diff): filler lines for hunks bigger than linematch limit (#24676)
Apply linematch filler computation only if the hunk is actually
linematched.

Fixes #24580
2023-08-12 17:14:37 +08:00
Christian Clason
04aed08157 vim-patch:d8f981138aa0
Add commentstring for nix file format (vim/vim#12696)

d8f981138a

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2023-08-12 11:01:05 +02:00
zeertzjq
58a1ef8e6a
fix(events): avoid unnecessary CursorMoved (#24675)
Problem:    Temporarily changing current window in a script causes
            CursorMoved to be triggerd.
Solution:   Don't trigger CursorMoved if neither curwin nor cursor
            changed between two checks.
2023-08-12 09:50:17 +08:00
zeertzjq
6c07a189f2
vim-patch:9.0.1688: cannot store custom data in quickfix list (#24673)
Problem: cannot store custom data in quickfix list
Solution: add `user_data` field for the quickfix list

closes: vim/vim#11818

ca6ac99077

Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
2023-08-12 08:19:06 +08:00
zeertzjq
72cf94fc0e
vim-patch:9.0.1694: wrong mapping applied when replaying a char search (#24670)
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC

closes: vim/vim#12708
closes: vim/vim#6350

bacc83009b
2023-08-12 06:50:52 +08:00
zeertzjq
8c5d81997e
vim-patch:9.0.1693: Ctrl-Q not handled like Ctrl-V in replace mode (#24669)
Problem: Ctrl-Q not handled like Ctrl-V in replace mode
Solution: Handle Ctrl-Q like Ctrl-V

closes: vim/vim#12686
closes: vim/vim#12684

2d63e4b3cc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-12 06:41:23 +08:00
zeertzjq
8f9c5ee5ef
vim-patch:9.0.1691: wrong viewport restored for incsearch and smoothscroll (#24667)
Problem: wrong viewport restored for incsearch and smoothscroll
Solution: Save and restore skipcol as well

closes: vim/vim#12713

7b7b4cb6f2
2023-08-12 06:32:13 +08:00
zeertzjq
713311be62
vim-patch:9.0.1687: mapset() not properly handling script ID (#24666)
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID

closes: vim/vim#12699
closes: vim/vim#12697

7e0bae024d
2023-08-12 06:08:07 +08:00
zeertzjq
6e0c36ba0e
vim-patch:9.0.1686: undotree() only works for the current buffer (#24665)
Problem:    undotree() only works for the current buffer
Solution:   Add an optional "buffer number" parameter to undotree().  If
            omitted, use the current buffer for backwards compatibility.

closes: vim/vim#4001
closes: vim/vim#12292

5fee111149

Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
2023-08-12 05:51:49 +08:00
Christian Clason
278805dfac vim-patch:21aaff3faa82
Update my name and email in runtime files (vim/vim#12763)

21aaff3faa

Co-authored-by: Lily Ballard <lily@ballards.net>
2023-08-11 22:06:37 +02:00
Christian Clason
35c8ad1c80 vim-patch:dd0ad2598898
Update syntax/dosini.vim to the latest version (vim/vim#12764)

The latest version is in https://github.com/xuhdev/syntax-dosini.vim/blob/master/syntax/dosini.vim. I've sent the file to Bram at the end of June, unfortunately it wasn't able to make into the Vim repository. RIP!

dd0ad25988

Co-authored-by: Hong Xu <hong@topbug.net>
2023-08-11 22:06:37 +02:00
Christian Clason
31c4ed26bc
feat(treesitter): add injection language fallback (#24659)
* feat(treesitter): add injection language fallback

Problem: injection languages are often specified via aliases (e.g.,
filetype or in upper case), requiring custom directives.

Solution: include lookup logic (try as parser name, then filetype, then
lowercase) in LanguageTree itself and remove `#inject-language`
directive.

Co-authored-by: Lewis Russell <me@lewisr.dev>
2023-08-11 17:05:17 +02:00
Raphael
72e64a1afe
fix(lsp): extra "." when completing with tsserver #24646
Problem:
With tsserver LSP, omni completion after "." inserts an extra "."

Solution:
Apply adjust_start_col() regardless of `filterText`.
adjust_start_col() is explained here:
0ea8dfeb3d/runtime/lua/vim/lsp.lua (L2334-L2351)

The `filterText` field is used in the following situations rather than as
a condition for obtaining column values:
1. Real-time filtering: When the user types characters in the editor, the
   language server can use the filterText field to filter the list of
   suggestions and only return suggestions that match the typed characters. This
   helps to provide more precise recommendations.
2. Fuzzy matching: The filterText field can be used to perform fuzzy matching,
   allowing matching in the middle or beginning of input characters, not limited
   to prefix matching. This can provide a more flexible code completion
   experience.

Inspecting usage of `filtertext` in vim-lsp and coc and lsp-mode:
- vim-lsp uses a `refresh_pattern` to judge filterText as completionitem word
  (although I think this is not the correct usage).
- coc uses it for filtering.

Fix #22803
2023-08-11 05:20:05 -07:00
Gregory Anders
3fb372eba4 Use Lua autocommand and make TermClose autocommand global 2023-08-10 09:53:56 -05:00
Gregory Anders
6e703f778f fix: handle argv not present in nvim_get_chan_info 2023-08-10 09:08:26 -05:00
Gregory Anders
673ee213e9 test: update tests for auto-closing :term buffers
The terminal buffer closes automatically when using `:terminal` and the
command exits without an error. This messes up some tests that expect
the terminal buffer to still be open. We can force the buffer not to
close by passing an argument to `:terminal`. This can be anything, since
the shell-test stub simply prints whatever argument it's given.
2023-08-10 09:08:25 -05:00
Gregory Anders
0c89854da1 feat(terminal): close shell terminals automatically
When starting a terminal buffer that uses the default value of &shell
(e.g. when using `:terminal` or `termopen([&shell])`), automatically
close the buffer if the shell exits without an error.
2023-08-10 09:06:10 -05:00
zeertzjq
3d948a4dc4
vim-patch:9.0.1683: Updated runtime files (#24638)
This is a collection of various PRs from github that all require a minor
patch number:

1) https://github.com/vim/vim/pull/12612

    Do not conflate dictionary key with end of block

2) https://github.com/vim/vim/pull/12729:

    When saving and restoring 'undolevels', the constructs `&undolevels` and
    `:set undolevels` are problematic.

    The construct `&undolevels` reads an unpredictable value; it will be the
    local option value (if one has been set), or the global option value
    (otherwise), making it unsuitable for saving a value for later
    restoration.

    Similarly, if a local option value has been set for 'undolevels',
    temporarily modifying the option via `:set undolevels` changes the local
    value as well as the global value, requiring extra work to restore both
    values.

    Saving and restoring the option value in one step via the construct
    `:let &undolevels = &undolevels` appears to make no changes to the
    'undolevels' option, but if a local option has been set to a different
    value than the global option, it has the unintended effect of changing
    the global 'undolevels' value to the local value.

    Update the documentation to explain these issues and recommend explicit
    use of global and local option values when saving and restoring.  Update
    some unit tests to use `g:undolevels`.

3) https://github.com/vim/vim/pull/12702:

    Problem:    Pip requirements files are not recognized.
    Solution:   Add a pattern to match pip requirements files.

4) https://github.com/vim/vim/pull/12688:

    Add indent file and tests for ABB Rapid

5) https://github.com/vim/vim/pull/12668:

    Use Lua 5.1 numeric escapes in tests and add to CI

    Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings.  Lua
    5.1 only supports decimal escapes:

    > A character in a string can also be specified by its numerical value
    > using the escape sequence \ddd, where ddd is a sequence of up to three
    > decimal digits. (Note that if a numerical escape is to be followed by a
    > digit, it must be expressed using exactly three digits.) Strings in Lua
    > can contain any 8-bit value, including embedded zeros, which can be
    > specified as '\0'.

    To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to
    run with Lua 5.1 as well as Lua 5.4

6) https://github.com/vim/vim/pull/12631:

    Add hurl filetype detection

7) https://github.com/vim/vim/pull/12573:

    Problem:   Files for haskell persistent library are not recognized
    Solution:  Add pattern persistentmodels for haskell persistent library

closes: vim/vim#12612
closes: vim/vim#12729
closes: vim/vim#12702
closes: vim/vim#12688
closes: vim/vim#12668
closes: vim/vim#12631
closes: vim/vim#12573

Already ported but wasn't marked: vim-patch:ad34abee2583

6efb198033

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: lacygoill <lacygoill@lacygoill.me>
Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev>
Co-authored-by: Borys Lykah <lykahb@fastmail.com>
2023-08-10 17:45:36 +08:00