From: Pat Thoyts Date: Wed, 19 Oct 2011 12:29:52 +0000 (+0100) Subject: git-gui: enable the smart case sensitive search only if gui.search.smartcase is true X-Git-Tag: gitgui-0.15.0^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8eaf24b93bdb49d5adfb2f52f0f14dd01735db37;p=git.git git-gui: enable the smart case sensitive search only if gui.search.smartcase is true Signed-off-by: Pat Thoyts --- diff --git a/lib/search.tcl b/lib/search.tcl index db88d87c5..04a316bbb 100644 --- a/lib/search.tcl +++ b/lib/search.tcl @@ -11,6 +11,7 @@ field regexpsearch field default_regexpsearch field casesensitive field default_casesensitive +field smartcase field searchdirn -forwards field history @@ -25,7 +26,8 @@ constructor new {i_w i_text args} { set ctext $i_text set default_regexpsearch [is_config_true gui.search.regexp] - if {[is_config_true gui.search.smartcase]} { + set smartcase [is_config_true gui.search.smartcase] + if {$smartcase} { set default_casesensitive 0 } else { set default_casesensitive 1 @@ -155,8 +157,10 @@ method _incrsearch {} { if {[catch {$ctext index anchor}]} { $ctext mark set anchor [_get_new_anchor $this] } - if {[regexp {[[:upper:]]} $searchstring]} { - set casesensitive 1 + if {$smartcase} { + if {[regexp {[[:upper:]]} $searchstring]} { + set casesensitive 1 + } } if {$searchstring ne {}} { set here [_do_search $this anchor mlen]