summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 12b219f)
raw | patch | inline | side by side (parent: 12b219f)
author | Bert Wesarg <bert.wesarg@googlemail.com> | |
Fri, 14 Oct 2011 08:14:50 +0000 (10:14 +0200) | ||
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Tue, 18 Oct 2011 08:27:28 +0000 (09:27 +0100) |
Setting config gui.search.smartcase to true, the search mode in the
searchbar (from the blame view) is by default case-insensitive. But
entering an upper case letter into the search field activates the case-
sensitive search mode.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
searchbar (from the blame view) is by default case-insensitive. But
entering an upper case letter into the search field activates the case-
sensitive search mode.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/search.tcl | patch | blob | history |
diff --git a/lib/search.tcl b/lib/search.tcl
index ef3486f083c74f7f5e5fe9af861818ed0d64e89c..461c66d1a0e34853e244c4c0071e69bffe1ef931 100644 (file)
--- a/lib/search.tcl
+++ b/lib/search.tcl
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 {}} {