]> granicus.if.org Git - vim/commitdiff
updated for version 7.0182
authorBram Moolenaar <Bram@vim.org>
Thu, 19 Jan 2006 22:09:32 +0000 (22:09 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 19 Jan 2006 22:09:32 +0000 (22:09 +0000)
runtime/doc/cmdline.txt
runtime/indent/php.vim
runtime/spell/nl/nl_NL.diff
src/buffer.c
src/ex_docmd.c
src/normal.c
src/os_unix.c
src/proto/ex_getln.pro
src/vim.h
src/window.c

index d12c1ea779e448137aead90088f7b27b2f0c0ad5..2fc068f2c866961e8ae84d00c87f4e8ea8bdc992 100644 (file)
@@ -1,4 +1,4 @@
-*cmdline.txt*   For Vim version 7.0aa.  Last change: 2005 Dec 30
+*cmdline.txt*   For Vim version 7.0aa.  Last change: 2006 Jan 19
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -153,8 +153,9 @@ CTRL-R {0-9a-z"%#:-=.}                                      *c_CTRL-R* *c_<C-R>*
                                                        *c_CTRL-R_=*
                        '='     the expression register: you are prompted to
                                enter an expression (see |expression|)
-                               (doesn't work at the expression prompt; uses
-                               the |sandbox| to avoid side effects)
+                               (doesn't work at the expression prompt; some
+                               things such as changing the buffer or current
+                               window are not allowed to avoid side effects)
                See |registers| about registers.  {not in Vi}
                Implementation detail: When using the |expression| register
                and invoking setcmdpos(), this sets the position before
index 8d05b03b0f94faa9db6cdd52ca11fd048dd49319..de313814c956c950b4ac0d3b0eec1b839bdba232 100644 (file)
@@ -2,8 +2,9 @@
 " Language:    PHP
 " Author:      John Wellesz <John.wellesz (AT) teaser (DOT) fr>
 " URL:         http://www.2072productions.com/vim/indent/php.vim
-" Last Change: 2005 Nobember 21st
-" Version: 1.20
+" Last Change:  2006 January 15th
+" Newsletter:   http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
+" Version:     1.23
 "
 "  The change log and all the comments have been removed from this file.
 "
 "  2072productions.com at the URI provided above.
 " 
 "  If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr
-"  with an example of code that break the algorithm.
+"  with an example of code that breaks the algorithm.
 "
 "
 "      Thanks a lot for using this script.
 "
 "
 " NOTE: This script must be used with PHP syntax ON and with the php syntax
-"      script by Lutz Eymers (http://www.isp.de/data/php.vim ) that's the script bundled with Gvim.
+"      script by Lutz Eymers ( http://www.isp.de/data/php.vim ) that's the script bundled with Vim.
 "
 "
 "      In the case you have syntax errors in your script such as end of HereDoc
 
 
 
+
+
+
+
 if exists("b:did_indent")
     finish
 endif
@@ -127,7 +132,7 @@ if &fileformat == "unix" && exists("PHP_removeCRwhenUnix") && PHP_removeCRwhenUn
 endif
 
 if exists("*GetPhpIndent")
-   finish " XXX
+    finish " XXX
 endif
 
 let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
@@ -136,7 +141,13 @@ let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
 
 
 function! GetLastRealCodeLNum(startline) " {{{
+    
     let lnum = a:startline
+    
+    if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1
+       let lnum = b:GetLastRealCodeLNum_ADD
+    endif
+    
     let old_lnum = lnum
 
     while lnum > 1
@@ -288,7 +299,7 @@ function! IslinePHP (lnum, tofind) " {{{
 endfunction " }}}
 
 let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\);'
-let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|[|&]\)'
+let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\|[|&]\)'
 
 let s:autorestoptions = 0
 if ! s:autorestoptions
@@ -316,6 +327,8 @@ endfunc
 
 function! GetPhpIndent()
 
+    let b:GetLastRealCodeLNum_ADD = 0
+
     let UserIsEditing=0
     if b:PHP_oldchangetick != b:changedtick
        let b:PHP_oldchangetick = b:changedtick
@@ -361,7 +374,10 @@ function! GetPhpIndent()
     if !b:InPHPcode_checked " {{{ One time check
        let b:InPHPcode_checked = 1
 
-       let synname = IslinePHP (prevnonblank(v:lnum), "")
+       let synname = ""
+       if cline !~ '<?.*?>'
+           let synname = IslinePHP (prevnonblank(v:lnum), "")
+       endif
 
        if synname!=""
            if synname != "phpHereDoc"
@@ -425,6 +441,7 @@ function! GetPhpIndent()
 
            elseif cline =~? '<script\>'
                let b:InPHPcode_and_script = 1
+               let b:GetLastRealCodeLNum_ADD = v:lnum
            endif
        endif
     endif
@@ -453,11 +470,11 @@ function! GetPhpIndent()
        endif
     endif " }}}
 
+    
     if !b:InPHPcode && !b:InPHPcode_and_script
        return -1
     endif
 
-
     " Indent successive // or # comment the same way the first is {{{
     if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
        if b:PHP_LastIndentedWasComment == 1
@@ -482,9 +499,11 @@ function! GetPhpIndent()
        endif
     endif
 
-    if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*'
+    if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*' && cline !~ '\*/\s*$'
+       if getline(v:lnum + 1) !~ '^\s*\*'
+           return -1
+       endif
        let b:PHP_InsideMultilineComment = 1
-       return -1
     endif " }}}
 
 
@@ -504,6 +523,7 @@ function! GetPhpIndent()
     let s:level = 0
 
     let lnum = GetLastRealCodeLNum(v:lnum - 1)
+
     let last_line = getline(lnum)
     let ind = indent(lnum)
     let endline= s:endline
index 2509250d6975a0895452afd3eb4f5ea92f48b8b1..5de01c02922354b907d61ea5dba21a357f2e319a 100644 (file)
@@ -1,8 +1,8 @@
 *** nl_NL.orig.aff     Sun Jul  3 18:24:07 2005
---- nl_NL.aff  Tue Aug 23 14:03:48 2005
+--- nl_NL.aff  Thu Dec 29 19:42:56 2005
 ***************
 *** 3,6 ****
---- 3,30 ----
+--- 3,31 ----
   
 + FOL  ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
 + LOW  ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
 + 
 + MIDWORD      '-
 + 
-+ KEP =
-+ RAR ?
++ KEEPCASE =
++ RARE ?
 + BAD !
++ SLASH ,
 + 
   NOSPLITSUGS
   
@@ -53,7 +54,7 @@
 ! SFX J 0 je [aeiou][bcdfgkpt] 
 ! SFX J 0 jes [aeiou][bcdfgkpt] 
   
---- 57,76 ----
+--- 58,77 ----
   SFX J N 18
 ! SFX J 0 tje [aeiou][aeiou]
 ! SFX J 0 tjes [aeiou][aeiou]
@@ -79,7 +80,7 @@
   REP ubi ibu
 ! REP croc krok 
   REP ten than
---- 277,279 ----
+--- 278,280 ----
   REP ubi ibu
 ! REP croc krok
   REP ten than
@@ -88,7 +89,7 @@
   REP capucino cappuccino
 ! REP celcius Celsius 
   REP kado cadeau
---- 312,314 ----
+--- 313,315 ----
   REP capucino cappuccino
 ! REP celcius Celsius
   REP kado cadeau
   REP kommittee comité
 ! REP kwis quiz 
   REP kwissen quizzen
---- 318,324 ----
+--- 319,325 ----
   REP committee comité
 ! REP komitee comité
 ! REP komittee comité
   REP copy kopij
 ! REP pitoresque pittoreske 
   REP reikweite reikwijdte
---- 326,328 ----
+--- 327,329 ----
   REP copy kopij
 ! REP pitoresque pittoreske
   REP reikweite reikwijdte
 ! REP kontekst context 
 ! REP korrekt correct 
   REP kritikus criticus
---- 338,343 ----
+--- 339,344 ----
   REP klup club
 ! REP wiskid whizzkid
 ! REP kontakt contact
   REP kritikus criticus
 ***************
 *** 333 ****
---- 357,360 ----
+--- 358,361 ----
   REP aflassen afgelasten
 + REP svp s.v.p.
 + REP zoz z.o.z.
 + 
 *** nl_NL.orig.dic     Sun Jul  3 18:24:07 2005
---- nl_NL.dic  Sat Dec 10 20:46:29 2005
+--- nl_NL.dic  Tue Jan 17 20:39:49 2006
 ***************
 *** 1,3 ****
   119937
 ! achterwand/N
   achterweg/NE
 ***************
+*** 4896,4897 ****
+--- 4900,4902 ----
+  aidsepidemie
++ aidspreventieprogramma
+  aidspreventieprogramma's
+***************
 *** 7485,7486 ****
---- 7489,7498 ----
+--- 7490,7499 ----
   avond/SN
 + 's avonds/=
 + 's middags/=
   avondappèl/S
 ***************
 *** 20681,20682 ****
---- 20693,20695 ----
+--- 20694,20696 ----
   cytostatica
 + d.m.v.
   daad/P
   hartelozer
 ! hartelust
   harten/S
---- 41822,41824 ----
+--- 41823,41825 ----
   hartelozer
 ! hartenlust
   harten/S
 ***************
 *** 46300,46301 ****
---- 46313,46315 ----
+--- 46314,46316 ----
   informaticus
 + informatie/S
   informatie-uitwisseling
 ***************
 *** 60206,60208 ****
---- 60220,60227 ----
+--- 60221,60228 ----
   löss
 + m.a.w.
 + m.b.t.
   maag
 ***************
 *** 77996,77997 ****
---- 78015,78017 ----
+--- 78016,78018 ----
   pluisje
 + pluisjes
   pluist/UF
   programmablad
 ! programmaboekje
   programmacode
---- 80330,80332 ----
+--- 80331,80333 ----
   programmablad
 ! programmaboekje/S
   programmacode
 ***************
 *** 97474,97475 ****
---- 97494,97497 ----
+--- 97495,97498 ----
   suïciderisico/X
 + s.v.p.
 + z.o.z.
   swagger/S
 ***************
 *** 101428,101429 ****
---- 101450,101453 ----
+--- 101451,101454 ----
   toezichthouder/S
 + toezichthoudersaansprakelijkheidsverzekering
 + toezichthoudersaansprakelijkheidsverzekeringen
   toezie/N
 ***************
 *** 103707,103708 ****
---- 103731,103733 ----
+--- 103732,103734 ----
   tête-à-tête/S
 + u
   uchtend/N
 ***************
 *** 110847,110848 ****
---- 110872,110874 ----
+--- 110873,110875 ----
   voorjaarscollectie/S
 + voorjaarsconferentie/S
   voorjaarsmoeheid
 ***************
 *** 119938 ****
---- 119964,173136 ----
+--- 119965,173166 ----
   überhaupt
 + Christiaan/X
 + Fred/X
 + René/X
 + Renée/X
 + Walter/X
++ Verhagen/X
 + # toevoegingen uit de Woordenlijst van 30 mei 1996
 + a capella
 + a fortiori
 + wishful thinking
 + à gogo
 + à propos
++ a.s.
 + evt.
 + enz.
++ t,m
 + bijv.
 + t.n.v.
 + m.b.v.
 + et al.
++ Abraham
++ Anita
++ Boudewijn
++ Bram
++ Edwin
++ Erwin
 + Gerard
++ Gert
 + Google
++ Jos
++ Laurens
++ Leon
 + Luc
 + Luuk
-+ Gert
 + Marion
-+ Jos
-+ Boudewijn
-+ Abraham
++ Paul
++ Nikon
++ Pentax
++ Minolta
++ Mariëlle
++ Jeroen
++ Wytze
++ Océ
++ Philips
++ Shell
++ KPN
++ FNV
++ CNV
++ NLUUG
++ ICCF
++ aidsvoorlichting
 + # Woorden uit de Woordenlijst Nederlandse Taal - Officiële Spelling 2005
 + # TODO: werkwoord vervoegingen
 + 's anderendaags
 + 't is dief en diefjesmaat
++ 11 julifeest
 + 11 julifeesten
 + 11 juliviering
 + 11 julivieringen
 + a-priorische
 + a.m.
 + a.u.b.
++ blz.
++ e.d.
 + aagje
 + aagjes
 + aaibaar
 + über-ich
 + übermensch
 + übermenschen
++ 
index 1190117915026400c3c95d3cae43cf87625f5323..677215d2d36882d0adcb75fb27b8a9b1bd09b199 100644 (file)
@@ -1806,10 +1806,11 @@ buflist_getfile(n, lnum, options, forceit)
     if (buf == curbuf)
        return OK;
 
-#ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0)
+    if (editing_cmdline())
+    {
+       editing_cmdline_msg();
        return FAIL;
-#endif
+    }
 
     /* altfpos may be changed by getfile(), get it now */
     if (lnum == 0)
index e15c6c5d7be00e4b9e28187482d10547b7e42ec3..fe9cd6bc15bcb037a9c11d1b2085a51483372c45 100644 (file)
@@ -2026,7 +2026,17 @@ do_one_cmd(cmdlinep, sourcing,
        }
        else if (ea.addr_count != 0)
        {
-           if (ea.line2 < 0 || ea.line2 > curbuf->b_ml.ml_line_count)
+           if (ea.line2 > curbuf->b_ml.ml_line_count)
+           {
+               /* With '-' in 'cpoptions' a line number past the file is an
+                * error, otherwise put it at the end of the file. */
+               if (vim_strchr(p_cpo, CPO_MINUS) != NULL)
+                   ea.line2 = -1;
+               else
+                   ea.line2 = curbuf->b_ml.ml_line_count;
+           }
+
+           if (ea.line2 < 0)
                errormsg = (char_u *)_(e_invrange);
            else
            {
@@ -2126,18 +2136,22 @@ do_one_cmd(cmdlinep, sourcing,
            errormsg = (char_u *)_(e_modifiable);
            goto doend;
        }
-#ifdef FEAT_CMDWIN
-       if (cmdwin_type != 0 && !(ea.argt & CMDWIN)
+
+       if (editing_cmdline() && !(ea.argt & CMDWIN)
 # ifdef FEAT_USR_CMDS
                && !USER_CMDIDX(ea.cmdidx)
 # endif
           )
        {
-           /* Command not allowed in cmdline window. */
-           errormsg = (char_u *)_(e_cmdwin);
+           /* Command not allowed when editing the command line. */
+#ifdef FEAT_CMDWIN
+           if (cmdwin_type != 0)
+               errormsg = (char_u *)_(e_cmdwin);
+           else
+#endif
+               errormsg = (char_u *)_(e_secure);
            goto doend;
        }
-#endif
 
        if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0)
        {
@@ -2977,12 +2991,9 @@ set_one_cmd_context(xp, buff)
     int                        forceit = FALSE;
     int                        usefilter = FALSE;  /* filter instead of file name */
 
+    ExpandInit(xp);
     xp->xp_pattern = buff;
     xp->xp_context = EXPAND_COMMANDS;  /* Default until we get past command */
-    xp->xp_backslash = XP_BS_NONE;
-#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
-    xp->xp_arg = NULL;
-#endif
     ea.argt = 0;
 
 /*
@@ -3254,6 +3265,11 @@ set_one_cmd_context(xp, buff)
        if (bow != NULL && in_quote)
            xp->xp_pattern = bow;
        xp->xp_context = EXPAND_FILES;
+#ifndef BACKSLASH_IN_FILENAME
+       /* For a shell command more chars need to be escaped. */
+       if (usefilter || ea.cmdidx == CMD_bang)
+           xp->xp_shell = TRUE;
+#endif
 
        /* Check for environment variable */
        if (*xp->xp_pattern == '$'
@@ -4189,16 +4205,16 @@ expand_filename(eap, cmdlinep, errormsgp)
 
        /* For a shell command a '!' must be escaped. */
        if ((eap->usefilter || eap->cmdidx == CMD_bang)
-                             && vim_strpbrk(repl, (char_u *)"!&;()") != NULL)
+                           && vim_strpbrk(repl, (char_u *)"!&;()<>") != NULL)
        {
            char_u      *l;
 
-           l = vim_strsave_escaped(repl, (char_u *)"!&;()");
+           l = vim_strsave_escaped(repl, (char_u *)"!&;()<>");
            if (l != NULL)
            {
                vim_free(repl);
                repl = l;
-               /* For a sh-like shell escape it another time. */
+               /* For a sh-like shell escape "!" another time. */
                if (strstr((char *)p_sh, "sh") != NULL)
                {
                    l = vim_strsave_escaped(repl, (char_u *)"!");
@@ -6017,6 +6033,12 @@ ex_quit(eap)
        return;
     }
 #endif
+    /* Don't quit while editing the command line. */
+    if (editing_cmdline())
+    {
+       editing_cmdline_msg();
+       return;
+    }
 
 #ifdef FEAT_NETBEANS_INTG
     netbeansForcedQuit = eap->forceit;
@@ -6079,6 +6101,14 @@ ex_quit_all(eap)
        return;
     }
 # endif
+
+    /* Don't quit while editing the command line. */
+    if (editing_cmdline())
+    {
+       editing_cmdline_msg();
+       return;
+    }
+
     exiting = TRUE;
     if (eap->forceit || !check_changed_any(FALSE))
        getout(0);
@@ -6098,7 +6128,8 @@ ex_close(eap)
        cmdwin_result = K_IGNORE;
     else
 # endif
-       ex_win_close(eap, curwin);
+       if (!editing_cmdline())
+           ex_win_close(eap, curwin);
 }
 
     static void
@@ -6257,6 +6288,12 @@ ex_exit(eap)
        return;
     }
 #endif
+    /* Don't quit while editing the command line. */
+    if (editing_cmdline())
+    {
+       editing_cmdline_msg();
+       return;
+    }
 
     /*
      * if more files or windows we won't exit
@@ -6369,10 +6406,9 @@ handle_drop(filec, filev, split)
     exarg_T    ea;
     int                save_msg_scroll = msg_scroll;
 
-# ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0)
+    /* Postpone this while editing the command line. */
+    if (editing_cmdline())
        return;
-# endif
 
     /* Check whether the current buffer is changed. If so, we will need
      * to split the current window or data could be lost.
index b0262b2225feb07efb19296cb011e3821b2649d0..12ede7375a293c73faf6eeb8573421a8fb579557 100644 (file)
@@ -788,15 +788,14 @@ getcount:
        clearopbeep(oap);
        goto normal_end;
     }
-#ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0 && (nv_cmds[idx].cmd_flags & NV_NCW))
+
+    if (editing_cmdline() && (nv_cmds[idx].cmd_flags & NV_NCW))
     {
-       /* This command is not allowed in the cmdline window: beep. */
+       /* This command is not allowed wile editing a ccmdline: beep. */
        clearopbeep(oap);
-       EMSG(_(e_cmdwin));
+       editing_cmdline_msg();
        goto normal_end;
     }
-#endif
 
 #ifdef FEAT_VISUAL
     /*
@@ -3640,6 +3639,7 @@ add_to_showcmd(c)
        K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
        K_MOUSEDOWN, K_MOUSEUP,
        K_X1MOUSE, K_X1DRAG, K_X1RELEASE, K_X2MOUSE, K_X2DRAG, K_X2RELEASE,
+       K_CURSORHOLD,
        0
     };
 #endif
@@ -5741,13 +5741,12 @@ nv_gotofile(cap)
 {
     char_u     *ptr;
 
-#ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0)
+    if (editing_cmdline())
     {
        clearopbeep(cap->oap);
+       editing_cmdline_msg();
        return;
     }
-#endif
 
     ptr = grab_file_name(cap->count1);
 
@@ -7802,13 +7801,13 @@ nv_g_cmd(cap)
 
     /* "gQ": improved Ex mode */
     case 'Q':
-#ifdef FEAT_CMDWIN
-       if (cmdwin_type != 0)
+       if (editing_cmdline())
        {
            clearopbeep(cap->oap);
+           editing_cmdline_msg();
            break;
        }
-#endif
+
        if (!checkclearopq(oap))
            do_exmode(TRUE);
        break;
index faf2847a638aec9590a68ee1855b8f8ed86b9dd1..afc68ff841375c4910afbb414e085c47b8629c69 100644 (file)
@@ -4852,7 +4852,7 @@ mch_expandpath(gap, path, flags)
 # define SEEK_END 2
 #endif
 
-#define SHELL_SPECIAL (char_u *)"\t \"&';<>[\\]|"
+#define SHELL_SPECIAL (char_u *)"\t \"&';<>\\|"
 
 /* ARGSUSED */
     int
index fe2752b8d94d831cbde3988fc46ec768473e34eb..3b11a38a7962fd0a5d96dfded522ae713278a24a 100644 (file)
@@ -1,6 +1,8 @@
 /* ex_getln.c */
 char_u *getcmdline __ARGS((int firstc, long count, int indent));
 char_u *getcmdline_prompt __ARGS((int firstc, char_u *prompt, int attr, int xp_context, char_u *xp_arg));
+int editing_cmdline __ARGS((void));
+void editing_cmdline_msg __ARGS((void));
 char_u *getexline __ARGS((int c, void *dummy, int indent));
 char_u *getexmodeline __ARGS((int promptc, void *dummy, int indent));
 int cmdline_overstrike __ARGS((void));
index 9fc38f52f38ecf7c26a7e7ef6bfe72c67194e398..bc0b334ed2c0eb40f46f71c8674336c336e525b9 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
 # else
 #  define PATH_ESC_CHARS ((char_u *)" \t*?[{`$\\%#'\"|")
 # endif
+# define SHELL_ESC_CHARS ((char_u *)" \t*?[{`$\\%#'\"|<>();&!")
 #endif
 
 #define NUMBUFLEN 30       /* length of a buffer to store a number in ASCII */
index 7d50180478da63bb67717952dc488158d751ce9c..680c3201715e890dbd1abda275e232db123fc06e 100644 (file)
@@ -2717,13 +2717,13 @@ win_alloc_first()
 win_goto(wp)
     win_T      *wp;
 {
-#ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0)
+    if (editing_cmdline())
     {
        beep_flush();
+       editing_cmdline_msg();
        return;
     }
-#endif
+
 #ifdef FEAT_VISUAL
     if (wp->w_buffer != curbuf)
        reset_VIsual_and_resel();