home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / orig.7.3.202 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  22.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.202
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.202
  11. Problem:    Cannot influence the indent inside a namespace.
  12. Solution:   Add the "N" 'cino' parameter. (Konstantin Lepa)
  13. Files:      runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in,
  14.             src/testdir/test3.ok
  15.  
  16.  
  17. *** ../mercurial/vim73/runtime/doc/indent.txt    2011-04-28 19:01:26.000000000 +0200
  18. --- runtime/doc/indent.txt    2011-05-25 14:35:37.000000000 +0200
  19. ***************
  20. *** 128,140 ****
  21.   used CTRL-T or CTRL-D.
  22.   
  23.                           *cinoptions-values*
  24. ! The 'cinoptions' option sets how Vim performs indentation.  In the list below,
  25.   "N" represents a number of your choice (the number can be negative).  When
  26.   there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
  27.   "1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc.  You can use a
  28. ! decimal point, too: "-0.5s" is minus half a 'shiftwidth'.  The examples below
  29. ! assume a 'shiftwidth' of 4.
  30.       >N    Amount added for "normal" indent.  Used after a line that should
  31.             increase the indent (lines starting with "if", an opening brace,
  32.             etc.).  (default 'shiftwidth').
  33. --- 128,147 ----
  34.   used CTRL-T or CTRL-D.
  35.   
  36.                           *cinoptions-values*
  37. ! The 'cinoptions' option sets how Vim performs indentation.  The value after
  38. ! the option character can be one of these (N is any number):
  39. !     N    indent N spaces
  40. !     -N    indent N spaces to the left
  41. !     Ns    N times 'shiftwidth spaces
  42. !     -Ns    N times 'shiftwidth spaces to the left
  43. ! In the list below,
  44.   "N" represents a number of your choice (the number can be negative).  When
  45.   there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
  46.   "1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc.  You can use a
  47. ! decimal point, too: "-0.5s" is minus half a 'shiftwidth'.
  48. ! The examples below assume a 'shiftwidth' of 4.
  49. !                             *cino->*
  50.       >N    Amount added for "normal" indent.  Used after a line that should
  51.             increase the indent (lines starting with "if", an opening brace,
  52.             etc.).  (default 'shiftwidth').
  53. ***************
  54. *** 145,150 ****
  55. --- 152,158 ----
  56.                 foo;        foo;              foo;
  57.             }              }              }
  58.   <
  59. +                             *cino-e*
  60.       eN    Add N to the prevailing indent inside a set of braces if the
  61.             opening brace at the End of the line (more precise: is not the
  62.             first character in a line).  This is useful if you want a
  63. ***************
  64. *** 160,165 ****
  65. --- 168,174 ----
  66.                 bar;          bar;              bar;
  67.             }              }              }
  68.   <
  69. +                             *cino-n*
  70.       nN    Add N to the prevailing indent for a statement after an "if",
  71.             "while", etc., if it is NOT inside a set of braces.  This is
  72.             useful if you want a different indent when there is no '{'
  73. ***************
  74. *** 174,179 ****
  75. --- 183,189 ----
  76.                 bar;          bar;              bar;
  77.             }              }              }
  78.   <
  79. +                             *cino-f*
  80.       fN    Place the first opening brace of a function or other block in
  81.             column N.  This applies only for an opening brace that is not
  82.             inside other braces and is at the start of the line.  What comes
  83. ***************
  84. *** 184,189 ****
  85. --- 194,200 ----
  86.             {            {              {
  87.                 int foo;            int foo;          int foo;
  88.   <
  89. +                             *cino-{*
  90.       {N    Place opening braces N characters from the prevailing indent.
  91.             This applies only for opening braces that are inside other
  92.             braces.  (default 0).
  93. ***************
  94. *** 193,198 ****
  95. --- 204,210 ----
  96.             {            {              {
  97.                 foo;          foo;              foo;
  98.   <
  99. +                             *cino-}*
  100.       }N    Place closing braces N characters from the matching opening
  101.             brace.  (default 0).
  102.   
  103. ***************
  104. *** 202,207 ****
  105. --- 214,220 ----
  106.                 foo;          foo;              foo;
  107.             }              }                }
  108.   <
  109. +                             *cino-^*
  110.       ^N    Add N to the prevailing indent inside a set of braces if the
  111.             opening brace is in column 0.  This can specify a different
  112.             indent for whole of a function (some may like to set it to a
  113. ***************
  114. *** 216,221 ****
  115. --- 229,235 ----
  116.                 }            }          }
  117.             }              }              }
  118.   <
  119. +                             *cino-L*
  120.       LN    Controls placement of jump labels. If N is negative, the label
  121.             will be placed at column 1. If N is non-negative, the indent of
  122.             the label will be the prevailing indent minus N.  (default -1).
  123. ***************
  124. *** 229,234 ****
  125. --- 243,249 ----
  126.                 }                   }                   }
  127.             }                   }                   }
  128.   <
  129. +                             *cino-:*
  130.       :N    Place case labels N characters from the indent of the switch().
  131.             (default 'shiftwidth').
  132.   
  133. ***************
  134. *** 240,245 ****
  135. --- 255,261 ----
  136.                 default:          default:
  137.             }              }
  138.   <
  139. +                             *cino-=*
  140.       =N    Place statements occurring after a case label N characters from
  141.             the indent of the label.  (default 'shiftwidth').
  142.   
  143. ***************
  144. *** 247,252 ****
  145. --- 263,269 ----
  146.              case 11:        case 11:  a = a + 1;
  147.                  a = a + 1;          b = b + 1;
  148.   <
  149. +                             *cino-l*
  150.       lN    If N != 0 Vim will align with a case label instead of the
  151.             statement after it in the same line.
  152.   
  153. ***************
  154. *** 256,261 ****
  155. --- 273,279 ----
  156.                       break;          break;
  157.                   }          }
  158.   <
  159. +                             *cino-b*
  160.       bN    If N != 0 Vim will align a final "break" with the case label,
  161.             so that case..break looks like a sort of block.  (default: 0).
  162.             When using 1, consider adding "0=break" to 'cinkeys'.
  163. ***************
  164. *** 272,277 ****
  165. --- 290,296 ----
  166.                 break;      break;
  167.             }              }
  168.   <
  169. +                             *cino-g*
  170.       gN    Place C++ scope declarations N characters from the indent of the
  171.             block they are in.  (default 'shiftwidth').  A scope declaration
  172.             can be "public:", "protected:" or "private:".
  173. ***************
  174. *** 283,288 ****
  175. --- 302,308 ----
  176.                 private:          private:
  177.             }              }
  178.   <
  179. +                             *cino-h*
  180.       hN    Place statements occurring after a C++ scope declaration N
  181.             characters from the indent of the label.  (default
  182.             'shiftwidth').
  183. ***************
  184. *** 291,296 ****
  185. --- 311,331 ----
  186.              public:        public:   a = a + 1;
  187.                  a = a + 1;          b = b + 1;
  188.   <
  189. +                             *cino-N*
  190. +     NN    Indent inside C++ namespace N characters extra compared to a
  191. +           normal block.  (default 0).
  192. +         cino=               cino=N-s >
  193. +           namespace {                namespace {
  194. +               void function();       void function();
  195. +           }                          }
  196. +           namespace my               namespace my
  197. +           {                          {
  198. +               void function();       void function();
  199. +           }                          }
  200. + <
  201. +                             *cino-p*
  202.       pN    Parameter declarations for K&R-style function declarations will
  203.             be indented N characters from the margin.  (default
  204.             'shiftwidth').
  205. ***************
  206. *** 300,305 ****
  207. --- 335,341 ----
  208.                 int a;          int a;              int a;
  209.                 char b;          char b;              char b;
  210.   <
  211. +                             *cino-t*
  212.       tN    Indent a function return type declaration N characters from the
  213.             margin.  (default 'shiftwidth').
  214.   
  215. ***************
  216. *** 307,312 ****
  217. --- 343,349 ----
  218.                 int          int             int
  219.             func()          func()          func()
  220.   <
  221. +                             *cino-i*
  222.       iN    Indent C++ base class declarations and constructor
  223.             initializations, if they start in a new line (otherwise they
  224.             are aligned at the right side of the ':').
  225. ***************
  226. *** 320,325 ****
  227. --- 357,363 ----
  228.                 BaseClass(3)        BaseClass(3)
  229.             {}                {}
  230.   <
  231. +                             *cino-+*
  232.       +N    Indent a continuation line (a line that spills onto the next)
  233.                 inside a function N additional characters.  (default
  234.                 'shiftwidth').
  235. ***************
  236. *** 330,335 ****
  237. --- 368,374 ----
  238.             a = b + 9 *            a = b + 9 *
  239.                 c;                  c;
  240.   <
  241. +                             *cino-c*
  242.       cN    Indent comment lines after the comment opener, when there is no
  243.             other text with which to align, N characters from the comment
  244.             opener.  (default 3).  See also |format-comments|.
  245. ***************
  246. *** 339,344 ****
  247. --- 378,384 ----
  248.                text.             text.
  249.              */                 */
  250.   <
  251. +                             *cino-C*
  252.       CN    When N is non-zero, indent comment lines by the amount specified
  253.             with the c flag above even if there is other text behind the
  254.             comment opener.  (default 0).
  255. ***************
  256. *** 349,360 ****
  257. --- 389,402 ----
  258.             ********/            ********/
  259.   <          (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
  260.   
  261. +                             *cino-/*
  262.       /N    Indent comment lines N characters extra.  (default 0).
  263.           cino=              cino=/4 >
  264.             a = b;            a = b;
  265.             /* comment */            /* comment */
  266.             c = d;            c = d;
  267.   <
  268. +                             *cino-(*
  269.       (N    When in unclosed parentheses, indent N characters from the line
  270.             with the unclosed parentheses.  Add a 'shiftwidth' for every
  271.             unclosed parentheses.  When N is 0 or the unclosed parentheses
  272. ***************
  273. *** 370,375 ****
  274. --- 412,418 ----
  275.                 (c2 || c3))        (c2 || c3))
  276.                {                   {
  277.   <
  278. +                             *cino-u*
  279.       uN    Same as (N, but for one level deeper.  (default 'shiftwidth').
  280.   
  281.           cino=              cino=u2 >
  282. ***************
  283. *** 377,382 ****
  284. --- 420,426 ----
  285.                 && (c22345            && (c22345
  286.                     || c3))              || c3))
  287.   <
  288. +                             *cino-U*
  289.       UN    When N is non-zero, do not ignore the indenting specified by
  290.             ( or u in case that the unclosed parentheses is the first
  291.             non-white character in its line.  (default 0).
  292. ***************
  293. *** 388,393 ****
  294. --- 432,438 ----
  295.                  c3                c3
  296.                 ) && c4;            ) && c4;
  297.   <
  298. +                             *cino-2*
  299.       wN    When in unclosed parentheses and N is non-zero and either
  300.             using "(0" or "u0", respectively, or using "U0" and the unclosed
  301.             parentheses is the first non-white character in its line, line
  302. ***************
  303. *** 400,405 ****
  304. --- 445,451 ----
  305.                   || c3))            || c3))
  306.                 foo;            foo;
  307.   <
  308. +                             *cino-W*
  309.       WN    When in unclosed parentheses and N is non-zero and either
  310.             using "(0" or "u0", respectively and the unclosed parentheses is
  311.             the last non-white character in its line and it is not the
  312. ***************
  313. *** 414,419 ****
  314. --- 460,466 ----
  315.             a_short_line(argument,    a_short_line(argument,
  316.                      argument);         argument);
  317.   <
  318. +                             *cino-m*
  319.       mN    When N is non-zero, line up a line starting with a closing
  320.             parentheses with the first character of the line with the
  321.             matching opening parentheses.  (default 0).
  322. ***************
  323. *** 428,433 ****
  324. --- 475,481 ----
  325.                )                )
  326.                 foo;            foo;
  327.   <
  328. +                             *cino-M*
  329.       MN    When N is non-zero, line up a line starting with a closing
  330.             parentheses with the first character of the previous line.
  331.             (default 0).
  332. ***************
  333. *** 437,443 ****
  334.                cond2               cond2
  335.                )                   )
  336.   <
  337. !                     *java-cinoptions* *java-indenting*
  338.       jN    Indent java anonymous classes correctly.  The value 'N' is
  339.             currently unused but must be non-zero (e.g. 'j1').  'j1' will
  340.             indent for example the following code snippet correctly: >
  341. --- 485,491 ----
  342.                cond2               cond2
  343.                )                   )
  344.   <
  345. !                 *java-cinoptions* *java-indenting* *cino-j*
  346.       jN    Indent java anonymous classes correctly.  The value 'N' is
  347.             currently unused but must be non-zero (e.g. 'j1').  'j1' will
  348.             indent for example the following code snippet correctly: >
  349. ***************
  350. *** 448,454 ****
  351.               }
  352.           });
  353.   <
  354. !                 *javascript-cinoptions* *javascript-indenting*
  355.       JN    Indent JavaScript object declarations correctly by not confusing
  356.             them with labels.  The value 'N' is currently unused but must be 
  357.             non-zero (e.g. 'J1'). >
  358. --- 496,502 ----
  359.               }
  360.           });
  361.   <
  362. !             *javascript-cinoptions* *javascript-indenting* *cino-J*
  363.       JN    Indent JavaScript object declarations correctly by not confusing
  364.             them with labels.  The value 'N' is currently unused but must be 
  365.             non-zero (e.g. 'J1'). >
  366. ***************
  367. *** 466,481 ****
  368. --- 514,532 ----
  369.               }
  370.           }
  371.   <
  372. +                                 *cino-)*
  373.       )N    Vim searches for unclosed parentheses at most N lines away.
  374.             This limits the time needed to search for parentheses.  (default
  375.             20 lines).
  376.   
  377. +                                 *cino-star*
  378.       *N    Vim searches for unclosed comments at most N lines away.  This
  379.             limits the time needed to search for the start of a comment.
  380.             If your /* */ comments stop indenting afer N lines this is the
  381.             value you will want to change.
  382.             (default 70 lines).
  383.   
  384. +                                 *cino-#*
  385.       #N    When N is non-zero recognize shell/Perl comments, starting with
  386.             '#'.  Default N is zero: don't recognizes '#' comments.  Note
  387.             that lines starting with # will still be seen as preprocessor
  388. ***************
  389. *** 483,489 ****
  390.   
  391.   
  392.   The defaults, spelled out in full, are:
  393. !     cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,
  394.               c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
  395.   
  396.   Vim puts a line in column 1 if:
  397. --- 534,540 ----
  398.   
  399.   
  400.   The defaults, spelled out in full, are:
  401. !     cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,N0,ps,ts,is,+s,
  402.               c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
  403.   
  404.   Vim puts a line in column 1 if:
  405. *** ../mercurial/vim73/src/misc1.c    2011-05-25 13:33:59.000000000 +0200
  406. --- src/misc1.c    2011-05-25 14:57:31.000000000 +0200
  407. ***************
  408. *** 4959,4964 ****
  409. --- 4959,4965 ----
  410.   static int    corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
  411.   static int    find_last_paren __ARGS((char_u *l, int start, int end));
  412.   static int    find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
  413. + static int    cin_is_cpp_namespace __ARGS((char_u *));
  414.   
  415.   static int    ind_hash_comment = 0;   /* # starts a comment */
  416.   
  417. ***************
  418. *** 5221,5226 ****
  419. --- 5222,5271 ----
  420.       return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':');
  421.   }
  422.   
  423. + /* Maximum number of lines to search back for a "namespace" line. */
  424. + #define FIND_NAMESPACE_LIM 20
  425. + /*
  426. +  * Recognize a "namespace" scope declaration.
  427. +  */
  428. +     static int
  429. + cin_is_cpp_namespace(s)
  430. +     char_u    *s;
  431. + {
  432. +     char_u    *p;
  433. +     int        has_name = FALSE;
  434. +     s = cin_skipcomment(s);
  435. +     if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9])))
  436. +     {
  437. +     p = cin_skipcomment(skipwhite(s + 9));
  438. +     while (*p != NUL)
  439. +     {
  440. +         if (vim_iswhite(*p))
  441. +         {
  442. +         has_name = TRUE; /* found end of a name */
  443. +         p = cin_skipcomment(skipwhite(p));
  444. +         }
  445. +         else if (*p == '{')
  446. +         {
  447. +         break;
  448. +         }
  449. +         else if (vim_iswordc(*p))
  450. +         {
  451. +         if (has_name)
  452. +             return FALSE; /* word character after skipping past name */
  453. +         ++p;
  454. +         }
  455. +         else
  456. +         {
  457. +         return FALSE;
  458. +         }
  459. +     }
  460. +     return TRUE;
  461. +     }
  462. +     return FALSE;
  463. + }
  464.   /*
  465.    * Return a pointer to the first non-empty non-comment character after a ':'.
  466.    * Return NULL if not found.
  467. ***************
  468. *** 6296,6301 ****
  469. --- 6341,6351 ----
  470.        */
  471.       int ind_keep_case_label = 0;
  472.   
  473. +     /*
  474. +      * handle C++ namespace
  475. +      */
  476. +     int ind_cpp_namespace = 0;
  477.       pos_T    cur_curpos;
  478.       int        amount;
  479.       int        scope_amount;
  480. ***************
  481. *** 6336,6341 ****
  482. --- 6386,6392 ----
  483.       int        n;
  484.       int        iscase;
  485.       int        lookfor_break;
  486. +     int        lookfor_cpp_namespace = FALSE;
  487.       int        cont_amount = 0;    /* amount for continuation line */
  488.       int        original_line_islabel;
  489.   
  490. ***************
  491. *** 6409,6414 ****
  492. --- 6460,6466 ----
  493.           case 'J': ind_js = n; break;
  494.           case 'l': ind_keep_case_label = n; break;
  495.           case '#': ind_hash_comment = n; break;
  496. +         case 'N': ind_cpp_namespace = n; break;
  497.       }
  498.       if (*options == ',')
  499.           ++options;
  500. ***************
  501. *** 6976,6986 ****
  502. --- 7028,7051 ----
  503.           if (start_brace == BRACE_IN_COL0)        /* '{' is in column 0 */
  504.           {
  505.           amount = ind_open_left_imag;
  506. +         lookfor_cpp_namespace = TRUE;
  507. +         }
  508. +         else if (start_brace == BRACE_AT_START &&
  509. +             lookfor_cpp_namespace)      /* '{' is at start */
  510. +         {
  511. +         lookfor_cpp_namespace = TRUE;
  512.           }
  513.           else
  514.           {
  515.           if (start_brace == BRACE_AT_END)    /* '{' is at end of line */
  516. +         {
  517.               amount += ind_open_imag;
  518. +             l = skipwhite(ml_get_curline());
  519. +             if (cin_is_cpp_namespace(l))
  520. +             amount += ind_cpp_namespace;
  521. +         }
  522.           else
  523.           {
  524.               /* Compensate for adding ind_open_extra later. */
  525. ***************
  526. *** 7151,7156 ****
  527. --- 7216,7261 ----
  528.               else
  529.                   amount += ind_continuation;
  530.               }
  531. +             else if (lookfor_cpp_namespace)
  532. +             {
  533. +             if (curwin->w_cursor.lnum == ourscope)
  534. +                 continue;
  535. +             if (curwin->w_cursor.lnum == 0
  536. +                 || curwin->w_cursor.lnum
  537. +                           < ourscope - FIND_NAMESPACE_LIM)
  538. +                 break;
  539. +             l = ml_get_curline();
  540. +             /*
  541. +              * If we're in a comment now, skip to the start of the
  542. +              * comment.
  543. +              */
  544. +             trypos = find_start_comment(ind_maxcomment);
  545. +             if (trypos != NULL)
  546. +             {
  547. +                 curwin->w_cursor.lnum = trypos->lnum + 1;
  548. +                 curwin->w_cursor.col = 0;
  549. +                 continue;
  550. +             }
  551. +             /*
  552. +              * Skip preprocessor directives and blank lines.
  553. +              */
  554. +             if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
  555. +                 continue;
  556. +             if (cin_is_cpp_namespace(l))
  557. +             {
  558. +                 amount += ind_cpp_namespace;
  559. +                 break;
  560. +             }
  561. +             if (cin_nocode(l))
  562. +                 continue;
  563. +             }
  564.               else if (lookfor != LOOKFOR_TERM
  565.                         && lookfor != LOOKFOR_CPP_BASECLASS)
  566.               {
  567. *** ../mercurial/vim73/src/testdir/test3.in    2011-05-25 13:33:59.000000000 +0200
  568. --- src/testdir/test3.in    2011-05-25 14:47:31.000000000 +0200
  569. ***************
  570. *** 799,804 ****
  571. --- 799,867 ----
  572.       df */
  573.           hello
  574.   }
  575. + /* valid namespaces with normal indent */
  576. + namespace
  577. + {
  578. + {
  579. +   111111111111;
  580. + }
  581. + }
  582. + namespace /* test */
  583. + {
  584. +   11111111111111111;
  585. + }
  586. + namespace // test
  587. + {
  588. +   111111111111111111;
  589. + }
  590. + namespace
  591. + {
  592. +   111111111111111111;
  593. + }
  594. + namespace test
  595. + {
  596. +   111111111111111111;
  597. + }
  598. + namespace{
  599. +   111111111111111111;
  600. + }
  601. + namespace test{
  602. +   111111111111111111;
  603. + }
  604. + namespace {
  605. +   111111111111111111;
  606. + }
  607. + namespace test {
  608. +   111111111111111111;
  609. + namespace test2 {
  610. +   22222222222222222;
  611. + }
  612. + }
  613. + /* invalid namespaces use block indent */
  614. + namespace test test2 {
  615. +   111111111111111111111;
  616. + }
  617. + namespace11111111111 {
  618. +   111111111111;
  619. + }
  620. + namespace() {
  621. +   1111111111111;
  622. + }
  623. + namespace()
  624. + {
  625. +   111111111111111111;
  626. + }
  627. + namespace test test2
  628. + {
  629. +   1111111111111111111;
  630. + }
  631. + namespace111111111
  632. + {
  633. +   111111111111111111;
  634. + }
  635.   /* end of AUTO */
  636.   
  637.   STARTTEST
  638. ***************
  639. *** 1428,1433 ****
  640. --- 1491,1566 ----
  641.   }
  642.   
  643.   STARTTEST
  644. + :set cino=N-s
  645. + /namespaces
  646. + =/^NAMESPACEEND
  647. + ENDTEST
  648. + /* valid namespaces with normal indent */
  649. + namespace
  650. + {
  651. +    {
  652. +     111111111111;
  653. + }
  654. + }
  655. + namespace /* test */
  656. + {
  657. +   11111111111111111;
  658. + }
  659. + namespace // test
  660. + {
  661. +   111111111111111111;
  662. + }
  663. + namespace
  664. + {
  665. +   111111111111111111;
  666. + }
  667. + namespace test
  668. + {
  669. +   111111111111111111;
  670. + }
  671. + namespace{
  672. +   111111111111111111;
  673. + }
  674. + namespace test{
  675. +   111111111111111111;
  676. + }
  677. + namespace {
  678. +   111111111111111111;
  679. + }
  680. + namespace test {
  681. +   111111111111111111;
  682. + namespace test2 {
  683. +   22222222222222222;
  684. + }
  685. + }
  686. + /* invalid namespaces use block indent */
  687. + namespace test test2 {
  688. +   111111111111111111111;
  689. + }
  690. + namespace11111111111 {
  691. +   111111111111;
  692. + }
  693. + namespace() {
  694. +   1111111111111;
  695. + }
  696. + namespace()
  697. + {
  698. +   111111111111111111;
  699. + }
  700. + namespace test test2
  701. + {
  702. +   1111111111111111111;
  703. + }
  704. + namespace111111111
  705. + {
  706. +   111111111111111111;
  707. + }
  708. + NAMESPACEEND
  709. + STARTTEST
  710.   :g/^STARTTEST/.,/^ENDTEST/d
  711.   :1;/start of AUTO/,$wq! test.out
  712.   ENDTEST
  713. *** ../mercurial/vim73/src/testdir/test3.ok    2011-05-25 13:33:59.000000000 +0200
  714. --- src/testdir/test3.ok    2011-05-25 14:48:02.000000000 +0200
  715. ***************
  716. *** 787,792 ****
  717. --- 787,855 ----
  718.          df */
  719.       hello
  720.   }
  721. + /* valid namespaces with normal indent */
  722. + namespace
  723. + {
  724. +     {
  725. +         111111111111;
  726. +     }
  727. + }
  728. + namespace /* test */
  729. + {
  730. +     11111111111111111;
  731. + }
  732. + namespace // test
  733. + {
  734. +     111111111111111111;
  735. + }
  736. + namespace
  737. + {
  738. +     111111111111111111;
  739. + }
  740. + namespace test
  741. + {
  742. +     111111111111111111;
  743. + }
  744. + namespace{
  745. +     111111111111111111;
  746. + }
  747. + namespace test{
  748. +     111111111111111111;
  749. + }
  750. + namespace {
  751. +     111111111111111111;
  752. + }
  753. + namespace test {
  754. +     111111111111111111;
  755. +     namespace test2 {
  756. +         22222222222222222;
  757. +     }
  758. + }
  759. + /* invalid namespaces use block indent */
  760. + namespace test test2 {
  761. +     111111111111111111111;
  762. + }
  763. + namespace11111111111 {
  764. +     111111111111;
  765. + }
  766. + namespace() {
  767. +     1111111111111;
  768. + }
  769. + namespace()
  770. + {
  771. +     111111111111111111;
  772. + }
  773. + namespace test test2
  774. + {
  775. +     1111111111111111111;
  776. + }
  777. + namespace111111111
  778. + {
  779. +     111111111111111111;
  780. + }
  781.   /* end of AUTO */
  782.   
  783.   
  784. ***************
  785. *** 1273,1275 ****
  786. --- 1336,1403 ----
  787.       baz();
  788.   }
  789.   
  790. + /* valid namespaces with normal indent */
  791. + namespace
  792. + {
  793. + {
  794. +     111111111111;
  795. + }
  796. + }
  797. + namespace /* test */
  798. + {
  799. + 11111111111111111;
  800. + }
  801. + namespace // test
  802. + {
  803. + 111111111111111111;
  804. + }
  805. + namespace
  806. + {
  807. + 111111111111111111;
  808. + }
  809. + namespace test
  810. + {
  811. + 111111111111111111;
  812. + }
  813. + namespace{
  814. + 111111111111111111;
  815. + }
  816. + namespace test{
  817. + 111111111111111111;
  818. + }
  819. + namespace {
  820. + 111111111111111111;
  821. + }
  822. + namespace test {
  823. + 111111111111111111;
  824. + namespace test2 {
  825. + 22222222222222222;
  826. + }
  827. + }
  828. + /* invalid namespaces use block indent */
  829. + namespace test test2 {
  830. +     111111111111111111111;
  831. + }
  832. + namespace11111111111 {
  833. +     111111111111;
  834. + }
  835. + namespace() {
  836. +     1111111111111;
  837. + }
  838. + namespace()
  839. + {
  840. +     111111111111111111;
  841. + }
  842. + namespace test test2
  843. + {
  844. +     1111111111111111111;
  845. + }
  846. + namespace111111111
  847. + {
  848. +     111111111111111111;
  849. + }
  850. + NAMESPACEEND
  851. *** ../vim-7.3.201/src/version.c    2011-05-25 13:33:59.000000000 +0200
  852. --- src/version.c    2011-05-25 15:14:20.000000000 +0200
  853. ***************
  854. *** 711,712 ****
  855. --- 711,714 ----
  856.   {   /* Add new patch number below this line */
  857. + /**/
  858. +     202,
  859.   /**/
  860.  
  861. -- 
  862. hundred-and-one symptoms of being an internet addict:
  863. 107. When using your phone you forget that you don't have to use your
  864.      keyboard.
  865.  
  866.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  867. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  868. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  869.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  870.