field ctext
field searchstring {}
-field casesensitive 1
+field casesensitive
+field default_casesensitive
field searchdirn -forwards
field smarktop
set w $i_w
set ctext $i_text
+ if {[is_config_true gui.search.smartcase]} {
+ set default_casesensitive 0
+ } else {
+ set default_casesensitive 1
+ }
+
${NS}::frame $w
${NS}::label $w.l -text [mc Find:]
entry $w.ent -textvariable ${__this}::searchstring -background lightgreen
method show {} {
if {![visible $this]} {
grid $w
+ set casesensitive $default_casesensitive
}
focus -force $w.ent
}
if {[catch {$ctext index anchor}]} {
$ctext mark set anchor [_get_new_anchor $this]
}
+ if {[regexp {[[:upper:]]} $searchstring]} {
+ set casesensitive 1
+ }
if {$searchstring ne {}} {
set here [_do_search $this anchor mlen]
if {$here ne {}} {