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.353 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  4.1 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.353
  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.353 (after 7.3.343)
  11. Problem:    Missing part of the urxvt patch.
  12. Solution:   Add the change in term.c
  13. Files:        src/term.c
  14.  
  15.  
  16. *** ../vim-7.3.352/src/term.c    2011-09-14 14:43:21.000000000 +0200
  17. --- src/term.c    2011-10-26 23:48:01.000000000 +0200
  18. ***************
  19. *** 4008,4014 ****
  20.       }
  21.   
  22.   #ifdef FEAT_TERMRESPONSE
  23. !     if (key_name[0] == NUL)
  24.       {
  25.           /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c".  Also
  26.            * eat other possible responses to t_RV, rxvt returns
  27. --- 4008,4016 ----
  28.       }
  29.   
  30.   #ifdef FEAT_TERMRESPONSE
  31. !     if (key_name[0] == NUL
  32. !         /* URXVT mouse uses <ESC>[#;#;#M, but we are matching <ESC>[ */
  33. !         || key_name[0] == KS_URXVT_MOUSE)
  34.       {
  35.           /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c".  Also
  36.            * eat other possible responses to t_RV, rxvt returns
  37. ***************
  38. *** 4047,4053 ****
  39.               if (tp[1 + (tp[0] != CSI)] == '>' && j == 2)
  40.               {
  41.               /* if xterm version >= 95 use mouse dragging */
  42. !             if (extra >= 95)
  43.                   set_option_value((char_u *)"ttym", 0L,
  44.                                  (char_u *)"xterm2", 0);
  45.               /* if xterm version >= 141 try to get termcap codes */
  46. --- 4049,4055 ----
  47.               if (tp[1 + (tp[0] != CSI)] == '>' && j == 2)
  48.               {
  49.               /* if xterm version >= 95 use mouse dragging */
  50. !             if (extra >= 95 && ttym_flags != TTYM_URXVT)
  51.                   set_option_value((char_u *)"ttym", 0L,
  52.                                  (char_u *)"xterm2", 0);
  53.               /* if xterm version >= 141 try to get termcap codes */
  54. ***************
  55. *** 4141,4146 ****
  56. --- 4143,4151 ----
  57.   # ifdef FEAT_MOUSE_PTERM
  58.           || key_name[0] == (int)KS_PTERM_MOUSE
  59.   # endif
  60. + # ifdef FEAT_MOUSE_URXVT
  61. +         || key_name[0] == (int)KS_URXVT_MOUSE
  62. + # endif
  63.           )
  64.       {
  65.           is_click = is_drag = FALSE;
  66. ***************
  67. *** 4219,4225 ****
  68. --- 4224,4292 ----
  69.               else
  70.               break;
  71.           }
  72. +         }
  73. + # ifdef FEAT_MOUSE_URXVT
  74. +         if (key_name[0] == (int)KS_URXVT_MOUSE)
  75. +         {
  76. +         for (;;)
  77. +         {
  78. +             /* URXVT 1015 mouse reporting mode:
  79. +              * Almost identical to xterm mouse mode, except the values
  80. +              * are decimal instead of bytes.
  81. +              *
  82. +              * \033[%d;%d;%dM
  83. +              *          ^-- row
  84. +              *           ^----- column
  85. +              *        ^-------- code
  86. +              */
  87. +             p = tp + slen;
  88. +             mouse_code = getdigits(&p);
  89. +             if (*p++ != ';')
  90. +             return -1;
  91. +             mouse_col = getdigits(&p) - 1;
  92. +             if (*p++ != ';')
  93. +             return -1;
  94. +             mouse_row = getdigits(&p) - 1;
  95. +             if (*p++ != 'M')
  96. +             return -1;
  97. +             slen += (int)(p - (tp + slen));
  98. +             /* skip this one if next one has same code (like xterm
  99. +              * case) */
  100. +             j = termcodes[idx].len;
  101. +             if (STRNCMP(tp, tp + slen, (size_t)j) == 0) {
  102. +             /* check if the command is complete by looking for the
  103. +              * M */
  104. +             int slen2;
  105. +             int cmd_complete = 0;
  106. +             for (slen2 = slen; slen2 < len; slen2++) {
  107. +                 if (tp[slen2] == 'M') {
  108. +                 cmd_complete = 1;
  109. +                 break;
  110. +                 }
  111. +             }
  112. +             p += j;
  113. +             if (cmd_complete && getdigits(&p) == mouse_code) {
  114. +                 slen += j; /* skip the \033[ */
  115. +                 continue;
  116. +             }
  117. +             }
  118. +             break;
  119. +         }
  120. +         }
  121. + # endif
  122.   
  123. +     if (key_name[0] == (int)KS_MOUSE
  124. + #ifdef FEAT_MOUSE_URXVT
  125. +         || key_name[0] == (int)KS_URXVT_MOUSE
  126. + #endif
  127. +         )
  128. +     {
  129.   #  if !defined(MSWIN) && !defined(MSDOS)
  130.           /*
  131.            * Handle mouse events.
  132. *** ../vim-7.3.352/src/version.c    2011-10-26 22:02:10.000000000 +0200
  133. --- src/version.c    2011-10-26 23:43:26.000000000 +0200
  134. ***************
  135. *** 716,717 ****
  136. --- 716,719 ----
  137.   {   /* Add new patch number below this line */
  138. + /**/
  139. +     353,
  140.   /**/
  141.  
  142. -- 
  143. hundred-and-one symptoms of being an internet addict:
  144. 99. The hum of a cooling fan and the click of keys is comforting to you.
  145.  
  146.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  147. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  148. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  149.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  150.