Fix pane selection to begin at hand-click-loc not hand-loc

db4
Slava Pestov 2008-12-18 01:11:00 -06:00
parent aa67844a23
commit 2d5bc00029
1 changed files with 6 additions and 6 deletions

View File

@ -358,25 +358,25 @@ M: f sloppy-pick-up*
[ 3drop { } ] [ 3drop { } ]
if ; if ;
: move-caret ( pane -- pane ) : move-caret ( pane loc -- pane )
dup hand-rel over sloppy-pick-up >>caret over screen-loc v- over sloppy-pick-up >>caret
dup relayout-1 ; dup relayout-1 ;
: begin-selection ( pane -- ) : begin-selection ( pane -- )
f >>selecting? f >>selecting?
move-caret hand-loc get move-caret
f >>mark f >>mark
drop ; drop ;
: extend-selection ( pane -- ) : extend-selection ( pane -- )
hand-moved? [ hand-moved? [
dup selecting?>> [ dup selecting?>> [
move-caret hand-loc get move-caret
] [ ] [
dup hand-clicked get child? [ dup hand-clicked get child? [
t >>selecting? t >>selecting?
dup hand-clicked set-global dup hand-clicked set-global
move-caret hand-click-loc get move-caret
caret>mark caret>mark
] when ] when
] if ] if
@ -394,7 +394,7 @@ M: f sloppy-pick-up*
: select-to-caret ( pane -- ) : select-to-caret ( pane -- )
t >>selecting? t >>selecting?
dup mark>> [ caret>mark ] unless dup mark>> [ caret>mark ] unless
move-caret hand-loc get move-caret
dup request-focus dup request-focus
com-copy-selection ; com-copy-selection ;