Skip to content

Commit

Permalink
Clear the SHA1 entry field when we go to paste something into it
Browse files Browse the repository at this point in the history
If the user pastes in the selection (with the middle mouse button) and
it already has 40 characters in it, clear it before pasting.
  • Loading branch information
Paul Mackerras committed Jun 25, 2005
1 parent c8dfbcf commit ee3dc72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ proc makewindow {} {
bind . <Button-1> "click %W"
bind $fstring <Key-Return> dofind
bind $sha1entry <Key-Return> gotocommit
bind $sha1entry <<PasteSelection>> clearsha1

set maincursor [. cget -cursor]
set textcursor [$ctext cget -cursor]
Expand Down Expand Up @@ -1566,6 +1567,13 @@ proc incrfont {inc} {
redisplay
}

proc clearsha1 {} {
global sha1entry sha1string
if {[string length $sha1string] == 40} {
$sha1entry delete 0 end
}
}

proc sha1change {n1 n2 op} {
global sha1string currentid sha1but
if {$sha1string == {}
Expand Down

0 comments on commit ee3dc72

Please sign in to comment.