mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-14 09:37:34 -05:00
Drag-select now autoscrolls more sensibly.
Selected text now ends up in the clipboard. [originally from svn r98]
This commit is contained in:
22
terminal.c
22
terminal.c
@ -1376,18 +1376,18 @@ static void sel_spread (void) {
|
||||
void term_mouse (Mouse_Button b, Mouse_Action a, int x, int y) {
|
||||
unsigned long *selpoint;
|
||||
|
||||
if (y<0) y = 0;
|
||||
if (y>=rows) y = rows-1;
|
||||
if (x<0) {
|
||||
if (y > 0) {
|
||||
x = cols-1;
|
||||
y--;
|
||||
} else
|
||||
x = 0;
|
||||
}
|
||||
if (x>=cols) x = cols-1;
|
||||
if (x < 0) {
|
||||
x = cols - 1;
|
||||
y--;
|
||||
} else if (x >= cols)
|
||||
x = cols - 1;
|
||||
|
||||
selpoint = disptop + y * (cols+1) + x;
|
||||
selpoint = disptop + y * (cols + 1) + x;
|
||||
if (selpoint < sbtop)
|
||||
selpoint = sbtop;
|
||||
else if (selpoint > scrtop + rows * (cols + 1) - 1)
|
||||
/* XXX put this in a variable? */
|
||||
selpoint = scrtop + rows * (cols + 1) - 1;
|
||||
|
||||
if (b == MB_SELECT && a == MA_CLICK) {
|
||||
deselect();
|
||||
|
Reference in New Issue
Block a user