[SCM] Vim packaging branch, deb/set-cp-after-init, updated. upstream/7.2.000-19-gb14a2be

James Vega jamessan at debian.org
Tue Aug 12 21:53:32 UTC 2008


The following commit has been merged in the deb/set-cp-after-init branch:
commit b14a2be41ebc9633b2f4cc1fca870d2cb36c49cb
Author: James Vega <jamessan at debian.org>
Date:   Tue Aug 12 17:51:38 2008 -0400

    Handle -N/-C immediately as well as after {g,}vimrc
    
    Matt Wozniski brought up that the current behavior breaks loading of plugins
    and testing for the 'compatible' state in {g,}vimrc.
    
    Restore the behavior of immediately setting 'compatible' when -N/-C are
    processed, move the "override vimrc" behavior to just after processing the
    vimrc files instead of after all startup files are processed, and if the gui
    is starting, change the setting one last time to make sure gvimrc didn't pull
    the rug out from under us.
    
    Signed-off-by: James Vega <jamessan at debian.org>

diff --git a/src/main.c b/src/main.c
index 23347c7..75ccd4c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -560,6 +560,16 @@ main
     /* Source startup scripts. */
     source_startup_scripts(&params);
 
+    /*
+     * Now that the startup files are done being sourced, we set 'cp' to the
+     * value specified on the command-line, if there was one.  This ensures
+     * that the desired value is used while plugins are being loaded.
+     */
+    if (params.option_cp == SET_CP)
+	change_compatible(TRUE);
+    else if (params.option_cp == SET_NOCP)
+	change_compatible(FALSE);
+
 #ifdef FEAT_EVAL
     /*
      * Read all the plugin files.
@@ -640,16 +650,15 @@ main
 	 * don't have them. */
 	if (!gui.in_use && params.evim_mode)
 	    mch_exit(1);
+
+	/* One last time since gvimrc may have changed things on us. */
+	if (params.option_cp == SET_CP)
+	    change_compatible(TRUE);
+	else if (params.option_cp == SET_NOCP)
+	    change_compatible(FALSE);
     }
 #endif
 
-    /* -N/-C given on the command-line.  Now that the startup files are done
-     * being sourced, we set the option. */
-    if (params.option_cp == SET_CP)
-	change_compatible(TRUE);
-    else if (params.option_cp == SET_NOCP)
-	change_compatible(FALSE);
-
 #ifdef SPAWNO		/* special MSDOS swapping library */
     init_SPAWNO("", SWAP_ANY);
 #endif
@@ -1766,6 +1775,7 @@ command_line_scan(parmp)
 		break;
 
 	    case 'C':		/* "-C"  Compatible */
+		change_compatible(TRUE);
 		parmp->option_cp = SET_CP;
 		break;
 
@@ -1839,6 +1849,7 @@ command_line_scan(parmp)
 		break;
 
 	    case 'N':		/* "-N"  Nocompatible */
+		change_compatible(FALSE);
 		parmp->option_cp = SET_NOCP;
 		break;
 

-- 
Vim packaging



More information about the pkg-vim-maintainers mailing list