XFree86 3.1.2Ei - xterm patch #26 - T.Dickey Here's a patch to fix a problem with xterm's cut/paste and another to modify the appearance of the highlighting while selecting. (The changes are independent, so you can see if the change to screen.c is desirable). -------------------------------------------------------------------------------- screen.c | 11 +++++++++++ util.c | 11 ++++++++++- 2 files changed, 21 insertions, 1 deletion -------------------------------------------------------------------------------- Index: screen.c --- xterm-25+/screen.c Sun Aug 11 22:46:01 1996 +++ xterm-26/screen.c Tue Aug 20 11:24:01 1996 @@ -500,6 +500,17 @@ maxcol - screen->endHCol + 1, force); maxcol = screen->endHCol - 1; } + + /* + * If we're highlighting because the user is doing cut/paste, + * trim the trailing blanks from the highlighted region so we're + * showing the actual extent of the text that'll be cut. + */ + if (maxcol >= screen->max_col + && screen->send_mouse_pos != 3) + while (maxcol > 0 && !(attrs[maxcol] & CHARDRAWN)) + maxcol--; + /* remaining piece should be hilited */ hilite = True; } Index: util.c --- xterm-25+/util.c Sun Aug 11 22:46:01 1996 +++ xterm-26/util.c Tue Aug 20 11:25:08 1996 @@ -625,7 +625,16 @@ int len; { int rc = 1; - int flags = CHARDRAWN | TERM_COLOR_FLAGS; + int flags = TERM_COLOR_FLAGS; + + /* + * If we're not clearing to the end of the line, we won't count this as + * "drawn" characters. We'll only do cut/paste on "drawn" characters, + * so this has the effect of suppressing trailing blanks from a + * selection. + */ + if (col + len + 1 < screen->max_col) + flags |= CHARDRAWN; /* If we've marked protected text on the screen, we'll have to * check each time we do an erase.