[vim/vim] Fix vimtutor problem on Windows. (#5774)

42 views
Skip to first unread message

Wu Yongwei

unread,
Mar 12, 2020, 1:15:51 AM3/12/20
to vim/vim, Subscribed

This change fixe issue #5756.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/5774

Commit Summary

  • Fix vimtutor problem on Windows with UAC.

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

K.Takata

unread,
Mar 12, 2020, 1:26:24 AM3/12/20
to vim/vim, Subscribed

It looks that this can close #2188.

K.Takata

unread,
Mar 12, 2020, 1:38:54 AM3/12/20
to vim/vim, Subscribed

@k-takata commented on this pull request.


In vimtutor.bat:

> +call :test_dir %0 %%d

+IF NOT ERRORLEVEL 1 GOTO dir_ok

⬇️ Suggested change
-call :test_dir %0 %%d

-IF NOT ERRORLEVEL 1 GOTO dir_ok

+    call :test_dir %0 %%d

+    IF NOT ERRORLEVEL 1 GOTO dir_ok

Indenting would be better.


In vimtutor.bat:

> @@ -10,7 +10,20 @@

 :: When that also fails, it uses the English version.

 

 :: 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 %0 %%d

+IF NOT ERRORLEVEL 1 GOTO dir_ok

+)

+

+echo No working directory is found

+GOTO end

+

+:test_dir

How about making the label more explanatory? (e.g. :test_dir_writable)
Or how about adding a comment?

Wu Yongwei

unread,
Mar 12, 2020, 1:44:44 AM3/12/20
to vim/vim, Subscribed

@adah1972 commented on this pull request.


In vimtutor.bat:

> +call :test_dir %0 %%d
+IF NOT ERRORLEVEL 1 GOTO dir_ok

I just followed the current convention. The other if-blocks are not indented, either. Should I indent just this block?

Wu Yongwei

unread,
Mar 12, 2020, 1:45:24 AM3/12/20
to vim/vim, Subscribed

@adah1972 commented on this pull request.


In vimtutor.bat:

> @@ -10,7 +10,20 @@
 :: When that also fails, it uses the English version.
 
 :: 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 %0 %%d
+IF NOT ERRORLEVEL 1 GOTO dir_ok
+)
+
+echo No working directory is found
+GOTO end
+
+:test_dir

I think changing the label would be clearer. I prefer better names to comments.

K.Takata

unread,
Mar 12, 2020, 1:50:42 AM3/12/20
to vim/vim, Subscribed

@k-takata commented on this pull request.


In vimtutor.bat:

> +call :test_dir %0 %%d
+IF NOT ERRORLEVEL 1 GOTO dir_ok

Other if-commands are one-liners, not blocks, so they are not indented.
I think it's better to indent this for-block.

Wu Yongwei

unread,
Mar 12, 2020, 1:52:23 AM3/12/20
to vim/vim, Push

@adah1972 pushed 1 commit.

  • eef59c1 Change a label name and skip unnecessary work.


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

Wu Yongwei

unread,
Mar 12, 2020, 1:59:41 AM3/12/20
to vim/vim, Subscribed

@adah1972 commented on this pull request.


In vimtutor.bat:

> +call :test_dir %0 %%d

+IF NOT ERRORLEVEL 1 GOTO dir_ok

I see that I wrongly regarded some statements below an IF as a block—it is not, as the IF is a GOTO statement...

I'll change.

Wu Yongwei

unread,
Mar 12, 2020, 2:01:33 AM3/12/20
to vim/vim, Push

@adah1972 pushed 1 commit.


You are receiving this because you are subscribed to this thread.

Wu Yongwei

unread,
Mar 12, 2020, 2:27:41 AM3/12/20
to vim/vim, Subscribed

@k-takata Let me know if there is anything missing.

K.Takata

unread,
Mar 12, 2020, 2:30:45 AM3/12/20
to vim/vim, Subscribed

LGTM

Wu Yongwei

unread,
Mar 12, 2020, 2:47:13 AM3/12/20
to vim/vim, Push

@adah1972 pushed 1 commit.


You are receiving this because you are subscribed to this thread.

Bram Moolenaar

unread,
Mar 19, 2020, 12:14:35 PM3/19/20
to vim/vim, Subscribed

Closed #5774 via 37f471d.

Reply all
Reply to author
Forward
0 new messages