forked from aniani/vim
patch 8.2.0412: MS-Windows: cannot use vimtutor from the start menu
Problem: MS-Windows: cannot use vimtutor from the start menu. Solution: Better check for writable directory. Use the right path for the executable. (Wu Yongwei, closes #5774, closes #5756)
This commit is contained in:
parent
24e9b6fe4b
commit
37f471df6e
@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
412,
|
||||||
/**/
|
/**/
|
||||||
411,
|
411,
|
||||||
/**/
|
/**/
|
||||||
|
31
vimtutor.bat
31
vimtutor.bat
@ -10,7 +10,20 @@
|
|||||||
:: When that also fails, it uses the English version.
|
:: When that also fails, it uses the English version.
|
||||||
|
|
||||||
:: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
|
:: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
|
||||||
FOR %%d in (. "%TMP%" "%TEMP%") DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$
|
FOR %%d in (. %TMP% %TEMP%) DO (
|
||||||
|
call :test_dir_writable %0 %%d
|
||||||
|
IF NOT ERRORLEVEL 1 GOTO dir_ok
|
||||||
|
)
|
||||||
|
|
||||||
|
echo No working directory is found
|
||||||
|
GOTO end
|
||||||
|
|
||||||
|
:test_dir_writable
|
||||||
|
SET TUTORCOPY=%2\$tutor$
|
||||||
|
COPY %1 %TUTORCOPY% >nul 2>nul
|
||||||
|
GOTO end
|
||||||
|
|
||||||
|
:dir_ok
|
||||||
|
|
||||||
SET xx=%1
|
SET xx=%1
|
||||||
|
|
||||||
@ -25,23 +38,11 @@ GOTO use_vim
|
|||||||
:: installation.
|
:: installation.
|
||||||
|
|
||||||
:: The script tutor.vim tells Vim which file to copy.
|
:: The script tutor.vim tells Vim which file to copy.
|
||||||
:: For Windows NT "start" works a bit differently.
|
start "dummy" /b /w "%~dp0gvim.exe" -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
|
||||||
IF .%OS%==.Windows_NT GOTO ntaction
|
|
||||||
|
|
||||||
start /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
|
|
||||||
IF ERRORLEVEL 1 GOTO use_vim
|
IF ERRORLEVEL 1 GOTO use_vim
|
||||||
|
|
||||||
:: Start gvim without any .vimrc, set 'nocompatible'
|
:: Start gvim without any .vimrc, set 'nocompatible'
|
||||||
start /w gvim -u NONE -c "set nocp" %TUTORCOPY%
|
start "dummy" /b /w "%~dp0gvim.exe" -u NONE -c "set nocp" %TUTORCOPY%
|
||||||
|
|
||||||
GOTO end
|
|
||||||
|
|
||||||
:ntaction
|
|
||||||
start "dummy" /b /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
|
|
||||||
IF ERRORLEVEL 1 GOTO use_vim
|
|
||||||
|
|
||||||
:: Start gvim without any .vimrc, set 'nocompatible'
|
|
||||||
start "dummy" /b /w gvim -u NONE -c "set nocp" %TUTORCOPY%
|
|
||||||
|
|
||||||
GOTO end
|
GOTO end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user