]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.468 v7.3.468
authorBram Moolenaar <Bram@vim.org>
Wed, 7 Mar 2012 19:13:49 +0000 (20:13 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 7 Mar 2012 19:13:49 +0000 (20:13 +0100)
Problem:    For some compilers the error file is not easily readable.
Solution:   Use QuickFixCmdPre for more commands. (Marcin Szamotulski)

runtime/doc/autocmd.txt
src/quickfix.c
src/version.c

index d6338ee6759235ce24ae250f81b1b19cb0341ed1..44d2d62c46af637d1400d7414947ac90f95eb4dc 100644 (file)
@@ -711,7 +711,10 @@ QuickFixCmdPre                     Before a quickfix command is run (|:make|,
                                                        *QuickFixCmdPost*
 QuickFixCmdPost                        Like QuickFixCmdPre, but after a quickfix
                                command is run, before jumping to the first
-                               location.  See |QuickFixCmdPost-example|.
+                               location. For |:cfile| and |:lfile| commands
+                               it is run after error file is read and before
+                               moving to the first error. 
+                               See |QuickFixCmdPost-example|.
                                                        *RemoteReply*
 RemoteReply                    When a reply from a Vim that functions as
                                server was received |server2client()|.  The
index 19eb0587a4151a4663ea1a027649f99520d929cf..a581eb06c610996749eeac3d953b8d7b7ce347aa 100644 (file)
@@ -2995,11 +2995,28 @@ ex_cfile(eap)
 {
     win_T      *wp = NULL;
     qf_info_T  *qi = &ql_info;
+#ifdef FEAT_AUTOCMD
+    char_u     *au_name = NULL;
+#endif
 
     if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
-       || eap->cmdidx == CMD_laddfile)
+                                              || eap->cmdidx == CMD_laddfile)
        wp = curwin;
 
+#ifdef FEAT_AUTOCMD
+    switch (eap->cmdidx)
+    {
+       case CMD_cfile:     au_name = (char_u *)"cfile"; break;
+       case CMD_cgetfile:  au_name = (char_u *)"cgetfile"; break;
+       case CMD_caddfile:  au_name = (char_u *)"caddfile"; break;
+       case CMD_lfile:     au_name = (char_u *)"lfile"; break;
+       case CMD_lgetfile:  au_name = (char_u *)"lgetfile"; break;
+       case CMD_laddfile:  au_name = (char_u *)"laddfile"; break;
+       default: break;
+    }
+    if (au_name != NULL)
+       apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, NULL, FALSE, curbuf);
+#endif
 #ifdef FEAT_BROWSE
     if (cmdmod.browse)
     {
@@ -3031,10 +3048,22 @@ ex_cfile(eap)
                                  && (eap->cmdidx == CMD_cfile
                                             || eap->cmdidx == CMD_lfile))
     {
+#ifdef FEAT_AUTOCMD
+       if (au_name != NULL)
+           apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
+#endif
        if (wp != NULL)
            qi = GET_LOC_LIST(wp);
        qf_jump(qi, 0, 0, eap->forceit);        /* display first error */
     }
+
+    else
+    {
+#ifdef FEAT_AUTOCMD
+       if (au_name != NULL)
+           apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
+#endif
+    }
 }
 
 /*
index 7a22e46cb612bbf5c26e82fc0a5ab96bf0b6c55e..65ad51df5a80c81718f3719308a0db37aeb1f659 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    468,
 /**/
     467,
 /**/