Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Clear the SHA1 entry field when we go to paste something into it
author
Paul Mackerras
<paulus@samba.org>
Sat, 25 Jun 2005 06:37:13 +0000
(16:37 +1000)
committer
Paul Mackerras
<paulus@samba.org>
Sat, 25 Jun 2005 06:37:13 +0000
(16:37 +1000)
If the user pastes in the selection (with the middle mouse button) and
it already has 40 characters in it, clear it before pasting.
gitk
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c8dfbcf
)
diff --git
a/gitk
b/gitk
index 779d71cf5bc871ffd349715b116321395bd0f0c9..9ad7bfc7e164b7d6194ddf0a8ed08b9ea708b98f 100755
(executable)
--- 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 . <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]
set maincursor [. cget -cursor]
set textcursor [$ctext cget -cursor]
@@
-1566,6
+1567,13
@@
proc incrfont {inc} {
redisplay
}
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 == {}
proc sha1change {n1 n2 op} {
global sha1string currentid sha1but
if {$sha1string == {}