Commit Graph

24464 Commits

Author SHA1 Message Date
zeertzjq
f4e03cbdbc
vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)
Problem:    Cannot read back what setcellwidths() has done.
Solution:   Add getcellwidths(). (Kota Kato, closes vim/vim#11837)

66bb9ae70f

Co-authored-by: Kota Kato <github@kat0h.com>
2023-01-18 06:50:22 +08:00
Lewis Russell
20b7be2d10
fix(treesitter): really restore syntax
- also unset b:ts_highlight on stop()

Fixes: #21836
2023-01-17 16:56:23 +00:00
dundargoc
0344bfad0f
refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
2023-01-17 21:17:40 +08:00
zeertzjq
99186508d9
Merge pull request #21859 from zeertzjq/vim-8.2.4617
vim-patch:8.2.{4617,4618,4620,5126}
2023-01-17 20:49:08 +08:00
zeertzjq
c416da9d1a vim-patch:8.2.5126: substitute may overrun destination buffer
Problem:    Substitute may overrun destination buffer.
Solution:   Disallow switching buffers in a substitute expression.

d6211a52ab

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 20:26:12 +08:00
zeertzjq
8aece0089d vim-patch:8.2.4618: cmdline completion does not recognize single letter commands
Problem:    Command line completion does not recognize single letter commands.
Solution:   Use the condition from find_ex_command().

f4f0525c34

vim-patch:8.2.4620: two letter substitute commands don't work

Problem:    Two letter substitute commands don't work. (Yegappan Lakshmanan)
Solution:   Invert condition.

1e2c4175dc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 20:26:12 +08:00
zeertzjq
3db2139195 vim-patch:8.2.4617: no completion for :scriptnames
Problem:    No completion for :scriptnames.
Solution:   Implement :scriptnames completion. (Yegappan Lakshmanan,
            closes vim/vim#10005)

454ce6737c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 20:26:06 +08:00
Christian Clason
2d71ed9929
build(deps): bump tree-sitter to HEAD - eb970a83a (#21858)
includes efd22e452b which fixes some errors around infinite loops with injections
2023-01-17 12:57:06 +01:00
zeertzjq
132f001ce8
vim-patch:8.2.4483: command completion makes two rounds to collect matches (#21857)
Problem:    Command completion makes two rounds to collect matches.
Solution:   Use a growarray to collect matches. (Yegappan Lakshmanan,
            closes vim/vim#9860)

5de4c4372d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 19:52:02 +08:00
zeertzjq
ddd69a6c81
vim-patch:8.2.4959: using NULL regexp program (#21855)
Problem:    Using NULL regexp program.
Solution:   Check for regexp program becoming NULL in more places.

b62dc5e782

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 17:02:25 +08:00
zeertzjq
b4d669e7ac
vim-patch:8.2.4928: various white space and cosmetic mistakes (#21854)
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.

6ed545e797

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 16:53:37 +08:00
zeertzjq
58f2dcfc88
vim-patch:8.2.4917: fuzzy expansion of option names is not right (#21853)
Problem:    Fuzzy expansion of option names is not right.
Solution:   Pass the fuzzy flag down the call chain. (Christian Brabandt,
            closes vim/vim#10380, closes vim/vim#10318)

cb747899bd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-01-17 16:46:43 +08:00
zeertzjq
8abf53be6e
vim-patch:9.0.0089: fuzzy argument completion doesn't work for shell commands (#21852)
Problem:    Fuzzy argument completion doesn't work for shell commands.
Solution:   Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan,
            closes vim/vim#10769)

7db3a8e329

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 16:28:15 +08:00
zeertzjq
fc692dfce1
Merge pull request #21851 from zeertzjq/vim-8.2.4482
vim-patch:8.2.{4482,4485}: fuzzy cmdline custom completion
2023-01-17 16:16:44 +08:00
zeertzjq
d512678739 fix(completion): correct what modes support fuzzy completion 2023-01-17 15:55:58 +08:00
zeertzjq
441d13eae5 vim-patch:8.2.4482: no fuzzy cmdline completion for user defined completion
Problem:    No fuzzy cmdline completion for user defined completion.
Solution:   Add fuzzy completion for user defined completion. (Yegappan
            Lakshmanan, closes vim/vim#9858)

afd4ae35d6

Cherry-pick related docs from Vim runtime.

N/A patches for version.c:

vim-patch:8.2.4485: compiler warning for uninitialized variable
vim-patch:8.2.4732: duplicate code to free fuzzy matches

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 15:55:58 +08:00
zeertzjq
2093e574c6
Merge pull request #21850 from zeertzjq/vim-8.2.4463
vim-patch:8.2.{4463,4465,4475,4477,4478,4479,4608}: fuzzy cmdline builtin completion
2023-01-17 14:34:27 +08:00
zeertzjq
15e42dd449 vim-patch:8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Problem:    getcompletion() does not work properly when 'wildoptions
            contains "fuzzy".
Solution:   Do not use addstar(). (Yegappan Lakshmanan, closes vim/vim#9992,
            closes vim/vim#9986)

e7dd0fa2c6

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
zeertzjq
5ce6685119 vim-patch:8.2.4479: no fuzzy completieon for maps and abbreviations
Problem:    No fuzzy completieon for maps and abbreviations.
Solution:   Fuzzy complete maps and abbreviations. (Yegappan Lakshmanan,
            closes vim/vim#9856)

6caeda2fce

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
zeertzjq
245522db1e vim-patch:8.2.4478: crash when using fuzzy completion
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes vim/vim#9852, closes vim/vim#9851)

00333cb3b3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
zeertzjq
bdd14d03c7 vim-patch:8.2.4477: crash when using fuzzy completion
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes vim/vim#9851)

29ab6ce9f3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 14:01:26 +08:00
zeertzjq
4c127f107a vim-patch:8.2.4475: fuzzy cmdline completion does not work for lower case
Problem:    Fuzzy cmdline completion does not work for lower case.
Solution:   Also use fuzzy completion for lower case input. (Yegappan
            Lakshmanan, closes vim/vim#9849)

4df5b33f20

Initialize "regmatch" to avoid using uninitialized memory.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
Sean Dewar
0c689fec8e vim-patch:8.2.4465: fuzzy completion does not order matches properly
Problem:    Fuzzy completion does not order matches properly.
Solution:   Do not use regular expression match. (Yegappan Lakshmanan,
            closes vim/vim#9843)

5ec633b9b0

Nvim's ExpandGeneric() was refactored to eliminate looping for "round",
so the patch has been adapted.

fuzzy_match_str() change was already applied earlier.

In Test_wildoptions_fuzzy(), test for NvimParenthesis over MatchParen
for :syntax list, as the fuzzy matching algorithm prefers the former
(even in Vim).

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
Sean Dewar
6734dd2503 vim-patch:8.2.4463: completion only uses strict matching
Problem:    Completion only uses strict matching.
Solution:   Add the "fuzzy" item for 'wildoptions'. (Yegappan Lakshmanan,
            closes vim/vim#9803)

38b85cb4d7

Use MAX_FUZZY_MATCHES in fuzzy_match_str().
Omit fuzmatch_str_free() as it is only used on allocation failure.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:10 +08:00
zeertzjq
34e62d3875 refactor: remove char_u from arguments of fuzzy_match()
Also change some single quotes to double quotes.
2023-01-17 12:48:31 +08:00
luukvbaal
f6929ea51d
fix(tabline): avoid memory leak in tabline click definitions (#21847)
Problem:    Memory is leaked in tabline click definitions since
            https://github.com/neovim/neovim/pull/21008.
Solution:   Add back a call to `stl_clear_click_defs()` that was lost in
            the refactor PR.
2023-01-17 09:51:01 +08:00
Justin M. Keyes
6c2f02cbd0 fix: failing XDG test on Windows CI
Problem:
Failing Windows CI:
    FAILED   test/functional\options\defaults_spec.lua @ 361: XDG defaults with too long XDG variables are correctly set
    test\helpers.lua:134: Pattern "Failed to start server: no such file or directory: /X/X/X" not found in log (last 10 lines): Xtest-defaults-log:
    FAILED   test/functional\options\defaults_spec.lua @ 435: XDG defaults with XDG variables that can be expanded are not expanded
    test\helpers.lua:134: Pattern "Failed to start server: no such file or directory: %$XDG_RUNTIME_DIR%/" not found in log (last 10 lines): Xtest-defaults-log:

Solution:
The assert_log() statements are not relevant on Windows, because there
XDG_RUNTIME_DIR is not used for creating servers, it uses \\.pipe\….
2023-01-17 01:57:52 +01:00
zeertzjq
f72cb97fa0
vim-patch:9.0.1208: code is indented more than necessary (#21846)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11819)

a41e221935

Cherry-pick check_text_or_curbuf_locked() from patch 9.0.0947.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 08:09:51 +08:00
Brian Koropoff
bbdded5cf7
test(statuscolumn): %l should follow default wrap behavior (#21766) 2023-01-17 08:02:33 +08:00
dundargoc
2302ca4700
refactor: fix sign conversion warning from gcc (#21833) 2023-01-17 07:43:04 +08:00
Justin M. Keyes
7ebb1cf28f
Merge #21844 test: avoid noise in test logs 2023-01-16 18:38:20 -05:00
luukvbaal
da3460562e
fix(api): avoid memory leak with click functions in nvim_eval_statusline() (#21845)
Problem:    Allocated click function memory is lost due to
            `nvim_eval_statusline()` not passing in a `StlClickRecord`.
Solution:   Do not allocate click function memory if `tabtab == NULL`.

Resolve #21764, supersede #21842.
2023-01-17 07:31:36 +08:00
Justin M. Keyes
665a7dafaf refactor(tests): lift retry() into assert_log() 2023-01-17 00:19:30 +01:00
Justin M. Keyes
6ec7bcb618 test: avoid noise in NVIM_LOG_FILE
Problem:
Tests that _intentionally_ fail certain conditions cause noise in
$NVIM_LOG_FILE:

    $NVIM_LOG_FILE: /home/runner/work/neovim/neovim/build/.nvimlog
    (last 100 lines)
    WRN 2023-01-16T18:26:27.673 T599.7799.0 unsubscribe:519: RPC: ch 1: tried to unsubscribe unknown event 'doesnotexist'
    WRN 2023-01-16T18:29:00.557 ?.11151    server_start:163: Failed to start server: no such file or directory: /X/X/X/...
    WRN 2023-01-16T18:33:07.269 127.0.0.1:12345 server_start:163: Failed to start server: address already in use: 127.0.0.1
    ...
    -- Output to stderr:
    module 'vim.shared' not found:
    	no field package.preload['vim.shared']
    	no file './vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared/init.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared/init.lua'
    	no file './vim/shared.so'
    	...
    E970: Failed to initialize builtin lua modules

Solution:
- Log to a private $NVIM_LOG_FILE in tests that intentionally fail and
  cause ERR log messages.
- Assert that the expected messages are actually logged.
2023-01-16 23:56:56 +01:00
zeertzjq
9ccc6de8d3
Merge pull request #21768 from luukvbaal/test-virtline
fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines

BREAKING CHANGE: In 'statuscolumn' evaluation, `v:wrap` has been
replaced by `v:virtnum`. `v:virtnum` is negative when drawing
virtual lines, zero when drawing the actual buffer line, and
positive when drawing the wrapped part of a buffer line.
2023-01-17 06:24:52 +08:00
Sean Dewar
1484995a1e
Merge pull request #21839 from seandewar/lua-health-fix
feat(health): detect tmux RGB support via `client_termfeatures`
2023-01-16 18:23:44 +00:00
Christian Clason
d8eb99e363
Merge pull request #21828 from clason/bump-libvterm
build(deps): bump libvterm to v0.3.1
2023-01-16 19:04:24 +01:00
Christian Clason
7295ed1f6f build(deps): bump libvterm to v0.3.1
Included patches:

821. By Paul "LeoNerd" Evans on 2022-12-29
Don't bother to emit the unrecognised sequence in DECRQSS response as it provides an echo roundtrip possibility

820. By Paul "LeoNerd" Evans on 2022-11-26
erase_internal() should only set fg/bg colour, resetting other attributes (especially RV)

819. By Paul "LeoNerd" Evans on 2022-11-09
Added vterm_screen_set_default_colors(), which repaints the cells in the buffer(s)

818. By Paul "LeoNerd" Evans on 2022-11-09
Permit either colour argument to be NULL to vterm_state_set_default_colors()

817. By Paul "LeoNerd" Evans on 2022-10-01
Delete the mk_wcswidth functions as they're not used; guard the CJK-wide one with an ifdef as by default we don't use it

816. By Paul "LeoNerd" Evans on 2022-10-01
Make sure to supply empty (void) prototype to functions that take no arguments in bin/vterm-ctrl.c
2023-01-16 18:40:19 +01:00
Sean Dewar
7e24c45221
feat(health): detect tmux RGB support via client_termfeatures
Problem: On tmux v3.2+, the `terminal-features` option may be used to enable RGB
capabilities over `terminal-overrides`. However, `show-messages` cannot be used
to detect if RGB capabilities are enabled using `terminal-features`.

Solution: Try to use `display-message -p #{client_termfeatures}` instead.
The returned features include "RGB" if either "RGB" is set in
`terminal-features`, or if "Tc" or "RGB" is set in `terminal-overrides` (as
before).
Nothing is returned by tmux versions older than v3.2, so fallback to checking
`show-messages` in that case.

Also, un-Vimscriptify the previous logic a bit, and change the error message to
point to using the `terminal-features` option instead for newer tmux versions.
2023-01-16 15:30:57 +00:00
Sean Dewar
60df0c0651
fix(health): fix tmux_esc_time comparison
Regression from the health.vim to .lua changes.

Unlike Vim script, Lua does not implicitly convert strings to numbers, so this
comparison threw an error.
2023-01-16 14:26:29 +00:00
Luuk van Baal
54470336ff fix(column): avoid drawing columns for virt_lines_leftcol
Problem:    The default fold column, as well as the 'statuscolumn', were
            drawn unnecessarily/unexpectedly for virtual lines placed
            with `virt_lines_leftcol` set.
Solution:   Skip the column states if a virtual line with
            `virt_lines_leftcol` set will be drawn.
2023-01-16 15:09:12 +01:00
Luuk van Baal
85111ca0f4 fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines
Problem:    The `'statuscolumn'` was not re-evaluated for wrapped lines,
            when preceded by virtual/filler lines. There was also no way
            to distinguish virtual and wrapped lines in the status column.
Solution:   Make sure to rebuild the statuscolumn, and replace variable
            `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing
            virtual lines, zero when drawing the actual buffer line, and
            positive when drawing the wrapped part of a buffer line.
2023-01-16 14:03:09 +01:00
Ching Pei Yang
ef89f9fd46
docs: treesitter.add_directive, add_predicate #21206 2023-01-16 04:39:19 -08:00
Raphael
9e1d2e2ca7
build(deps): bump LuaJIT to HEAD - d0e88930d
build(deps): bump LuaJIT to HEAD-d0e88930d

 Don't fail for Clang builds, which pretend to be an ancient GCC.
 Fix compiler warning.
2023-01-16 12:10:42 +00:00
zeertzjq
e7ea156604
Merge pull request #20945 from erw7/feat-more-exception-info
feat(api): show more exception info
2023-01-16 19:28:17 +08:00
bfredl
90493beb15
Merge pull request #21831 from bfredl/nofd
fix(ui): re-organize tty fd handling and fix issues
2023-01-16 11:55:34 +01:00
Justin M. Keyes
2773685c1d
Merge #21175 exepath() with powershell 2023-01-16 05:28:56 -05:00
Justin M. Keyes
e5b9485eac test: align Test_shell_options, Test_shellslash with Nvim default
'shellxquote' Nvim default was adjusted in: 131aad953c
The use of "/s" is different than Vim, and may avoid the need for `shellxquote="&|<>()@^`.

For the other shells, Nvim intentionally does not fiddle with the
various "shell*" options if 'shell' is set by the user: if the user sets
'shell', they are expected to set other "shell*" options correctly.
2023-01-16 11:27:35 +01:00
Justin M. Keyes
7360dda670 vim-patch:8.2.3071: shell options are not set properly for PowerShell
(Most of this patch is intentionally dropped, it adds far too much
special-cases for almost zero purpose: ":help shell-powershell" makes it
easy to choose powershell without spreading special-cases throughout the
codebase, randomly changing slash behavior, etc.)

Problem:    Shell options are not set properly for PowerShell.
Solution:   Use better option defaults. (Mike Willams, closes vim/vim#8459)

127950241e

Co-authored-by: Mike Williams <mikew@globalgraphics.com>
2023-01-16 11:27:35 +01:00
Justin M. Keyes
26d6e27973 vim-patch:8.2.3070: not enough testing for shell use
Problem:    Not enough testing for shell use.
Solution:   Add a bit more testing. (Yegappan Lakshmanan, closes vim/vim#8469)

ffec6dd16a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-16 11:27:35 +01:00