summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f4d9348)
raw | patch | inline | side by side (parent: f4d9348)
author | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 21 Feb 2008 02:48:21 +0000 (21:48 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 21 Feb 2008 05:22:06 +0000 (00:22 -0500) |
If we somehow managed to get our spellchecker instance created but
aspell wasn't startable we may not finish _connect and thus may
find one or more of our fields was not initialized in the instance.
If we have an instance but no version, there is no reason to show
a version to the user in our about dialog. We effectively have no
spellchecker available.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
aspell wasn't startable we may not finish _connect and thus may
find one or more of our fields was not initialized in the instance.
If we have an instance but no version, there is no reason to show
a version to the user in our about dialog. We effectively have no
spellchecker available.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/about.tcl | patch | blob | history | |
lib/spellcheck.tcl | patch | blob | history |
diff --git a/lib/about.tcl b/lib/about.tcl
index 47be8eb97ab79188bba8dca18f3784327302ba9a..241ab892cd5b731f07571acf7a0ca3150a763f4f 100644 (file)
--- a/lib/about.tcl
+++ b/lib/about.tcl
append v "Tcl version $tcl_patchLevel"
append v ", Tk version $tk_patchLevel"
}
- if {[info exists ui_comm_spell]} {
+ if {[info exists ui_comm_spell]
+ && [$ui_comm_spell version] ne {}} {
append v "\n"
append v [$ui_comm_spell version]
}
diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl
index a67a5f748cb886cd1c554a83316cc0d300a38852..d0486f80728b1db09117ddaa828b745f7173d776 100644 (file)
--- a/lib/spellcheck.tcl
+++ b/lib/spellcheck.tcl
class spellcheck {
-field s_fd {} ; # pipe to aspell
-field s_version ; # aspell version string
-field s_lang ; # current language code
+field s_fd {} ; # pipe to aspell
+field s_version {} ; # aspell version string
+field s_lang {} ; # current language code
field w_text ; # text widget we are spelling
field w_menu ; # context menu for the widget
field s_menuidx 0 ; # last index of insertion into $w_menu
-field s_i ; # timer registration for _run callbacks
+field s_i {} ; # timer registration for _run callbacks
field s_clear 0 ; # did we erase mispelled tags yet?
field s_seen [list] ; # lines last seen from $w_text in _run
field s_checked [list] ; # lines already checked
constructor init {pipe_fd ui_text ui_menu} {
set w_text $ui_text
set w_menu $ui_menu
+ array unset s_suggest
_connect $this $pipe_fd
return $this
}
method version {} {
- return "$s_version, $s_lang"
+ if {$s_version ne {}} {
+ return "$s_version, $s_lang"
+ }
+ return {}
}
method stop {} {