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>
Shawn O. Pearce committed
Feb 20, 2008 at 21:55 UTC
35d04b3b110f9adcd485c8470d8048394f586018
1 file changed
+1
-1
lib/spellcheck.tcl
+1
-1
@@ -23,6 +23,7 @@ constructor init {pipe_fd ui_text ui_menu} {
23
set w_menu $ui_menu
24
array unset s_suggest
25
26
+ bind_button3 $w_text [cb _popup_suggest %X %Y @%x,%y]
27
_connect $this $pipe_fd
28
return $this
29
}
@@ -66,7 +67,6 @@ method _connect {pipe_fd} {
67
$w_text tag conf misspelled \
68
-foreground red \
69
-underline 1
69
- bind_button3 $w_text [cb _popup_suggest %X %Y @%x,%y]
70
71
array unset s_suggest
72
set s_seen [list]