]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix interaction of insch() with selection highlights.
authorSimon Tatham <anakin@pobox.com>
Mon, 25 Nov 2013 19:46:05 +0000 (19:46 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 25 Nov 2013 19:46:05 +0000 (19:46 +0000)
commit7a53bd65d70fad73dbd6832497965fa11b2a357b
treeb1c89996db2bd6323f9067321ad48c334bf949b0
parent163b899df22d530e8fae7ee3344263a47f19ff43
Fix interaction of insch() with selection highlights.

Previously I had unthinkingly called the general-purpose
check_selection() routine to indicate that I was going to mess with n
character cells right of the cursor position, causing the selection
highlight to be removed if it intersected that region. This is all
wrong, since actually the whole region from cursor to EOL is modified
by any character insertion or deletion, so if we were going to call
check_selection it should be on that whole region. (Quick demo: select
part of the line to the right of the cursor, then emit ESC[P or ESC[@
and see the text move left or right while the highlight stays put.)

So we could just call check_selection() on that larger affected
region, and that would be correct. However, we can do something
slightly more elegant in the case where the selection is contained
entirely within the subregion that moves to one side (as opposed to
the characters that actually vanish at one or other end): we can move
the selection highlight with the text under it, to preserve the visual
reminder of which text was selected for as long as possible.

[originally from svn r10097]
terminal.c