Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into tabsidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtnn committed Aug 8, 2024
2 parents 47e63f5 + 0cc5dce commit 85caee7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
19 changes: 12 additions & 7 deletions runtime/doc/builtin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2024 Jul 28
*builtin.txt* For Vim version 9.1. Last change: 2024 Aug 08


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -2532,8 +2532,10 @@ executable({expr}) *executable()*
This function checks if an executable with the name {expr}
exists. {expr} must be the name of the program without any
arguments.

executable() uses the value of $PATH and/or the normal
searchpath for programs. *PATHEXT*
searchpath for programs.
*PATHEXT*
On MS-Windows the ".exe", ".bat", etc. can optionally be
included. Then the extensions in $PATHEXT are tried. Thus if
"foo.exe" does not exist, "foo.exe.bat" can be found. If
Expand All @@ -2543,11 +2545,14 @@ executable({expr}) *executable()*
then the name is also tried without adding an extension.
On MS-Windows it only checks if the file exists and is not a
directory, not if it's really executable.
On MS-Windows an executable in the same directory as Vim is
normally found. Since this directory is added to $PATH it
should also work to execute it |win32-PATH|. This can be
disabled by setting the $NoDefaultCurrentDirectoryInExePath
environment variable. *NoDefaultCurrentDirectoryInExePath*
On MS-Windows an executable in the same directory as the Vim
executable is always found. Since this directory is added to
$PATH it should also work to execute it |win32-PATH|.
*NoDefaultCurrentDirectoryInExePath*
On MS-Windows an executable in Vim's current working directory
is also normally found, but this can be disabled by setting
the $NoDefaultCurrentDirectoryInExePath environment variable.

The result is a Number:
1 exists
0 does not exist
Expand Down
2 changes: 1 addition & 1 deletion src/evalvars.c
Original file line number Diff line number Diff line change
Expand Up @@ -4100,7 +4100,7 @@ set_var_const(

// Modifying a final variable with a List value using the "+="
// operator is allowed. For other types, it is not allowed.
if (((flags & ASSIGN_FOR_LOOP) == 0
if ((((flags & ASSIGN_FOR_LOOP) == 0 || (flags & ASSIGN_DECL) == 0)
&& ((flags & ASSIGN_COMPOUND_OP) == 0
|| !type_inplace_modifiable))
? var_check_permission(di, name) == FAIL
Expand Down
27 changes: 26 additions & 1 deletion src/testdir/test_eval_stuff.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

source view_util.vim
source shared.vim
import './vim9.vim' as v9

function s:foo() abort
try
Expand Down Expand Up @@ -126,7 +127,31 @@ func Test_for_invalid()
call assert_fails("for x in 99", 'E1098:')
call assert_fails("for x in function('winnr')", 'E1098:')
call assert_fails("for x in {'a': 9}", 'E1098:')
call assert_fails("for v:maxcol in range(1)", 'E46:')

let lines =<< trim END
for v:maxcol in range(5)
endfor
END

let save_v_maxcol = v:maxcol
call v9.CheckLegacyAndVim9Failure(lines, 'E46:')
call assert_equal(save_v_maxcol, v:maxcol)

let lines =<< trim END
for g:constvar in range(5)
endfor
END

const g:constvar = 10
call v9.CheckLegacyAndVim9Failure(lines, 'E741:')
call assert_equal(10, g:constvar)
unlet g:constvar

let g:constvar = 10
lockvar 0 g:constvar
call v9.CheckLegacyAndVim9Failure(lines, 'E1122:')
call assert_equal(10, g:constvar)
unlet g:constvar

if 0
/1/5/2/s/\n
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
665,
/**/
664,
/**/
Expand Down

0 comments on commit 85caee7

Please sign in to comment.