1
0
forked from aniani/vim

521 Commits

Author SHA1 Message Date
Christian Brabandt
f209dcd3de
patch 9.1.1198: [security]: potential data loss with zip.vim
Problem:  [security]: potential data loss with zip.vim and special
          crafted zip files (RyotaK)
Solution: use glob '[-]' to protect filenames starting with '-'

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-693p-m996-3rmf

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 22:04:01 +01:00
David Mandelberg
c2623824a7
runtime(man): improve :Man completion for man-db
On man-db systems, complete with actual man sections and pages, instead
of shell commands.

I tried to come up with a portable solution for multiple man
implementations in https://github.com/vim/vim/discussions/16794 but I
think the differences between implementations were too large to do that
without overly complicated code. So instead, I implemented it for man-db
(which I think is common on Linux) and hopefully left it easier for
other people to implement it on other systems in the future if they want
to.

closes: #16843

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:26:50 +01:00
David Mandelberg
b34ce3e205
runtime(man): don't add jumps when loading a manpage
Without this change, pressing K while in one manpage to load another
one, then pressing CTRL-O to go back, results in going to the bottom of
the current (second) manpage. With this change, it goes back to the
previous manpage.

closes: #16791

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:38:20 +01:00
Christian Brabandt
a250738303
runtime(tar): use readblob() instead of shelling out to file(1)
fixes: ##16761
closes: #16769

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 22:24:28 +01:00
Christian Brabandt
334a13bff7
patch 9.1.1164: [security]: code execution with tar.vim and special crafted tar files
Problem:  editing a special crafted tar file allows code execution
          (RyotaK, after 129a8446d23cd9cb4445fcfea259cba5e0487d29)
Solution: escape the filename before feeding it to the `:read` command

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-wfmf-8626-q3r3

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 19:37:29 +01:00
Christian Brabandt
8ac975d97e
runtime(tar): fix syntax error in tar.vim
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 17:13:40 +01:00
Jim Zhou
56957ed410
runtime(misc): add support for bzip3 to tar, vimball and gzip plugins
fixes: #16751
closes: #16755

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 18:06:14 +01:00
Corpulent Robin
b69cd52447
runtime(misc): Add support for lz4 to tar & gzip plugin
while at it, clean up the tar plugin a bit and sort the patterns for the
tar and gzip plugin

References:
- https://github.com/lz4/lz4
- https://lz4.org/

closes: #16591

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Corpulent Robin <177767857+corpulentrobin@users.noreply.github.com>
2025-02-06 21:10:49 +01:00
Luca Saccarola
766801295d
runtime(dist/vim9): fix regressions in dist#vim9#Open
fixes: #16533
fixes: #16532
closes: #16535

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 18:36:01 +01:00
Christian Brabandt
fb49e3cde7
runtime(filetype): commit 99181205c5f8284a3 breaks V lang detection
so make the regex more strict and have it check for a parenthesis.

See:
https://github.com/vlang/v/blob/master/examples/submodule/mymodules/submodule/sub_functions.v

related: #16513

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 16:18:51 +01:00
Luca Saccarola
c729d6d154
runtime: decouple Open and Launch commands and gx mapping from netrw
closes: #16494
fixes: ##16486

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 16:07:12 +01:00
Christian Brabandt
99181205c5
runtime(filetype): Improve Verilog detection by checking for modules definition
While at it, also increase the maximum number of lines to check to 500.

fixes: #16513

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 15:23:52 +01:00
Peter Benjamin
72755b3c8e
patch 9.1.1042: filetype: just files are not recognized
Problem:  filetype: just files are not recognized
Solution: adjust filetype detection pattern, detect just shebang line,
          include just ftplugin, indent and syntax plugin
          (Peter Benjamin)

closes: #16466

Signed-off-by: Peter Benjamin <petermbenjamin@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-20 21:56:41 +01:00
Christian Brabandt
727c567a09
patch 9.1.1030: filetype: setting bash filetype is backwards incompatible
Problem:  filetype: setting bash filetype is backwards incompatible
Solution: revert patch v9.1.0965, detect bash scripts again as sh
          filetype

This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.

related: #16309

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-18 10:03:46 +01:00
Luca Saccarola
9cfdabb074
runtime(netrw): change netrw maintainer
Dr. Chip retired some time ago and is no longer maintaining the netrw
plugin. However as a runtime plugin distributed by Vim, it important to
maintain the netrw plugin in the future and fix bugs as they are
reported.

So, split out the netrw plugin as an additional package, however include
some stubs to make sure the plugin is still loaded by default and the
documentation is accessible as well.

closes: #16368

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-17 13:03:53 +01:00
Christian Brabandt
668e9f2403
runtime(filetype): don't detect string interpolation as angular
fixes: #16375

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-11 09:20:55 +01:00
Wu, Zhenyu
4f73c07abf
patch 9.1.0998: filetype: TI assembly files are not recognized
Problem:  filetype: TI assembly files are not recognized
Solution: inspect '*.sa' and assembly files and detect TI assembly
          files, include filetype plugin and syntax script for TI
          assembly files (Wu, Zhenyu)

closes: #15827

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-08 20:26:38 +01:00
Christian Brabandt
7b239f6d47
runtime(netrw): update last change header for #16265
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-28 14:08:38 +01:00
Luca Saccarola
b9b762c21f
patch 9.1.0965: filetype: sh filetype set when detecting the use of bash
Problem:  filetype: sh filetype set when detecting the use of bash
Solution: when bash is detected, use 'bash' filetype instead
          (Luca Saccarola)

closes: #16309

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-27 16:08:14 +01:00
Jim Zhou
6d2efd4920
runtime(vim): update indentation plugin for Vim script
Make the indent script aware of enums and ensure those will be correctly
indented.

fixes: #16289
closes: #16293

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Jim Zhou <csd_189@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-26 10:36:56 +01:00
Konfekt
2328a39a54
runtime(netrw): do not double escape Vim special characters
This double escaping was likely introduced because it was the only way
to make :Open work with hashes/percent signs despite shellescape(..., 1)
supposedly taking care of it, but then breaks the gx mapping
on MSYS2 as reported at [0]

Since special characters in the URL following :Open can be escaped,
whereas gx simply breaks and is more common, no longer double escape

[0]: https://github.com/vim/vim/issues/16252

fixes: #16252
closes: #16265

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-20 19:41:02 +01:00
shane.xb.qian
c673b805ad
runtime(netrw): more reformating #16248
closes: #16266

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-20 19:36:40 +01:00
Luca Saccarola
c363ca1ecd
runtime(netrw): change indent size from 1 to 2
closes: #16248

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-19 20:16:18 +01:00
Aliaksei Budavei
368ef5a48c
patch 9.1.0935: SpotBugs compiler can be improved
Problem:  SpotBugs compiler can be improved
Solution: runtime(compiler): Improve defaults and error handling for
          SpotBugs; update test_compiler.vim (Aliaksei Budavei)

runtime(compiler): Improve defaults and error handling for SpotBugs

* Keep "spotbugs#DefaultPreCompilerTestAction()" defined but
  do not assign its Funcref to the "PreCompilerTestAction"
  key of "g:spotbugs_properties": there are no default and
  there can only be introduced arbitrary "*sourceDirPath"
  entries; therefore, this assignment is confusing at best,
  given that the function's implementation delegates to
  whatever "PreCompilerAction" is.

* Allow for the possibility of relative source pathnames
  passed as arguments to Vim for the Javac default actions,
  and the necessity to have them properly reconciled when
  the current working directory is changed.

* Do not expect users to remember or know that new source
  files ‘must be’ ":argadd"'d to be then known to the Javac
  default actions; so collect the names of Java-file buffers
  and Java-file Vim arguments; and let users providing the
  "@sources" file-lists in the "g:javac_makeprg_params"
  variable update these file-lists themselves.

* Strive to not leave behind a fire-once Syntax ":autocmd"
  for a Java buffer whenever an arbitrary pre-compile action
  errors out.

* Only attempt to run a post-compiler action in the absence
  of failures for a pre-compiler action.  Note that warnings
  and failures are treated alike (?!) by the Javac compiler,
  so when previews are tried out with "--enable-preview",
  remember about passing "-Xlint:-preview" too to also let
  SpotBugs have a go.

* Properly group conditional operators when testing for key
  entries in a user-defined variable.

* Also test whether "javaExternal" is defined when choosing
  an implementation for source-file parsing.

* Two commands are provided to toggle actions for buffer-local
  autocommands:
  - SpotBugsRemoveBufferAutocmd;
  - SpotBugsDefineBufferAutocmd.

For example, try this from "~/.vim/after/ftplugin/java.vim":
------------------------------------------------------------
if exists(':SpotBugsDefineBufferAutocmd') == 2
	SpotBugsDefineBufferAutocmd BufWritePost SigUSR1
endif
------------------------------------------------------------

And ":doautocmd java_spotbugs User" can be manually used at will.

closes: #16140

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-16 21:38:47 +01:00
Christian Brabandt
5c42c77315
runtime(netrw): do not pollute search history with symlinks
fixes: #16206

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-12 19:13:08 +01:00
Luca Saccarola
b66cac1a8e
runtime(typst): add definition lists to formatlistpat, update maintainer
closes: #16192

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-09 20:31:04 +01:00
Christian Brabandt
92b36663f8
runtime(netrw): only check first arg of netrw_browsex_viewer for being executable
fixes: #16185

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-08 09:52:37 +01:00
Konfekt
eda923e9c9
runtime(netrw): do not detach when launching external programs in gvim
On Debian 12 when detaching the program wouldn't launch at all

closes: #16168

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-04 20:12:44 +01:00
Konfekt
65311c6f47
runtime(compiler): include spotbugs Java linter
closes: #16001

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-28 21:06:09 +01:00
Christian Brabandt
7e501f4d99
runtime(gzip): load undofile if there exists one
fixes: #16102
closes: #16122

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-26 15:10:33 +01:00
GuyBrush
d7745acbd8
runtime(netrw): Fixing powershell execution issues on Windows
closes: #16094

Signed-off-by: GuyBrush <miguel.barro@live.com>
2024-11-23 14:13:10 +01:00
Christian Brabandt
cacfccf803
runtime(netrw): update netrw's decompress logic
Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: #16099
closes: #16104

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-23 13:28:01 +01:00
Wu, Zhenyu
e2c27ca8ef
patch 9.1.0876: filetype: openCL files are not recognized
Problem:  filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
          include a opencl syntax and filetype plugin (Wu, Zhenyu)

closes: #15825

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 21:03:09 +01:00
Wu, Zhenyu
bc32bbddcf
patch 9.1.0866: filetype: LLVM IR files are not recognized
Problem:  filetype: LLVM IR files are not recognized
Solution: detect '*.ll' files either as lifelines or llvm filetype
          (Wu, Zhenyu)

closes: #15824

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 22:55:36 +01:00
Konfekt
460799d885
runtime(netrw): small fixes to netrw#BrowseX
- do not enter dir in Netrw on opening
- double quotes after start cause error on Windows

See @chrisbra 's comments at
[0]

[0]: ff82e7a9db (diff-39baf27d8f62071617bbef12f874cce31c0ebd02ec99e7b119474ca870c636a3R5279)

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:42:27 +01:00
D. Ben Knoble
8e013b1421
runtime(racket): update Racket runtime files
This brings the included Racket runtime files to commit c41bc5a (indent
for[*]/lists with accumulator clause correctly, 2024-11-12) of
https://github.com/benknoble/vim-racket.

Note that not all files from that repository are included.

closes: #16046

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-13 19:45:38 +01:00
GuyBrush
13a6605ddf
patch 9.1.0859: several problems with the GLVS plugin
Problem:  several problems with the GLVS plugin
Solution: fix issues, add regression tests, require at least Vim 9.1
          (GuyBrush)

closes: #16036

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-12 20:23:41 +01:00
Lennart00
129a8446d2
runtime(tar): Update tar.vim to support permissions
These changes enable tar.vim to keep permissions of files that were
edited intact instead of replacing them with the default permissions.

The major change for this is switching from "tar -OPxf", which reads out
the contents of the selected file from an tar archive to stdout to
"tar -pPxf" which extracts the selected file to the current directory
with permissions intact

This requirs the temporary directory to be created earlier.

closes: #7379

Signed-off-by: Lennart00 <73488709+Lennart00@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-11 22:39:30 +01:00
Doug Kearns
7724d621f2
runtime(vim): Fix indent after :silent! function
See 35699f1749 (commitcomment-148816912)

closes: #16009

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:36:28 +01:00
Christian Brabandt
5b63b236a0
runtime(netrw): directory symlink not resolved in tree view
closes: #16020

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:22:34 +01:00
Tom Benham
64a536d4fa
runtime(netrw): fix several bugs in netrw tree listing
fixes: #5630
fixes: #9807
fixes: #14623
closes: #15996

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 21:31:49 +01:00
Christian Brabandt
a063b22b3b
runtime(netrw): prevent polluting the search history
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 14:31:09 +01:00
Yegappan Lakshmanan
a54816b884
patch 9.1.0836: The vimtutor can be improved
Problem:  the vimtutor can be improved
Solution: port and include the interactive vimtutor plugin from Neovim
          (by Felipe Morales) (Yegappan Lakshmanan)

closes: #6414

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-03 11:01:10 +01:00
Yinzuo Jiang
d181bafd0b
runtime(typst): synchronize updates from the upstream typst.vim
2 commits included from the upstream:

- 2a4a0e0662
- 50e89f4811

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 16:35:46 +01:00
Tom Benham
4d618006ec
runtime(netrw): fix E874 when browsing remote directory which contains ~ character
closes: #15964

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 10:47:23 +01:00
Christian Brabandt
8b0fa7a565
runtime(netrw): make :Launch/Open autoloadable
fixes: #15959
closes: #15962

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 09:21:23 +01:00
Christian Brabandt
9f32069b8c
runtime(netrw): fix regression with x mapping on Cygwin
related: #13687

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-30 18:37:06 +01:00
Christian Brabandt
aa2ce6f580
runtime(netrw): fix filetype detection for remote files
fixes: #15961

while at it, remove the Decho comments in the s:NetrwOptionsRestore()
function

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-30 18:27:03 +01:00
Konfekt
3d7e567ea7
runtime(netrw): simplify gx file handling
It did not work very well, at least on Debian 12, and I am not sure Git
Bash and WSL, for example, were taken care of as maintenance stalled.

The whole logic was somewhat convoluted with some parts repeatedly invoking
failed commands.

The file handling was outdated, for example, nowadays Netscape is rarely
used, and also opinionated, for example mainly Microsoft Paint and Gimp for
Image files.

Instead, let's use (xdg-)open and similar commands on other systems
which respects the user's preferences.

closes: #15721

Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 22:16:49 +01:00
Luca Saccarola
421ed14b8a
runtime(typst): add folding to typst ftplugin
closes: #15897

Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-21 22:01:10 +02:00