Commit Graph

23705 Commits

Author SHA1 Message Date
Christian Clason
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)

1756f4b218

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
zeertzjq
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.

b8e642f7ac

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)

aeb313f355

Cherry-pick test_compiler.vim changes from patch 8.1.2373.
2022-11-07 19:46:44 +08:00
Lewis Russell
31ffc360f2
docs(news): add linematch (#20927) 2022-11-07 10:22:16 +00:00
Lewis Russell
bdb98de2d1
refactor: more clint (#20910) 2022-11-07 10:21:44 +00:00
zeertzjq
e9c1cb71f8
Merge pull request #20987 from zeertzjq/vim-8.2.3751
vim-patch:8.2.{3735,3751,3756,3758,3788,3792}
2022-11-07 14:49:53 +08:00
zeertzjq
2ed2c04aa5 docs(options): remove mentions of 'imactivatefunc' and 'imstatusfunc' 2022-11-07 14:25:32 +08:00
zeertzjq
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)

04ef1fb13d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjq
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)

6ae8fae869

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjq
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)

2172bff364

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjq
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)

4dc24eb5ad

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjq
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)

6409553b6e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
zeertzjq
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)

7645da568c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
wzy
b042f6d902
fix(clipboard): prefer xsel #20918
Problem:
xclip is not actively maintained compared to xsel, and it has a bug:

    $ touch a
    $ xsel -ib < a
    $ xsel -ob
    $ xclip -o -selection clipboard
    Error: target STRING not available

Years ago, the situation was reversed.
We originally preferred xsel 46bd3c0f77
but then swapped to xclip 799d9c3215
to work around https://github.com/neovim/neovim/issues/7237#issuecomment-443440633

Solution:
Prefer xsel again.

close #20862
ref #9302
ref https://github.com/astrand/xclip/issues/38
2022-11-06 19:46:58 -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
erw7
10fbda508c
fix(tutor): failing to get buf name #20933
Error detected while processing function tutor#TutorCmd[38]..BufReadPost Autocommands for "*":
    Error executing lua callback: ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:21: Error ex
    ecuting lua: ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:22: Vim(let):E158: Invalid bu
    ffer name: .
    stack traceback:
            [C]: in function 'nvim_cmd'
            ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:22: in function <...llar/neovim/HE
    AD-cc5b736/share/nvim/runtime/filetype.lua:21>
            [C]: in function 'nvim_buf_call'
            ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:21: in function <...llar/neovim/HE
    AD-cc5b736/share/nvim/runtime/filetype.lua:10>
    stack traceback:
            [C]: in function 'nvim_buf_call'
            ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:21: in function <...llar/neovim/HE
    AD-cc5b736/share/nvim/runtime/filetype.lua:10>


Closes https://github.com/neovim/neovim/issues/20920
2022-11-06 19:18:30 -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
dundargoc
ce198102bd
ci: add stale bot #20884
Stale strategy is to never automatically stale anything. Only mark stale
issues or PRs if they get the `needs:response` label. In that case close
after 30 days if there hasn't been any activity.
2022-11-06 19:05:51 -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)

4ccaedfcd7
2022-11-06 19:02:29 -08:00
dundargoc
c4f3d41d6b
ci: install only necessary dependencies #20970 2022-11-06 17:35:27 -08: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
zeertzjq
d6497c33b7
Merge pull request #20944 from zeertzjq/vim-8.2.3705
vim-patch:8.2.{3665,3705,3712,3725},9.0.{0246,0389}
2022-11-07 08:51:54 +08:00
dundargoc
897186f409
ci: request reviewers when PR is reopened #20972 2022-11-06 16:42:59 -08:00
zeertzjq
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.

ccfde4d028

Add docs for E1299 from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
zeertzjq
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.

adce965162

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
zeertzjq
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)
8658c759f0

Comment out Vim9 script in tests.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
zeertzjq
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)
05e59e3a9f

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
zeertzjq
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.

eba3b7f664

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
zeertzjq
900dd2bdab vim-patch:8.2.3665: cannot use a lambda for 'tagfunc'
Problem:    Cannot use a lambda for 'tagfunc'.
Solution:   Use 'tagfunc' like 'opfunc'. (Yegappan Lakshmanan, closes vim/vim#9204)
19916a8c89

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
zeertzjq
9b9f84bc62
Merge pull request #20982 from zeertzjq/vim-8.2.2849
vim-patch:8.2.{2849,2856,2873}: buffer writing tests
2022-11-07 07:58:37 +08:00
zeertzjq
7e1d9c560b vim-patch:8.2.2873: not enough tests for writing buffers
Problem:    Not enough tests for writing buffers.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8229)

46aa6f93ac

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 07:33:59 +08:00
zeertzjq
bdf87efeb5 vim-patch:8.2.2856: get readonly error for device that can't be written to
Problem:    Get readonly error for device that can't be written to.
Solution:   Check for being able to write first. (closes vim/vim#8205)

50157ef1c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 07:33:59 +08:00
zeertzjq
b0190f4543 vim-patch:8.2.2849: bufwrite not sufficiently tested
Problem:    Bufwrite not sufficiently tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8192)

36f96a5151

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 07:33:58 +08:00
zeertzjq
3b3611a3d0
vim-patch:9.0.0841: deletebufline() does not always return 1 on failure (#20980)
Problem:    deletebufline() does not always return 1 on failure.
Solution:   Refactor the code to make it work more predictable. (closes vim/vim#11511)

7af3ee2b83
2022-11-07 07:03:31 +08:00
zeertzjq
08d53633d4
Merge pull request #20968 from zeertzjq/vim-8.2.2570
vim-patch:8.2.{2570,2623,2627,4495}: tests fail when run as root
2022-11-07 06:18:16 +08:00
Gregory Anders
16eed6e766
fix: add lfs to luarc.json (#20979)
The sumneko lua language server keeps prompting me if I want to
"configure my workspace for lfs". These changes suppress that prompt.
2022-11-06 14:31:54 -07:00
zeertzjq
8c454776f8 vim-patch:8.2.4495: help test fails in 24 line terminal
Problem:    Help test fails in 24 line terminal.
Solution:   Use up to 23 lines for text.

e4e1a1e1c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 23:08:40 +08:00
zeertzjq
bfa0be49ed vim-patch:8.2.2627: no need to check for BSD after checking for not root
Problem:    No need to check for BSD after checking for not root.
Solution:   Remove CheckNotBSD. (Ozaki Kiichi, closes vim/vim#7989)

4355894869
2022-11-06 23:08:40 +08:00
zeertzjq
fbe2761b20 vim-patch:8.2.2623: some tests fail when run as root
Problem:    Some tests fail when run as root.
Solution:   Use CheckNotRoot.

17709e280a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 23:08:40 +08:00
zeertzjq
df71537a12 vim-patch:8.2.2570: tests fail when run as root
Problem:    Tests fail when run as root.
Solution:   Add a comment mentioning the expected failure. (issue vim/vim#7919)

f9a65505d1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 23:08:40 +08:00
zeertzjq
de500095b1
vim-patch:8.2.2592: code coverage could be improved (#20969)
Problem:    Code coverage could be improved.
Solution:   Add a few more tests. (Dominique Pellé, closes vim/vim#7957)

6fd367a97c

Test case in test_viminfo.vim is applicable.
2022-11-06 23:07:57 +08:00
zeertzjq
728c69bc8d
vim-patch:8.2.1340: some tests fail on Cirrus CI and/or with FreeBSD (#20967)
Problem:    Some tests fail on Cirrus CI and/or with FreeBSD.
Solution:   Make 'backupskip' empty. Do not run tests as root. Check for
            directory when using viminfo. (Ozaki Kiichi, closes vim/vim#6596)

b86abadf87
2022-11-06 22:13:36 +08:00
zeertzjq
da0fb43849
vim-patch:8.1.1200: old style comments in debugger source
Problem:    Old style comments in debugger source.
Solution:   Use new style comments. (Yegappan Lakshmanan, closes vim/vim#4286)

31fc39e47b
2022-11-06 21:56:37 +08:00
zeertzjq
f3cea06d01
test(old): remove stray test42 files (#20966)
Forgot to remove in #17350.
2022-11-06 20:22:37 +08:00
Raphael
1af4bd04f9
feat(ui): add support to display a title in the border of a float (#20184)
add "title" and "title_pos" keys to win config dict.
2022-11-06 11:59:43 +01:00