comparison src/term.c @ 16485:b870146e09e1 v8.1.1246

patch 8.1.1246: cannot handle negative mouse coordinate from urxvt commit https://github.com/vim/vim/commit/bb7e1b4ba82eaa6f8c7a59f1314056e3c404437a Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 2 20:24:12 2019 +0200 patch 8.1.1246: cannot handle negative mouse coordinate from urxvt Problem: Cannot handle negative mouse coordinate from urxvt. Solution: Accept '-' where a digit is expected. (Vincent Vinel, closes #4326)
author Bram Moolenaar <Bram@vim.org>
date Thu, 02 May 2019 20:30:07 +0200
parents 7ae2396cef62
children 899db156cce3
comparison
equal deleted inserted replaced
16484:3a07495a0806 16485:b870146e09e1
4549 slen = modslen + 1; /* no modifiers */ 4549 slen = modslen + 1; /* no modifiers */
4550 else if (tp[modslen] != ';' && modslen == slen - 3) 4550 else if (tp[modslen] != ';' && modslen == slen - 3)
4551 continue; /* no match */ 4551 continue; /* no match */
4552 else 4552 else
4553 { 4553 {
4554 /* Skip over the digits, the final char must 4554 // Skip over the digits, the final char must
4555 * follow. */ 4555 // follow. URXVT can use a negative value, thus
4556 // also accept '-'.
4556 for (j = slen - 2; j < len && (isdigit(tp[j]) 4557 for (j = slen - 2; j < len && (isdigit(tp[j])
4557 || tp[j] == ';'); ++j) 4558 || tp[j] == '-' || tp[j] == ';'); ++j)
4558 ; 4559 ;
4559 ++j; 4560 ++j;
4560 if (len < j) /* got a partial sequence */ 4561 if (len < j) /* got a partial sequence */
4561 return -1; /* need to get more chars */ 4562 return -1; /* need to get more chars */
4562 if (tp[j - 1] != termcodes[idx].code[slen - 1]) 4563 if (tp[j - 1] != termcodes[idx].code[slen - 1])