Commit 23ab92ac authored by Alain Laporte's avatar Alain Laporte Committed by Christoph Cullmann
Browse files

Use fuzzy matching

parent 537ffc16
kate_add_plugin(katesymbolviewerplugin)
target_compile_definitions(katesymbolviewerplugin PRIVATE TRANSLATION_DOMAIN="katesymbolviewer")
target_link_libraries(katesymbolviewerplugin PRIVATE KF5::I18n KF5::TextEditor)
target_link_libraries(
katesymbolviewerplugin
PRIVATE
kateprivate
KF5::I18n KF5::TextEditor
)
target_sources(
katesymbolviewerplugin
......
......@@ -53,6 +53,8 @@
#include <ktexteditor/configinterface.h>
#include <ktexteditor/cursor.h>
#include <kfts_fuzzy_match.h>
#include <QGroupBox>
#include <QVBoxLayout>
......@@ -406,7 +408,7 @@ bool KatePluginSymbolViewerView::filterSymbols(QTreeWidgetItem * item, const QSt
at_least_one_child_shown = true;
}
}
bool is_item_match = item->text(0).contains(filter, Qt::CaseInsensitive);
bool is_item_match = kfts::fuzzy_match_simple(filter, item->text(0));
bool is_item_shown = at_least_one_child_shown || filter.isEmpty() || is_item_match;
item->setHidden(!is_item_shown);
return is_item_shown;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment