# HG changeset patch # User vimboss # Date 1210174833 0 # Node ID 73c5752b957d49da8312ef87383a7368c78df74c # Parent 8dc36a64ae8b36d124bc0767ccadba3daea943ec updated for version 7.1-295 diff --git a/runtime/doc/vimtutor.1 b/runtime/doc/vimtutor.1 --- a/runtime/doc/vimtutor.1 +++ b/runtime/doc/vimtutor.1 @@ -3,7 +3,7 @@ vimtutor \- the Vim tutor .SH SYNOPSIS .br -.B vimtutor [language] +.B vimtutor [-g] [language] .SH DESCRIPTION .B Vimtutor starts the @@ -18,6 +18,9 @@ is useful for people that want to learn .B Vim commands. .PP +The optional argument -g starts vimtutor with gvim rather than vim, if the +GUI version of vim is available, or falls back to Vim if gvim is not found. +.PP The optional [language] argument is the two-letter name of a language, like "it" or "es". If the [language] argument is missing, the language of the current locale will diff --git a/src/Makefile b/src/Makefile --- a/src/Makefile +++ b/src/Makefile @@ -1867,6 +1867,8 @@ installmacros: $(DEST_VIM) $(DEST_RT) $( installtutorbin: $(DEST_VIM) $(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor + $(INSTALL_DATA) gvimtutor $(DEST_BIN)/$(GVIMNAME)tutor + chmod $(SCRIPTMOD) $(DEST_BIN)/$(GVIMNAME)tutor installtutor: $(DEST_RT) $(DEST_TUTOR) -$(INSTALL_DATA) $(TUTORSOURCE)/README* $(TUTORSOURCE)/tutor* $(DEST_TUTOR) @@ -2075,6 +2077,7 @@ installmanlinks: uninstall: uninstall_runtime -rm -f $(DEST_BIN)/$(VIMTARGET) -rm -f $(DEST_BIN)/vimtutor + -rm -f $(DEST_BIN)/gvimtutor -rm -f $(DEST_BIN)/$(EXTARGET) $(DEST_BIN)/$(VIEWTARGET) -rm -f $(DEST_BIN)/$(GVIMTARGET) $(DEST_BIN)/$(GVIEWTARGET) -rm -f $(DEST_BIN)/$(RVIMTARGET) $(DEST_BIN)/$(RVIEWTARGET) @@ -2171,7 +2174,7 @@ SHADOWDIR = shadow shadow: runtime pixmaps mkdir $(SHADOWDIR) - cd $(SHADOWDIR); ln -s ../*.[ch] ../*.in ../*.sh ../*.xs ../*.xbm ../toolcheck ../proto ../vimtutor ../mkinstalldirs . + cd $(SHADOWDIR); ln -s ../*.[ch] ../*.in ../*.sh ../*.xs ../*.xbm ../toolcheck ../proto ../vimtutor ../gvimtutor ../mkinstalldirs . mkdir $(SHADOWDIR)/auto cd $(SHADOWDIR)/auto; ln -s ../../auto/configure . cd $(SHADOWDIR); rm -f auto/link.sed diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 295, +/**/ 294, /**/ 293, diff --git a/src/vimtutor b/src/vimtutor --- a/src/vimtutor +++ b/src/vimtutor @@ -2,11 +2,24 @@ # Start Vim on a copy of the tutor file. -# Usage: vimtutor [xx], where xx is a language code like "es" or "nl". +# Usage: vimtutor [-g] [xx] +# Where optional argument -g starts vimtutor in gvim (GUI) instead of vim. +# and xx is a language code like "es" or "nl". # When an argument is given, it tries loading that tutor. # When this fails or no argument was given, it tries using 'v:lang' # When that also fails, it uses the English version. +# Vim could be called "vim" or "vi". Also check for "vimN", for people who +# have Vim installed with its version number. +# We anticipate up to a future Vim 8 version :-). +seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi" +if test "$1" = "-g"; then + # Try to use the GUI version of Vim if possible, it will fall back + # on Vim if Gvim is not installed. + seq="gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq" + shift +fi + xx=$1 export xx @@ -39,10 +52,6 @@ export TUTORCOPY # remove the copy of the tutor on exit trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15 -# Vim could be called "vim" or "vi". Also check for "vimN", for people who -# have Vim installed with its version number. -# We anticipate up to a future Vim 8 version :-). -seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi" for i in $seq; do testvim=`which $i 2>/dev/null` if test -f "$testvim"; then @@ -59,7 +68,7 @@ fi # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME # The script tutor.vim tells Vim which file to copy -$VIM -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim' +$VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim' # Start vim without any .vimrc, set 'nocompatible' -$VIM -u NONE -c "set nocp" $TUTORCOPY +$VIM -f -u NONE -c "set nocp" $TUTORCOPY