summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-02-21 02:55:43 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-02-21 05:22:06 (GMT)
commit35d04b3b110f9adcd485c8470d8048394f586018 (patch)
treec7a7924d61848b2cecda23fa236404d4da86c600 /lib
parentdd0962883b239ab265079b666d9a9f5014d60e52 (diff)
downloadgit-35d04b3b110f9adcd485c8470d8048394f586018.zip
git-35d04b3b110f9adcd485c8470d8048394f586018.tar.gz
git-35d04b3b110f9adcd485c8470d8048394f586018.tar.bz2
git-gui: Only bind the spellcheck popup suggestion hook once
If we reconnect to the spellchecker there is no reason to resetup the binding for button 3 on our text widget to show the suggestion list (if available). Plus, by moving it out of _connect and into init we can now break out of _connect earlier if there is something wrong with the pipe, for example if the dictionary we were asked to load is not valid. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/spellcheck.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl
index f359356..a37ff5f 100644
--- a/lib/spellcheck.tcl
+++ b/lib/spellcheck.tcl
@@ -23,6 +23,7 @@ constructor init {pipe_fd ui_text ui_menu} {
set w_menu $ui_menu
array unset s_suggest
+ bind_button3 $w_text [cb _popup_suggest %X %Y @%x,%y]
_connect $this $pipe_fd
return $this
}
@@ -66,7 +67,6 @@ method _connect {pipe_fd} {
$w_text tag conf misspelled \
-foreground red \
-underline 1
- bind_button3 $w_text [cb _popup_suggest %X %Y @%x,%y]
array unset s_suggest
set s_seen [list]