Commit Graph
14791 Commits
Author SHA1 Message Date
bfredl 0a96f18ed7 Merge pull request #21033 from bfredl/winfix
fix(ui): fix some cases of stale highlight definitions
2022-11-13 10:53:59 +01:00
bfredl d7e7578ada fix(ui): fix some cases of stale highlight definitions
fixes #20695
2022-11-13 10:20:28 +01:00
bfredl c4f84fc2e2 Merge pull request #20984 from notomo/fix-message-kind-on-history
fix(ui-ext): correct message kind in history before vim.ui_attach()
2022-11-13 09:53:02 +01:00
zeertzjqandNir Lichtman 9d7dc50628 vim-patch:9.0.0865: duplicate arguments are not always detected (#21036)
Problem:    Duplicate arguments are not always detected.
Solution:   Expand to full path before comparing arguments. (Nir Lichtman,
            closes vim/vim#11505, closes vim/vim#9402)

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

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2022-11-13 08:35:15 +08:00
zeertzjqandYegappan Lakshmanan 849394e4e2 vim-patch:9.0.0863: col() and charcol() only work for the current window (#21038)
Problem:    col() and charcol() only work for the current window.
Solution:   Add an optional winid argument. (Yegappan Lakshmanan,
            closes vim/vim#11466, closes vim/vim#11461)

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

Cherry-pick test_functions.vim change from patch 8.2.0633.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-13 08:29:05 +08:00
zeertzjqandBram Moolenaar ec449c27fd vim-patch:9.0.0867: wildmenu redrawing code is spread out (#21035)
Problem:    Wildmenu redrawing code is spread out.
Solution:   Refactor to move code together. (closes vim/vim#11528)

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

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 08:20:00 +08:00
zeertzjqandBram Moolenaar b251972580 vim-patch:9.0.0869: bogus error when string used after :elseif
Problem:    Bogus error when string used after :elseif.
Solution:   Do not consider a double quote the start of a comment.
            (closes vim/vim#11534)

https://github.com/vim/vim/commit/28c56d501352bd98472d23667bade683877cadcc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:30:05 +08:00
zeertzjqandBram Moolenaar bc1dbebe1f vim-patch:8.2.4676: test fails with different error
Problem:    Test fails with different error.
Solution:   Add argument for :elseif.

https://github.com/vim/vim/commit/292e1b9f681054a1de8fa22315ae6eedd7acb205

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:30:05 +08:00
zeertzjqandBram Moolenaar 2cb0860117 vim-patch:8.2.4675: no error for missing expression after :elseif
Problem:    No error for missing expression after :elseif. (Ernie Rael)
Solution:   Check for missing expression. (closes vim/vim#10068)

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

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:21:22 +08:00
zeertzjq 47ad4c8701 vim-patch:9.0.0866: no test for what patch 8.2.2207 fixes (#21034)
Problem:    No test for what patch 8.2.2207 fixes.
Solution:   Add a test case. (closes vim/vim#11531)

https://github.com/vim/vim/commit/f7570f2107d91f35dc67dd0e400fc638585b226c
2022-11-13 07:06:37 +08:00
zeertzjqandBram Moolenaar 7abe8ef422 vim-patch:9.0.0862: default value of 'endoffile' is wrong (#21032)
Problem:    Default value of 'endoffile' is wrong.
Solution:   The default must be 'noendoffile'.

https://github.com/vim/vim/commit/0aad88f073602849d1623122eb3c323f8e252def

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 23:31:17 +08:00
Thomas Vigouroux 7e6d785d19 feat(extmarks): allow preventing spellchecking with spell = false 2022-11-12 10:19:01 +00:00
zeertzjqandshane.xb.qian 7335a67b57 vim-patch:9.0.0845: shell command with just space gives strange error (#21029)
Problem:    Shell command with just space gives strange error.
Solution:   Skip white space at start of the argument. (Christian Brabandt,
            Shane-XB-Qian, closes vim/vim#11515, closes vim/vim#11495)

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

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2022-11-12 12:29:16 +08:00
zeertzjqandBram Moolenaar 2425fe2dc5 vim-patch:8.2.2207: illegal memory access if popup menu items are changed (#21028)
Problem:    Illegal memory access if popup menu items are changed while the
            menu is visible. (Tomáš Janoušek)
Solution:   Make a copy of the text. (closes vim/vim#7537)

https://github.com/vim/vim/commit/38455a921395a56690790c8c1d28c1c43ca04c8a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 09:57:29 +08:00
zeertzjqandBram Moolenaar eee9560516 vim-patch:9.0.0861: solution for "!!sort" in closed fold is not optimal (#21027)
Problem:    Solution for "!!sort" in closed fold is not optimal.
Solution:   Use a different range instead of the subtle difference in handling
            a range with an offset. (issue vim/vim#11487)

https://github.com/vim/vim/commit/9954dc39ea090cee6bf41c888c41e60d9f52c3b8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 07:43:36 +08:00
zeertzjqandBram Moolenaar 0d7cc5ee85 vim-patch:9.0.0715: wrong argument for append() gives two error messages (#21023)
Problem:    Wrong argument for append() gives two error messages.
Solution:   When getting an error for a number argument don't try using it as
            a string. (closes vim/vim#11335)

https://github.com/vim/vim/commit/801cd35e7e3b21e519e12a1610ee1d721e40893e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 18:18:38 +08:00
zeertzjqandBram Moolenaar 0d8e8d36ec vim-patch:8.2.1919: assert_fails() setting emsg_silent changes normal execution (#20998)
Problem:    Assert_fails() setting emsg_silent changes normal execution.
Solution:   Use a separate flag in_assert_fails.

https://github.com/vim/vim/commit/28ee892ac4197421b3317f195512ca64cc56a5b4

Cherry-pick no_wait_return from patch 9.0.0846.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 17:50:52 +08:00
zeertzjq fc7ac688c3 fix(messages): don't set cmdline_row when messages have scrolled (#21015)
When 'cmdheight' is changed while messages have scrolled, the position
of msg_grid is not moved up, so cmdline_row should not be set based on
the position of msg_grid.
2022-11-11 16:46:45 +08:00
zeertzjqandBram Moolenaar ae67706535 vim-patch:9.0.0858: "!!sort" in a closed fold sorts too many lines (#21022)
Problem:    "!!sort" in a closed fold sorts too many lines.
Solution:   Round to end of fold after adding the line count. (closes vim/vim#11487)

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

N/A patches for version.c:

vim-patch:9.0.0855: comment not located above the code it refers to

Problem:    Comment not located above the code it refers to.
Solution:   Move the comment. (closes vim/vim#11527)

https://github.com/vim/vim/commit/09a93e3e66689c691a00fce25e4ce310d81edaee

vim-patch:9.0.0859: compiler warning for unused variable

Problem:    Compiler warning for unused variable.
Solution:   Add #ifdef.

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

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 10:16:26 +08:00
luukvbaal 69507c0204 refactor: move tabline code to statusline.c (#21008)
* refactor: move tabline code to statusline.c

Problem:	Tabline code is closely related to statusline, but still left over in drawscreen.c and screen.c.
Solution:	Move it to statusline.c.

* refactor: add statusline_defs.h
2022-11-10 19:05:16 +08:00
zeertzjq 04c73dbedb revert: "oldtests: win: fix buffer pathsep" (#21017)
This reverts commit 40e894f595.

No longer needed after #10679
2022-11-10 13:38:17 +08:00
zeertzjq f2857dcd5a fix(messages): reset msg_grid_scroll_discount when redrawing (#21000) 2022-11-10 06:16:54 +08:00
bfredl fae7540732 Merge pull request #20821 from dundargoc/refactor/clang-tidy
refactor: fix clang-tidy warnings
2022-11-08 09:48:48 +01:00
luukvbaal d187c00faf refactor: remove stray emsg check after #20992 (#20996) 2022-11-08 08:41:49 +08:00
luukvbaal 8147d3df28 vim-patch:9.0.0844: handling 'statusline' errors is spread out (#20992)
Problem:    Handling 'statusline' errors is spread out.
Solution:   Pass the option name to the lower levels so the option can be
            reset there when an error is encountered. (Luuk van Baal,
            closes vim/vim#11467)

https://github.com/vim/vim/commit/7b224fdf4a29f115567d4fc8629c1cef92d8444a
2022-11-08 07:21:22 +08:00
Christian ClasonandCarlos A Becker 050b0e30b9 vim-patch:9.0.0843: VHS tape files are not recognized (#20995)
Problem:    VHS tape files are not recognized.
Solution:   Add a filetype pattern. (Carlos Alexandro Becker, closes vim/vim#11452)

https://github.com/vim/vim/commit/1756f4b21837e8596241ecd668f4abbbab4bc7e5

Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-07 22:28:28 +01:00
bfredl 059dfda0ca Merge pull request #20991 from famiu/feat/api/nvim_cmd/command-name
feat(api): add command name to Lua command callback opts
2022-11-07 18:00:21 +01:00
Famiu Haque c022140ec6 feat(api): add command name to Lua command callback opts
Adds a `name` key to the opts dict passed to Lua command callbacks
created using `nvim_create_user_command()`. This is useful for when
multiple commands use the same callback.

Note that this kind of behavior is not as strange as one might think,
even some internal Neovim commands reuse the same internal C function,
differing their behavior by checking the command name. `substitute`,
`smagic` and `snomagic` are examples of that.

This will also be useful for generalized Lua command preview functions
that can preview a wide range of commands, in which case knowing the
command name is necessary for the preview function to actually be able
to execute the command that it's supposed to preview.
2022-11-07 22:27:37 +06:00
zeertzjq 894c59ec1f test(old): make Test_help_tagjump() test order match upstream 2022-11-07 21:08:47 +08:00
zeertzjq 451b8d6cb1 Merge pull request #20990 from zeertzjq/vim-8.2.2060
vim-patch:8.2.{2060,3626}
2022-11-07 20:13:39 +08:00
Raphael 3435cdfb94 refactor(highlight): rename FloatBorderTitle #20988
requested in https://github.com/neovim/neovim/pull/20184
2022-11-07 04:02:00 -08:00
zeertzjqandBram Moolenaar 609c0513ca vim-patch:8.2.3626: "au! event" cannot be followed by another command
Problem:    "au!" and "au! event" cannot be followed by another command as
            documented.
Solution:   When a bar is found set nextcmd.

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

Cherry-pick do_autocmd() "eap" argument from patch 8.2.3268.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 19:52:39 +08:00
zeertzjq a6f972cb6a vim-patch:8.2.2060: check for features implemented with "if"
Problem:    Check for features implemented with "if".
Solution:   Use the Check commands. (Ken Takata, closes vim/vim#7383)

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

Cherry-pick test_compiler.vim changes from patch 8.1.2373.
2022-11-07 19:46:44 +08:00
Lewis Russell bdb98de2d1 refactor: more clint (#20910) 2022-11-07 10:21:44 +00:00
zeertzjqandYegappan Lakshmanan be19990f30 vim-patch:8.2.3792: setting *func options insufficiently tested
Problem:    Setting *func options insufficiently tested.
Solution:   Impove tests. (Yegappan Lakshmanan, closes vim/vim#9337)

https://github.com/vim/vim/commit/04ef1fb13d200f770952e670357dddadb6210dd4

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjqandYegappan Lakshmanan c00d241981 vim-patch:8.2.3788: lambda for option that is a function may be freed
Problem:    Lambda for option that is a function may be garbage collected.
Solution:   Set a reference in the funcref. (Yegappan Lakshmanan,
            closes vim/vim#9330)

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

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjqandYegappan Lakshmanan 8f9ae52784 vim-patch:8.2.3758: options that take a function insufficiently tested
Problem:    Options that take a function insufficiently tested.
Solution:   Add additional tests and enhance existing tests. (Yegappan
            Lakshmanan, closes vim/vim#9298)

https://github.com/vim/vim/commit/2172bff36417ddd90653531edc65897411c83b3f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjqandYegappan Lakshmanan d7bd7f13a8 vim-patch:8.2.3756: might crash when callback is not valid
Problem:    might crash when callback is not valid.
Solution:   Check for valid callback. (Yegappan Lakshmanan, closes vim/vim#9293)

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

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjqandYegappan Lakshmanan 42e44d6d33 vim-patch:8.2.3751: cannot assign a lambda to an option that takes a function
Problem:    Cannot assign a lambda to an option that takes a function.
Solution:   Automatically convert the lambda to a string. (Yegappan
            Lakshmanan, closes vim/vim#9286)

https://github.com/vim/vim/commit/6409553b6e3b4de4e1d72b8ee5445595214581ff

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjqandYegappan Lakshmanan f91d200c05 vim-patch:8.2.3735: cannot use a lambda for 'imactivatefunc'
Problem:    Cannot use a lambda for 'imactivatefunc'.
Solution:   Add lambda support for 'imactivatefunc' and 'imstatusfunc'.
            (Yegappan Lakshmanan, closes vim/vim#9275)

https://github.com/vim/vim/commit/7645da568c5e3b4ee339a2e99c3b3af790619787

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
Victor Blanchard d337814906 feat: ":write ++p" creates parent dirs #20835
- `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if
   they do not exist
    - Note: `:foo ++…` is usually for options. No existing options have
      a single-char abbreviation (presumably by design), so it's safe to
      special-case `++p` here.
- Same for `writefile(…, 'foo/bar/baz.txt', 'p')`
- `BufWriteCmd` can see the ++p flag via `v:cmdarg`.

closes #19884
2022-11-06 19:31:50 -08:00
luukvbaal 9f125371e0 refactor: click definition functions #20923
Need this part of `win_redr_custom()` in `drawline.c` for #20621.
Another refactor is pending in https://github.com/vim/vim/pull/11467
2022-11-06 19:10:09 -08:00
Shougo 4fd876271a vim-patch:9.0.0756 #20680
Problem:    No autocmd event for changing text in a terminal window.
Solution:   Add TextChangedT. (Shougo Matsushita, closes vim/vim#11366)

https://github.com/vim/vim/commit/4ccaedfcd7526983f4b6b3b06b0bfb54f333f1f3
2022-11-06 19:02:29 -08:00
notomo 72f8613e97 fix(ui-ext): correct message kind in history before vim.ui_attach() 2022-11-07 10:20:27 +09:00
zeertzjq 8045296e8b fix(stdpath): default to /tmp if stdpath('run') cannot be created #20952
Fix #20949
2022-11-06 17:08:25 -08:00
zeertzjqandBram Moolenaar 84881674fd vim-patch:9.0.0389: crash when 'tagfunc' closes the window
Problem:    Crash when 'tagfunc' closes the window.
Solution:   Bail out when the window was closed.

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

Add docs for E1299 from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
zeertzjqandBram Moolenaar 595f7f37a9 vim-patch:9.0.0246: using freed memory when 'tagfunc' deletes the buffer
Problem:    Using freed memory when 'tagfunc' deletes the buffer.
Solution:   Make a copy of the tag name.

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

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
zeertzjqandYegappan Lakshmanan 1e4adf4b56 vim-patch:8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Problem:    Cannot use a lambda for 'completefunc' and 'omnifunc'.
Solution:   Implement lambda support. (Yegappan Lakshmanan, closes vim/vim#9257)
https://github.com/vim/vim/commit/8658c759f05b317707d56e3b65a5ef63930c7498

Comment out Vim9 script in tests.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
zeertzjqandYegappan Lakshmanan 1508618d4c vim-patch:8.2.3712: cannot use Vim9 lambda for 'tagfunc'
Problem:    Cannot use Vim9 lambda for 'tagfunc'.
Solution:   Make it work, add more tests. (Yegappan Lakshmanan, closes vim/vim#9250)
https://github.com/vim/vim/commit/05e59e3a9ffddbf93c7af02cd2ba1d0f822d4625

Omit Vim9 script in code and comment out in tests.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
zeertzjqandBram Moolenaar b3e9010f47 vim-patch:8.2.3705: cannot pass a lambda name to function() or funcref()
Problem:    Cannot pass a lambda name to function() or funcref(). (Yegappan
            Lakshmanan)
Solution:   Handle a lambda name differently.

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

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00