Skip to content

Commit

Permalink
git-gui: Only bind the spellcheck popup suggestion hook once
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce committed Feb 21, 2008
1 parent dd09628 commit 35d04b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spellcheck.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 35d04b3

Please sign in to comment.