Vim: handle mouse clicks past column ~223
Vim: handle mouse clicks past column ~223

I hadn't noticed this until recently, when I started spending more time
with Vim in "full-window" mode on a large external display (rather than
on one half of a tmux split), but mouse clicks seemed "dead" whenever
they were on the rightmost quarter of the display.

This didn't correspond to a particular buffer, but rather a region on
the screen (ie. clicks to the left of that particular line would work,
but on the right would fail, even inside the same buffer).

It turns out that the mouse wasn't "dead"; rather the coordinates were
wrapping around (back to the left) due to a limitation in the xterm
mouse reporting protocol. This was fixed with the introduction of the
SGR 1006 protocol, added to xterm in patch 277 (2012-01-07):

  http://invisible-island.net/xterm/xterm.log.html#xterm_277

Vim started supporting this around 7.3.632, apparently, and this commit
(joyously) makes use of the new setting. Works in iTerm 2; haven't
tested it in the Terminal.app.

Resources:

  https://code.google.com/p/iterm2/issues/detail?id=1830
  http://stackoverflow.com/questions/7000960/vim-mouse-problem
  http://superuser.com/questions/413351/weird-insertion-from-vim-on-mouse-click

Signed-off-by: Wincent Colaiuta <c76ac2e9cd86441713c7dfae92c451f3e6d17fdc@wincent.com>

wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent