@@ -218,6 +218,7 @@ bTagBuildInProgress_(false)
218218 bool bSymbolSearchCaseSensitive;
219219 bool bSymbolSearchRegularExpression;
220220 bool bLiveSearch;
221+ bool bFuzzyAutoComplete;
221222
222223 bProjectAndGroupFilterCaseSensitive = confManager_->getAppSettingValue (" ProjectAndGroupFilterCaseSensitive" , false ).toBool ();
223224 if (bProjectAndGroupFilterCaseSensitive) {
@@ -306,6 +307,14 @@ bTagBuildInProgress_(false)
306307 actionLiveSearch->setChecked (false );
307308 }
308309
310+ // fuzzy auto complete
311+ bFuzzyAutoComplete = confManager_->getAppSettingValue (" FuzzyAutoComplete" , true ).toBool ();
312+ if (bFuzzyAutoComplete) {
313+ actionFuzzyAutoComplete->setChecked (true );
314+ } else {
315+ actionFuzzyAutoComplete->setChecked (false );
316+ }
317+
309318 createActions ();
310319}
311320
@@ -1189,10 +1198,17 @@ void CMainWindow::on_actionAlways_on_top_toggled()
11891198 on_actionTransparent_toggled (); // still transparency
11901199}
11911200
1192- void CMainWindow::on_actionLiveSearch_toggled ()
1201+ void CMainWindow::on_actionFuzzyAutoComplete_toggled ()
11931202{
1194- qDebug () << " on_actionLiveSearch_toggled IN" ;
1203+ if (actionFuzzyAutoComplete->isChecked ()) {
1204+ confManager_->setAppSettingValue (" FuzzyAutoComplete" , true );
1205+ } else {
1206+ confManager_->setAppSettingValue (" FuzzyAutoComplete" , false );
1207+ }
1208+ }
11951209
1210+ void CMainWindow::on_actionLiveSearch_toggled ()
1211+ {
11961212 if (actionLiveSearch->isChecked ()) {
11971213 confManager_->setAppSettingValue (" LiveSearch" , true );
11981214 } else {
@@ -1564,7 +1580,14 @@ void CMainWindow::searchLineEditChanged()
15641580
15651581 QStringList tagList;
15661582 QMap<int , QString> tagMap;
1567- tagger_.getMatchedTags (search_lineEdit->text (), tagMap, caseSensitivity);
1583+
1584+ bool bFuzzyAutoComplete = confManager_->getAppSettingValue (" FuzzyAutoComplete" , true ).toBool ();
1585+
1586+ if (bFuzzyAutoComplete) {
1587+ tagger_.getFuzzyMatchedTags (search_lineEdit->text (), tagMap, caseSensitivity);
1588+ } else {
1589+ tagger_.getMatchedTags (search_lineEdit->text (), tagMap, caseSensitivity);
1590+ }
15681591
15691592 for (auto tag: tagMap) {
15701593 tagList.push_back (tag);
@@ -1577,6 +1600,10 @@ void CMainWindow::searchLineEditChanged()
15771600 completer_.setCaseSensitivity (caseSensitivity);
15781601 completer_.setFilterMode (Qt::MatchContains);
15791602
1603+ if (bFuzzyAutoComplete) {
1604+ completer_.setCompletionMode (QCompleter::UnfilteredPopupCompletion);
1605+ }
1606+
15801607 search_lineEdit->setCompleter (&completer_);
15811608
15821609 bool bLiveSearch = confManager_->getAppSettingValue (" LiveSearch" , true ).toBool ();
0 commit comments