Skip to content

Instantly share code, notes, and snippets.

@saitoha
Last active August 29, 2015 14:03
Show Gist options
  • Save saitoha/94de13acecd24004ac4c to your computer and use it in GitHub Desktop.
Save saitoha/94de13acecd24004ac4c to your computer and use it in GitHub Desktop.
vim: Use filter rectangle when ttymouse=dec (DEC locator events) is set
diff -r dd88acaa1a57 src/os_unix.c
--- a/src/os_unix.c Thu Jun 26 22:33:51 2014 +0200
+++ b/src/os_unix.c Wed Jul 02 00:56:24 2014 +0900
@@ -5128,7 +5128,7 @@
if (WantQueryMouse)
{
WantQueryMouse = FALSE;
- mch_write((char_u *)IF_EB("\033[1'|", ESC_STR "[1'|"), 5);
+ mch_write((char_u *)IF_EB("\033['w", ESC_STR "['w"), 4);
}
#endif
diff -r dd88acaa1a57 src/term.c
--- a/src/term.c Thu Jun 26 22:33:51 2014 +0200
+++ b/src/term.c Wed Jul 02 00:56:24 2014 +0900
@@ -4884,6 +4884,7 @@
case 0: return -1; /* position request while unavailable */
case 1: /* a response to a locator position request includes
the status of all buttons */
+ case 10: /* mouse outside of filter rectangle */
Pb &= 7; /* mask off and ignore fourth button */
if (Pb & 4)
mouse_code = MOUSE_LEFT;
@@ -4917,7 +4918,6 @@
break;
case 8: return -1; /* fourth button down */
case 9: return -1; /* fourth button up */
- case 10: return -1; /* mouse outside of filter rectangle */
default: return -1; /* should never occur */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment