Commit Graph

663 Commits

Author SHA1 Message Date
zeertzjq
7bf0963d48
vim-patch:9.0.1833: [security] runtime file fixes (#24969)
Problem:  runtime files may execute code in current dir
Solution: only execute, if not run from current directory

The perl, zig and ruby filetype plugins and the zip and gzip autoload
plugins may try to load malicious executable files from the current
working directory.  This is especially a problem on windows, where the
current directory is implicitly in your $PATH and windows may even run a
file with the extension `.bat` because of $PATHEXT.

So make sure that we are not trying to execute a file from the current
directory. If this would be the case, error out (for the zip and gzip)
plugins or silently do not run those commands (for the ftplugins).

This assumes, that only the current working directory is bad. For all
other directories, it is assumed that those directories were
intentionally set to the $PATH by the user.

816fbcc262

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-01 11:38:31 +08:00
David Moberg
67fba9affa
fix(runtime/tutor): don't try to close fold when there is none (#24953)
Problem: When double clicking a line starting with a #, the code assumes
there is a fold there and tries to close it, resulting in an error if
there isn't a fold.
Solution: Check foldlevel before performing "zc".
2023-08-31 09:18:39 +08:00
Christian Clason
e2d3c1260e vim-patch:a0fddaa2f4b7
Runtime(javascript): add new document properties to completion file

closes: vim/vim#6536

a0fddaa2f4

Co-authored-by: Jay Sitter <jay@diameterstudios.com>
2023-08-21 20:32:28 +09: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
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
Kai Ting
c3de6524a5
fix(clipboard): ignore exit caused by signal #23378
Problem:
If clipboard job exits by signal, the exit code is >=128:
939d9053bd
xclip 0.13 often exits with code 143, which spams unhelpful messages:

    clipboard: error invoking xclip: Waiting for selection requests,
    Control-C to quit   Waiting for selection request number 1

Solution:
Don't show a warning if the clipboard tool exit code is >=128.
Fixes: #7054
2023-07-16 04:15:30 -07:00
Frede
8758c6fb87
feat(defaults): set g:netrw_use_errorwindow = 0 #24179
Problem:
netrw uses a bespoke window to show messages.

Solution:
change the default so that netrw uses normal vim :echoerr
2023-06-29 14:14:14 -07:00
Justin M. Keyes
2f17ef1fc4
fix(messages): use "Vimscript" instead of "VimL" #24111
followup to #24109
fix #16150
2023-06-22 04:09:14 -07:00
Christian Clason
c11986ed1a
vim-patch:b7398fe41c9e (#23627)
Update runtime files

b7398fe41c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-15 09:38:32 +02:00
Christian Clason
e3f36377c1
vim-patch:71badf9547e8 (#23285)
Update runtime files

71badf9547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02:00
dundargoc
b0978fca6b
fix(checkhealth): fix crash due to incorrect argument type 2023-04-16 12:26:13 +02:00
dundargoc
c08b030761
refactor: deprecate checkhealth functions
The following functions are deprecated and will be removed in
Nvim v0.11:

- health#report_start()
- health#report_info()
- health#report_ok()
- health#report_warn()
- health#report_error()
- vim.health.report_start()
- vim.health.report_info()
- vim.health.report_ok()
- vim.health.report_warn()
- vim.health.report_error()

Users should instead use these:

- vim.health.start()
- vim.health.info()
- vim.health.ok()
- vim.health.warn()
- vim.health.error()
2023-04-15 23:40:48 +02:00
dundargoc
880f7d12fe
feat!: remove vimballs (#22402)
Vimball is an outdated feature that is rarely used these days. It is not
a maintenance burden on its own, but it is nonetheless dead weight and
something we'd need to tell users to ignore when they inevitably ask
what it is.

See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173
2023-04-11 19:10:36 +02:00
dundargoc
bd98ef6ac6
refactor: rewrite perl healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 15:59:50 +02:00
dundargoc
b5c0e7137c
refactor: rewrite node healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 15:26:22 +02:00
dundargoc
7801ffc38a
refactor: rewrite ruby healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 14:06:10 +02:00
dundargoc
5ed7ede1f5
refactor: rewrite virtualenv healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 11:28:42 +02:00
dundargoc
71225228fc
refactor: rewrite python provider healthcheck in Lua
This is required to remove the vimscript checkhealth functions.
2023-04-09 22:28:00 +02:00
dundargoc
41b7586cbb
refactor: rewrite clipboard provider healthchecks in Lua
This is required to remove the vimscript checkhealth functions.
2023-04-09 20:46:53 +02:00
dundargoc
a5c572bd44
docs: fix typos
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: himanoa <matsunoappy@gmail.com>
2023-04-04 19:07:33 +02:00
Justin M. Keyes
a40eb7cc99 feat(vim.version): more coercion with strict=false
Problem:
"tmux 3.2a" (output from "tmux -V") is not parsed easily.

Solution:
With `strict=false`, discard everything before the first digit.

- rename Semver => Version
- rename vim.version.version() => vim.version._version()
- rename matches() => has()
- remove `opts` from cmp()
2023-03-20 13:40:38 +01:00
Justin M. Keyes
04e8e1f9ea
refactor(runtime): use vim.version to compare versions #22550
TODO:
Unfortunately, cannot (yet) use vim.version for tmux version comparison,
because `vim.version.parse(…,{strict=false})` does not coerce tmux's
funny "tmux 3.3a" version string.
6969d3d749/runtime/autoload/provider/clipboard.vim (L148)
2023-03-07 06:28:53 -08:00
Christian Clason
66c384d4e8
vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26

Update runtime files

dd60c365cd

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
2023-02-28 09:34:27 +01:00
Christian Clason
144279ef30
vim-patch:be4e01637e71 (#22103)
Update runtime files.

be4e01637e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-03 09:18:18 +01:00
TJ DeVries
39d70fcafd
dist: generated version of ccomplete.vim (#21623)
This is the first PR featuring a conversion of an upstream vim9script file
into a Lua file.

The generated file can be found in `runtime/autoload/ccomplete.vim` in
the vim repository. Below is a limited history of the changes of that file
at the time of conversion.

```
❯ git log --format=oneline runtime/autoload/ccomplete.vim
c4573eb12dba6a062af28ee0b8938d1521934ce4 Update runtime files
a4d131d11052cafcc5baad2273ef48e0dd4d09c5 Update runtime files
4466ad6baa22485abb1147aca3340cced4778a66 Update runtime files
d1caa941d876181aae0ebebc6ea954045bf0da24 Update runtime files
20aac6c1126988339611576d425965a25a777658 Update runtime files.
30b658179962cc3c9f0a98f071b36b09a36c2b94 Updated runtime files.
b6b046b281fac168a78b3eafdea9274bef06882f Updated runtime files.
00a927d62b68a3523cb1c4f9aa3f7683345c8182 Updated runtime files.
8c8de839325eda0bed68917d18179d2003b344d1 (tag: v7.2a) updated for version 7.2a
...
```

The file runtime/lua/_vim9script.lua only needs to be updated when vim9jit is updated
(for any bug fixes or new features, like implementing class and interface, the latest in vim9script).

Further PRs will improve the DX of generated the converted lua and
tracking which files in the neovim's code base have been generated.
2023-01-05 11:00:32 -05:00
Lewis Russell
5841a97500
feat!: remove hardcopy
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 10:07:43 +00:00
Christian Clason
3576776903
vim-patch:86b4816766d9 (#21314)
Update runtime files

86b4816766

vim-patch:9.0.1029: autoload directory missing from distribution

Problem:    Autoload directory missing from distribution.
Solution:   Add the autoload/zig directory to the list of distributed files.

84dbf855fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-08 16:33:38 +01:00
Charles Nguyen
1390e97c20
feat(provider): add support for Yarn node modules on Windows (#21246) 2022-12-01 11:50:53 +08:00
XDream8
db407010fa
feat(clipboard): added wayclip support (#21091) 2022-11-18 08:39:56 -07:00
Justin M. Keyes
4d2373f5f6
feat(checkhealth): use "help" syntax, avoid tabpage #20879
- If Nvim was just started, don't create a new tab.
- Name the buffer "health://".
- Use "help" syntax instead of "markdown". It fits better, and
  eliminates various workarounds.
- Simplfy formatting, avoid visual noise.
- Don't print a "INFO" status, it is noisy.
- Drop the ":" after statuses, they are already UPPERCASE and highlighted.
2022-11-11 18:33:31 -08:00
Gregory Anders
ef1d291f29
fix(clipboard): update version regex pattern (#21012)
Building tmux from source uses a 'next-' prefix, so account for that.
Also handle failures to match more gracefully.
2022-11-09 16:21:54 -07: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
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
Gregory Anders
81722896e4
feat(clipboard): copy to system clipboard in tmux when supported (#20936)
Since version 3.2 tmux has had the ability to read/write buffer contents
from/to the system clipboard, if the underlying terminal emulator
supports it. Enable this feature when we can detect that tmux supports
it.
2022-11-04 20:43:11 -06:00
Justin M. Keyes
3213bc36c5 refactor(checkhealth): convert "nvim" check to Lua 2022-10-30 15:50:59 +01:00
Barrett Ruth
2817411b7d
fix(health): correct tmux rgb verification (#20868)
Current RGB verification parses `tmux server-info`. Despite it being a tmux default alias to `tmux show-messages -JT`, it may be unavailable. Use `tmux show-messages -JT` directly instead.
2022-10-30 07:37:47 +08:00
Christian Clason
6884f017b5
vim-patch:partial:6ebe4f970b8b (#20860)
Update runtime files

6ebe4f970b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-29 17:41:22 +02:00
Christian Clason
042eb74ff1
feat(runtime)!: remove filetype.vim (#20428)
Made obsolete by now graduated `filetype.lua` (enabled by default).

Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
2022-10-17 08:52:40 +02:00
Christian Clason
9701c9dc9f
vim-patch:3c053a1a5ad2 (#20679)
Update runtime files
3c053a1a5a
2022-10-17 08:19:48 +02:00
Jonas Strittmatter
d44f088834
vim-patch:9.0.0771: cannot always tell the difference beween tex and … (#20687)
vim-patch:9.0.0771: cannot always tell the difference beween tex and rexx files

Problem:    Cannot always tell the difference beween tex and rexx files.
Solution:   Recognize tex by a leading backslash. (Martin Tournoij,
            closes vim/vim#11380)
bd053f894b
2022-10-17 08:18:57 +02:00
Lewis Russell
2afcdbd63a
feat(Man): port to Lua (#19912)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 15:20:29 +01:00
Jonas Strittmatter
ce80b8f50d
vim-patch:9.0.0349: filetype of *.sil files not well detected (#20050)
Problem:    Filetype of *.sil files not well detected.
Solution:   Inspect the file contents to guess the filetype.
be807d5824
2022-09-02 08:16:17 +02:00
Christian Clason
d3cd79709b
vim-patch:fd999452adaf (#19929)
Update runtime files
fd999452ad
2022-08-25 00:49:33 +02:00
Christian Clason
1cc4706e94
vim-patch:e80086446cc2 (#19848)
* vim-patch:e80086446cc2

Update runtime files
e80086446c

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2022-08-20 10:04:55 +02:00
Christian Clason
a5e846b996
vim-patch:partial: 48c3f4e0bff7 (#19684)
vim-patch:partial:48c3f4e0bff7

Update runtime files
48c3f4e0bf

partially skip `options.txt` (needs 9.0.0138)
2022-08-09 10:43:28 +02:00
Percy Ma
c6181a672a
feat(node): add pnpm support #19461 2022-08-01 07:21:54 -07:00
Gregory Anders
9b447c7ce5
vim-patch:9.0.0088: pattern for detecting bitbake files is not sufficient (#19547)
Problem:    Pattern for detecting bitbake files is not sufficient.
Solution:   Adjust the pattern. (Gregory Anders, closes vim/vim#10743)
30e212dac1
2022-07-27 10:06:09 -06:00
Christian Clason
4cbeedf57b
vim-patch:b529cfbd04c0 (#19501)
Update runtime files
b529cfbd04
2022-07-26 11:26:23 +02:00
Gregory Anders
5ccdf6a88d
vim-patch:9.0.0055 (#19392)
vim-patch:9.0.0055: bitbake files are not detected

Problem:    Bitbake files are not detected.
Solution:   Add bitbake filetype detection by file name and contents. (Gregory
            Anders, closes vim/vim#10697)
fa49eb4827
2022-07-17 14:33:51 +02:00
Christian Clason
662681694b
vim-patch:0d878b95d8f9 (#19197)
Update runtime files
0d878b95d8
2022-07-02 11:06:03 +02:00