1
0
forked from aniani/vim

5 Commits

Author SHA1 Message Date
Christian Brabandt
e6b01cfe01
runtime(dist): do not output a message if executable is not found
closes: #15705

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-20 22:26:56 +02:00
Christian Brabandt
8e25d91cb7
runtime(dist): verify that executable is in $PATH
Otherwise, if the executable to be verified does not exist,
this would cause a false-positive in the 'IsSafeExecutable()' check,
because 'exepath(executable)' returns an empty string and
'fnamemodify('', ':p:h')' returns the current directory and as a result
the 'IsSafeExecutable()' returns false (for the wrong reason).

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-17 21:00:55 +02:00
Sean Dewar
b2a4c110a5
runtime(dist): Make dist/vim.vim work properly when lacking vim9script support (#13487)
`:return` cannot be used outside of `:function` (or `:def`) in older Vims
lacking Vim9script support or in Neovim, even when evaluation is being skipped
in the dead `:else` branch.

Instead, use the pattern described in `:h vim9-mix`, which uses `:finish` to end
script processing before it reaches the vim9script stuff.

Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-05 10:11:37 +01:00
Christian Brabandt
4f174f0de9
runtime(dist): add legacy version for central vim library
Also, enable the zip and gzip plugins by default, unless those variables
were not explicitly set by the user.

related: #13413

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-04 11:19:28 +01:00
D. Ben Knoble
cd8a3eaf53
runtime(dist): centralize safe executable check and add vim library (#13413)
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