summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-06-25 06:37:13 (GMT)
committerPaul Mackerras <paulus@samba.org>2005-06-25 06:37:13 (GMT)
commitee3dc72e30a7e9b4eed301bd4fd21b306f811e36 (patch)
treeb7c35b85d14c0fb40bbc3e7e9ea0e7c6937ae514 /gitk
parentc8dfbcf995f3a6a13d3c6db1411f7f5fa42d2dcb (diff)
downloadgit-ee3dc72e30a7e9b4eed301bd4fd21b306f811e36.zip
git-ee3dc72e30a7e9b4eed301bd4fd21b306f811e36.tar.gz
git-ee3dc72e30a7e9b4eed301bd4fd21b306f811e36.tar.bz2
Clear the SHA1 entry field when we go to paste something into it
If the user pastes in the selection (with the middle mouse button) and it already has 40 characters in it, clear it before pasting.
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk8
1 files changed, 8 insertions, 0 deletions
diff --git a/gitk b/gitk
index 779d71c..9ad7bfc 100755
--- a/gitk
+++ b/gitk
@@ -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]
@@ -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 == {}