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 / 7.3.862 < prev    next >
Encoding:
Internet Message Format  |  2013-03-15  |  5.7 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.862
  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.862
  11. Problem:    Dragging the status line can be slow.
  12. Solution:   Look ahead and drop the drag event if there is a next one.
  13. Files:        src/eval.c, src/misc1.c, src/proto/misc1.pro, src/normal.c
  14.  
  15.  
  16. *** ../vim-7.3.861/src/eval.c    2013-02-26 21:43:28.000000000 +0100
  17. --- src/eval.c    2013-03-16 14:02:36.000000000 +0100
  18. ***************
  19. *** 11238,11264 ****
  20.       rettv->vval.v_string = vim_strsave(temp);
  21.   
  22.   #ifdef FEAT_MOUSE
  23. !     if (n == K_LEFTMOUSE
  24. !         || n == K_LEFTMOUSE_NM
  25. !         || n == K_LEFTDRAG
  26. !         || n == K_LEFTRELEASE
  27. !         || n == K_LEFTRELEASE_NM
  28. !         || n == K_MIDDLEMOUSE
  29. !         || n == K_MIDDLEDRAG
  30. !         || n == K_MIDDLERELEASE
  31. !         || n == K_RIGHTMOUSE
  32. !         || n == K_RIGHTDRAG
  33. !         || n == K_RIGHTRELEASE
  34. !         || n == K_X1MOUSE
  35. !         || n == K_X1DRAG
  36. !         || n == K_X1RELEASE
  37. !         || n == K_X2MOUSE
  38. !         || n == K_X2DRAG
  39. !         || n == K_X2RELEASE
  40. !         || n == K_MOUSELEFT
  41. !         || n == K_MOUSERIGHT
  42. !         || n == K_MOUSEDOWN
  43. !         || n == K_MOUSEUP)
  44.       {
  45.           int        row = mouse_row;
  46.           int        col = mouse_col;
  47. --- 11238,11244 ----
  48.       rettv->vval.v_string = vim_strsave(temp);
  49.   
  50.   #ifdef FEAT_MOUSE
  51. !     if (is_mouse_key(n))
  52.       {
  53.           int        row = mouse_row;
  54.           int        col = mouse_col;
  55. *** ../vim-7.3.861/src/misc1.c    2013-03-13 17:01:47.000000000 +0100
  56. --- src/misc1.c    2013-03-16 14:08:05.000000000 +0100
  57. ***************
  58. *** 3288,3293 ****
  59. --- 3288,3325 ----
  60.       return r;
  61.   }
  62.   
  63. + #if defined(FEAT_MOUSE) || defined(PROTO)
  64. + /*
  65. +  * Return TRUE if "c" is a mouse key.
  66. +  */
  67. +     int
  68. + is_mouse_key(c)
  69. +     int c;
  70. + {
  71. +     return c == K_LEFTMOUSE
  72. +     || c == K_LEFTMOUSE_NM
  73. +     || c == K_LEFTDRAG
  74. +     || c == K_LEFTRELEASE
  75. +     || c == K_LEFTRELEASE_NM
  76. +     || c == K_MIDDLEMOUSE
  77. +     || c == K_MIDDLEDRAG
  78. +     || c == K_MIDDLERELEASE
  79. +     || c == K_RIGHTMOUSE
  80. +     || c == K_RIGHTDRAG
  81. +     || c == K_RIGHTRELEASE
  82. +     || c == K_MOUSEDOWN
  83. +     || c == K_MOUSEUP
  84. +     || c == K_MOUSELEFT
  85. +     || c == K_MOUSERIGHT
  86. +     || c == K_X1MOUSE
  87. +     || c == K_X1DRAG
  88. +     || c == K_X1RELEASE
  89. +     || c == K_X2MOUSE
  90. +     || c == K_X2DRAG
  91. +     || c == K_X2RELEASE;
  92. + }
  93. + #endif
  94.   /*
  95.    * Get a key stroke directly from the user.
  96.    * Ignores mouse clicks and scrollbar events, except a click for the left
  97. ***************
  98. *** 3373,3403 ****
  99.           n = TO_SPECIAL(buf[1], buf[2]);
  100.           if (buf[1] == KS_MODIFIER
  101.               || n == K_IGNORE
  102. ! #ifdef FEAT_MOUSE
  103. !             || n == K_LEFTMOUSE_NM
  104. !             || n == K_LEFTDRAG
  105. !             || n == K_LEFTRELEASE
  106. !             || n == K_LEFTRELEASE_NM
  107. !             || n == K_MIDDLEMOUSE
  108. !             || n == K_MIDDLEDRAG
  109. !             || n == K_MIDDLERELEASE
  110. !             || n == K_RIGHTMOUSE
  111. !             || n == K_RIGHTDRAG
  112. !             || n == K_RIGHTRELEASE
  113. !             || n == K_MOUSEDOWN
  114. !             || n == K_MOUSEUP
  115. !             || n == K_MOUSELEFT
  116. !             || n == K_MOUSERIGHT
  117. !             || n == K_X1MOUSE
  118. !             || n == K_X1DRAG
  119. !             || n == K_X1RELEASE
  120. !             || n == K_X2MOUSE
  121. !             || n == K_X2DRAG
  122. !             || n == K_X2RELEASE
  123. ! # ifdef FEAT_GUI
  124.               || n == K_VER_SCROLLBAR
  125.               || n == K_HOR_SCROLLBAR
  126. - # endif
  127.   #endif
  128.              )
  129.           {
  130. --- 3405,3414 ----
  131.           n = TO_SPECIAL(buf[1], buf[2]);
  132.           if (buf[1] == KS_MODIFIER
  133.               || n == K_IGNORE
  134. !             || (is_mouse_key(n) && n != K_LEFTMOUSE)
  135. ! #ifdef FEAT_GUI
  136.               || n == K_VER_SCROLLBAR
  137.               || n == K_HOR_SCROLLBAR
  138.   #endif
  139.              )
  140.           {
  141. *** ../vim-7.3.861/src/proto/misc1.pro    2012-11-20 16:56:49.000000000 +0100
  142. --- src/proto/misc1.pro    2013-03-16 14:02:33.000000000 +0100
  143. ***************
  144. *** 42,47 ****
  145. --- 42,48 ----
  146.   void check_status __ARGS((buf_T *buf));
  147.   void change_warning __ARGS((int col));
  148.   int ask_yesno __ARGS((char_u *str, int direct));
  149. + int is_mouse_key __ARGS((int c));
  150.   int get_keystroke __ARGS((void));
  151.   int get_number __ARGS((int colon, int *mouse_used));
  152.   int prompt_for_number __ARGS((int *mouse_used));
  153. *** ../vim-7.3.861/src/normal.c    2013-03-13 19:02:37.000000000 +0100
  154. --- src/normal.c    2013-03-16 14:09:34.000000000 +0100
  155. ***************
  156. *** 2443,2449 ****
  157.           return FALSE;
  158.       }
  159.   
  160. !     which_button = get_mouse_button(KEY2TERMCAP1(c), &is_click, &is_drag);
  161.   
  162.   #ifdef FEAT_MOUSESHAPE
  163.       /* May have stopped dragging the status or separator line.  The pointer is
  164. --- 2443,2473 ----
  165.           return FALSE;
  166.       }
  167.   
  168. !     for (;;)
  169. !     {
  170. !     which_button = get_mouse_button(KEY2TERMCAP1(c), &is_click, &is_drag);
  171. !     if (is_drag)
  172. !     {
  173. !         /* If the next character is the same mouse event then use that
  174. !          * one. Speeds up dragging the status line. */
  175. !         if (vpeekc() != NUL)
  176. !         {
  177. !         int nc;
  178. !         int save_mouse_row = mouse_row;
  179. !         int save_mouse_col = mouse_col;
  180. !         /* Need to get the character, peeking doesn't get the actual
  181. !          * one. */
  182. !         nc = safe_vgetc();
  183. !         if (c == nc)
  184. !             continue;
  185. !         vungetc(nc);
  186. !         mouse_row = save_mouse_row;
  187. !         mouse_col = save_mouse_col;
  188. !         }
  189. !     }
  190. !     break;
  191. !     }
  192.   
  193.   #ifdef FEAT_MOUSESHAPE
  194.       /* May have stopped dragging the status or separator line.  The pointer is
  195. *** ../vim-7.3.861/src/version.c    2013-03-13 20:42:28.000000000 +0100
  196. --- src/version.c    2013-03-16 14:18:36.000000000 +0100
  197. ***************
  198. *** 730,731 ****
  199. --- 730,733 ----
  200.   {   /* Add new patch number below this line */
  201. + /**/
  202. +     862,
  203.   /**/
  204.  
  205. -- 
  206. hundred-and-one symptoms of being an internet addict:
  207. 53. To find out what time it is, you send yourself an e-mail and check the
  208.     "Date:" field.
  209.  
  210.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  211. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  212. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  213.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  214.