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.4 / 7.4.350 < prev    next >
Encoding:
Internet Message Format  |  2014-07-01  |  3.8 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.350
  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.4.350
  11. Problem:    Using C indenting for Javascript does not work well for a {} block
  12.         inside parenthesis.
  13. Solution:   When looking for a matching paren ignore one that is before the
  14.         start of a {} block.
  15. Files:        src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
  16.  
  17.  
  18. *** ../vim-7.4.349/src/misc1.c    2014-07-02 17:02:29.722212319 +0200
  19. --- src/misc1.c    2014-07-02 18:09:39.670274070 +0200
  20. ***************
  21. *** 6614,6620 ****
  22.   }
  23.   
  24.   /*
  25. !  * Find the matching '(', failing if it is in a comment.
  26.    * Return NULL if no match found.
  27.    */
  28.       static pos_T *
  29. --- 6614,6620 ----
  30.   }
  31.   
  32.   /*
  33. !  * Find the matching '(', ignoring it if it is in a comment.
  34.    * Return NULL if no match found.
  35.    */
  36.       static pos_T *
  37. ***************
  38. *** 6645,6650 ****
  39. --- 6645,6676 ----
  40.   }
  41.   
  42.   /*
  43. +  * Find the matching '(', ignoring it if it is in a comment or before an
  44. +  * unmatched {.
  45. +  * Return NULL if no match found.
  46. +  */
  47. +     static pos_T *
  48. + find_match_paren_after_brace(ind_maxparen)        /* XXX */
  49. +     int        ind_maxparen;
  50. + {
  51. +     pos_T    *trypos = find_match_paren(ind_maxparen);
  52. +     if (trypos != NULL)
  53. +     {
  54. +     pos_T    *tryposBrace = find_start_brace();
  55. +     /* If both an unmatched '(' and '{' is found.  Ignore the '('
  56. +      * position if the '{' is further down. */
  57. +     if (tryposBrace != NULL
  58. +         && (trypos->lnum != tryposBrace->lnum
  59. +             ? trypos->lnum < tryposBrace->lnum
  60. +             : trypos->col < tryposBrace->col))
  61. +         trypos = NULL;
  62. +     }
  63. +     return trypos;
  64. + }
  65. + /*
  66.    * Return ind_maxparen corrected for the difference in line number between the
  67.    * cursor position and "startpos".  This makes sure that searching for a
  68.    * matching paren above the cursor line doesn't find a match because of
  69. ***************
  70. *** 7419,7425 ****
  71.           {
  72.               curwin->w_cursor.lnum = our_paren_pos.lnum;
  73.               curwin->w_cursor.col = col;
  74. !             if (find_match_paren(curbuf->b_ind_maxparen) != NULL)
  75.               amount += curbuf->b_ind_unclosed2;
  76.               else
  77.               {
  78. --- 7445,7452 ----
  79.           {
  80.               curwin->w_cursor.lnum = our_paren_pos.lnum;
  81.               curwin->w_cursor.col = col;
  82. !             if (find_match_paren_after_brace(curbuf->b_ind_maxparen)
  83. !                                       != NULL)
  84.               amount += curbuf->b_ind_unclosed2;
  85.               else
  86.               {
  87. *** ../vim-7.4.349/src/testdir/test3.in    2013-03-07 12:39:35.000000000 +0100
  88. --- src/testdir/test3.in    2014-07-02 18:08:06.430272641 +0200
  89. ***************
  90. *** 1950,1955 ****
  91. --- 1950,1959 ----
  92.   JSSTART
  93.   (function($){
  94.   
  95. + if (cond &&
  96. + cond) {
  97. + stmt;
  98. + }
  99.   var class_name='myclass';
  100.   
  101.   function private_method() {
  102. *** ../vim-7.4.349/src/testdir/test3.ok    2013-03-07 12:40:03.000000000 +0100
  103. --- src/testdir/test3.ok    2014-07-02 18:09:14.470273684 +0200
  104. ***************
  105. *** 1728,1733 ****
  106. --- 1728,1737 ----
  107.   JSSTART
  108.   (function($){
  109.   
  110. +     if (cond &&
  111. +             cond) {
  112. +         stmt;
  113. +     }
  114.       var class_name='myclass';
  115.   
  116.       function private_method() {
  117. *** ../vim-7.4.349/src/version.c    2014-07-02 17:16:51.334225522 +0200
  118. --- src/version.c    2014-07-02 18:06:31.330271184 +0200
  119. ***************
  120. *** 736,737 ****
  121. --- 736,739 ----
  122.   {   /* Add new patch number below this line */
  123. + /**/
  124. +     350,
  125.   /**/
  126.  
  127. -- 
  128. FATHER:    You killed eight wedding guests in all!
  129. LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady.
  130. FATHER:    I can understand that.
  131.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  132.  
  133.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  134. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  135. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  136.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  137.