1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-22 09:45:11 +01:00
Commit graph

21 commits

Author SHA1 Message Date
Riley Bruins
0a0830624a
patch 9.1.0464: no whitespace padding in commentstring option in ftplugins
Problem:  no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
          existing filetype plugins with the new default value
          (Riley Bruins)

closes: 

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03 20:40:45 +02:00
Doug Kearns
93197fde0f
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Problem:  The "*.*" browsefilter pattern only matches all files on
	  Windows (Daryl Lee)
Solution: Use "*" to filter on all platforms but keep "*.*" as the label
	  text on Windows. (Fixes , Doug Kearns)

The *.* browsefilter pattern used to match "All Files" on Windows is a
legacy of the DOS 8.3 filename wildcard matching algorithm.  For reasons
of backward compatibility this still works on Windows to match all
files, even those without an extension.

However, this pattern only matches filenames containing a dot on other
platforms.  This often makes files without an extension difficult to
access from the file dialog, e.g., "Makefile"

On Windows it is still standard practice to use "*.*" for the filter
label so ftplugins should use "All Files (*.*)" on Windows and "All
Files (*)" on other platforms.  This matches Vim's default browsefilter
values.

This commit also normalises the browsefilter conditional test to check
for the Win32 and GTK GUI features and an unset b:browsefilter.

closes: 

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-14 21:02:54 +01:00
D. Ben Knoble
cd8a3eaf53
runtime(dist): centralize safe executable check and add vim library ()
Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes,
2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when
loading ftplugins, 2023-09-06).

This puts the logic for safe executable checks in a single place, by introducing
a central vim library, so all filetypes benefit from consistency.

Notable changes:
- dist#vim because the (autoload) namespace for a new runtime support
  library. Supporting functions should get documentation. It might make
  life easier for NeoVim devs to make the documentation a new file
  rather than cram it into existing files, though we may want
  cross-references to it somewhere…
- The gzip and zip plugins need to be opted into by enabling execution
  of those programs (or the global plugin_exec). This needs
  documentation or discussion.
- This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed
  in f7ac0ef50 (runtime: don't execute external commands when loading
  ftplugins, 2023-09-06), but the variable was still referenced. Since
  the new function takes care of that automatically, the variable is no
  longer needed.

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-04 10:11:17 +01:00
dkearns
4e554d282c
runtime(perl): Update ftplugin and indent files ()
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-08 19:16:03 +02:00
Christian Brabandt
f7ac0ef509
runtime: don't execute external commands when loading ftplugins
This is a followup to 816fbcc262 (patch
9.0.1833: [security] runtime file fixes)

It basically disables that external commands are run on loading of the
filetype plugin, **unless** the user has set the `g:plugin_exec = 1`
global variable in their configuration or for a specific filetype the
variable g:<filetype>_exec=1.

There are a few more plugins, that may execute system commands like
debchangelog, gitcommit, sh, racket, zsh, ps1 but those do at least
do not run those commands by default during loading of the filetype plugin
(there the command is mostly run as convenience for auto-completion or
to provide documentation lookup).

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tim Pope <vim@tpope.org>
2023-09-06 20:41:25 +02:00
Anton Sharonov
67c951df4c
runtime(ftplugin): allow to exec if curdir is in PATH
In case the current directory is present as valid $PATH entry, it is OK
to call the program from it, even if vim curdir is in that same
directory.

(Without that patch, for instance, you will not be able to open .zip
files while your current directory is /bin)

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 21:04:44 +02:00
Christian Brabandt
816fbcc262
patch 9.0.1833: [security] runtime file fixes
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.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 23:52:30 +02:00
Bram Moolenaar
8c1b8cb2e0 Update runtime files 2022-06-14 17:41:28 +01:00
Bram Moolenaar
2c7f8c574f Update runtime files 2020-04-20 19:52:53 +02:00
Bram Moolenaar
37c64c78fd Update runtime files. 2017-09-19 22:06:03 +02:00
Bram Moolenaar
9d98fe9cae Update runtime files. 2013-08-03 18:35:36 +02:00
Bram Moolenaar
e2db695d31 Updated runtime files. 2013-07-24 19:53:36 +02:00
Bram Moolenaar
543b7ef700 Updated runtime files and translations. 2013-06-01 14:50:56 +02:00
Bram Moolenaar
84f7235bdb Updated runtime files. Add Dutch translations. 2012-03-11 15:57:40 +01:00
Bram Moolenaar
9de9997949 Runtime file updates. 2010-08-09 22:33:06 +02:00
Bram Moolenaar
5c73622a90 Update runtime files. 2010-01-06 20:54:52 +01:00
Bram Moolenaar
e37d50a5de updated for version 7.2c-000 2008-08-06 17:06:04 +00:00
Bram Moolenaar
446cb837a0 updated for version 7.2a 2008-06-24 21:56:24 +00:00
Bram Moolenaar
83c465c705 updated for version 7.0171 2005-12-16 21:53:56 +00:00
Bram Moolenaar
293ee4d421 updated for version 7.0021 2004-12-09 21:34:53 +00:00
Bram Moolenaar
071d4279d6 updated for version 7.0001 2004-06-13 20:20:40 +00:00