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.1 / 7.1.264 < prev    next >
Encoding:
Internet Message Format  |  2008-02-24  |  6.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.1.264
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.1.264
  11. Problem:    Crash when indenting lines. (Dominique Pelle)
  12. Solution:   Set the cursor column when changing the cursor line.
  13. Files:        src/ops.c, src/misc1.c
  14.  
  15.  
  16. *** ../vim-7.1.263/src/ops.c    Wed Feb  6 14:43:50 2008
  17. --- src/ops.c    Sun Feb 24 14:56:38 2008
  18. ***************
  19. *** 692,697 ****
  20. --- 692,698 ----
  21.           }
  22.       }
  23.       ++curwin->w_cursor.lnum;
  24. +     curwin->w_cursor.col = 0;  /* make sure it's valid */
  25.       }
  26.   
  27.       /* put cursor on first non-blank of indented line */
  28. *** ../vim-7.1.263/src/misc1.c    Wed Feb 13 10:57:11 2008
  29. --- src/misc1.c    Sun Feb 24 15:04:27 2008
  30. ***************
  31. *** 6894,6899 ****
  32. --- 6894,6900 ----
  33.               if (trypos != NULL)
  34.               {
  35.                   curwin->w_cursor.lnum = trypos->lnum + 1;
  36. +                 curwin->w_cursor.col = 0;
  37.                   continue;
  38.               }
  39.   
  40. ***************
  41. *** 6954,6959 ****
  42. --- 6955,6961 ----
  43.                   if (trypos != NULL)
  44.                   {
  45.                   curwin->w_cursor.lnum = trypos->lnum + 1;
  46. +                 curwin->w_cursor.col = 0;
  47.                   continue;
  48.                   }
  49.               }
  50. ***************
  51. *** 6991,6996 ****
  52. --- 6993,6999 ----
  53.           if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
  54.           {
  55.               curwin->w_cursor.lnum = trypos->lnum + 1;
  56. +             curwin->w_cursor.col = 0;
  57.               continue;
  58.           }
  59.   
  60. ***************
  61. *** 7114,7120 ****
  62. --- 7117,7126 ----
  63.           {
  64.               if (find_last_paren(l, '{', '}') && (trypos =
  65.                       find_start_brace(ind_maxcomment)) != NULL)
  66. +             {
  67.               curwin->w_cursor.lnum = trypos->lnum + 1;
  68. +             curwin->w_cursor.col = 0;
  69. +             }
  70.               continue;
  71.           }
  72.   
  73. ***************
  74. *** 7230,7240 ****
  75.                *     case xx:  if ( asdf &&
  76.                *            asdf)
  77.                */
  78. !             curwin->w_cursor.lnum = trypos->lnum;
  79.               l = ml_get_curline();
  80.               if (cin_iscase(l) || cin_isscopedecl(l))
  81.               {
  82.                   ++curwin->w_cursor.lnum;
  83.                   continue;
  84.               }
  85.               }
  86. --- 7236,7247 ----
  87.                *     case xx:  if ( asdf &&
  88.                *            asdf)
  89.                */
  90. !             curwin->w_cursor = *trypos;
  91.               l = ml_get_curline();
  92.               if (cin_iscase(l) || cin_isscopedecl(l))
  93.               {
  94.                   ++curwin->w_cursor.lnum;
  95. +                 curwin->w_cursor.col = 0;
  96.                   continue;
  97.               }
  98.               }
  99. ***************
  100. *** 7254,7259 ****
  101. --- 7261,7267 ----
  102.                   if (*l == NUL || l[STRLEN(l) - 1] != '\\')
  103.                   break;
  104.                   --curwin->w_cursor.lnum;
  105. +                 curwin->w_cursor.col = 0;
  106.               }
  107.               }
  108.   
  109. ***************
  110. *** 7587,7597 ****
  111.                    *       case xx:  if ( asdf &&
  112.                    *                asdf)
  113.                    */
  114. !                 curwin->w_cursor.lnum = trypos->lnum;
  115.                   l = ml_get_curline();
  116.                   if (cin_iscase(l) || cin_isscopedecl(l))
  117.                   {
  118.                   ++curwin->w_cursor.lnum;
  119.                   continue;
  120.                   }
  121.               }
  122. --- 7595,7606 ----
  123.                    *       case xx:  if ( asdf &&
  124.                    *                asdf)
  125.                    */
  126. !                 curwin->w_cursor = *trypos;
  127.                   l = ml_get_curline();
  128.                   if (cin_iscase(l) || cin_isscopedecl(l))
  129.                   {
  130.                   ++curwin->w_cursor.lnum;
  131. +                 curwin->w_cursor.col = 0;
  132.                   continue;
  133.                   }
  134.               }
  135. ***************
  136. *** 7652,7664 ****
  137.                   && (trypos = find_start_brace(ind_maxcomment))
  138.                                   != NULL) /* XXX */
  139.               {
  140. !                 curwin->w_cursor.lnum = trypos->lnum;
  141.                   /* if not "else {" check for terminated again */
  142.                   /* but skip block for "} else {" */
  143.                   l = cin_skipcomment(ml_get_curline());
  144.                   if (*l == '}' || !cin_iselse(l))
  145.                   goto term_again;
  146.                   ++curwin->w_cursor.lnum;
  147.               }
  148.               }
  149.           }
  150. --- 7661,7674 ----
  151.                   && (trypos = find_start_brace(ind_maxcomment))
  152.                                   != NULL) /* XXX */
  153.               {
  154. !                 curwin->w_cursor = *trypos;
  155.                   /* if not "else {" check for terminated again */
  156.                   /* but skip block for "} else {" */
  157.                   l = cin_skipcomment(ml_get_curline());
  158.                   if (*l == '}' || !cin_iselse(l))
  159.                   goto term_again;
  160.                   ++curwin->w_cursor.lnum;
  161. +                 curwin->w_cursor.col = 0;
  162.               }
  163.               }
  164.           }
  165. ***************
  166. *** 7727,7732 ****
  167. --- 7737,7743 ----
  168.           if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
  169.           {
  170.               curwin->w_cursor.lnum = trypos->lnum + 1;
  171. +             curwin->w_cursor.col = 0;
  172.               continue;
  173.           }
  174.   
  175. ***************
  176. *** 7777,7783 ****
  177.               if (find_last_paren(l, '(', ')')
  178.                   && (trypos = find_match_paren(ind_maxparen,
  179.                                ind_maxcomment)) != NULL)
  180. !             curwin->w_cursor.lnum = trypos->lnum;
  181.   
  182.               /* For a line ending in ',' that is a continuation line go
  183.                * back to the first line with a backslash:
  184. --- 7788,7794 ----
  185.               if (find_last_paren(l, '(', ')')
  186.                   && (trypos = find_match_paren(ind_maxparen,
  187.                                ind_maxcomment)) != NULL)
  188. !             curwin->w_cursor = *trypos;
  189.   
  190.               /* For a line ending in ',' that is a continuation line go
  191.                * back to the first line with a backslash:
  192. ***************
  193. *** 7791,7796 ****
  194. --- 7802,7808 ----
  195.               if (*l == NUL || l[STRLEN(l) - 1] != '\\')
  196.                   break;
  197.               --curwin->w_cursor.lnum;
  198. +             curwin->w_cursor.col = 0;
  199.               }
  200.   
  201.               amount = get_indent();        /* XXX */
  202. ***************
  203. *** 7864,7870 ****
  204.   
  205.           if ((trypos = find_match_paren(ind_maxparen,
  206.                                ind_maxcomment)) != NULL)
  207. !             curwin->w_cursor.lnum = trypos->lnum;
  208.           amount = get_indent();        /* XXX */
  209.           break;
  210.           }
  211. --- 7876,7882 ----
  212.   
  213.           if ((trypos = find_match_paren(ind_maxparen,
  214.                                ind_maxcomment)) != NULL)
  215. !             curwin->w_cursor = *trypos;
  216.           amount = get_indent();        /* XXX */
  217.           break;
  218.           }
  219. *** ../vim-7.1.263/src/version.c    Mon Feb 25 20:45:46 2008
  220. --- src/version.c    Mon Feb 25 21:51:20 2008
  221. ***************
  222. *** 668,669 ****
  223. --- 668,671 ----
  224.   {   /* Add new patch number below this line */
  225. + /**/
  226. +     264,
  227.   /**/
  228.  
  229. -- 
  230. hundred-and-one symptoms of being an internet addict:
  231. 49. You never have to deal with busy signals when calling your ISP...because
  232.     you never log off.
  233.  
  234.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  235. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  236. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  237.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  238.