From f03dfcc7591e856870e39f860aa566215f1380e3 Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Tue, 7 Feb 2023 23:42:33 +0530 Subject: [PATCH] Minor doc updates --- docs/en/src/general-config.md | 2 +- docs/en/src/searching.md | 13 ++++++++----- src/init.lua | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/en/src/general-config.md b/docs/en/src/general-config.md index 89b0965..ecd73ec 100644 --- a/docs/en/src/general-config.md +++ b/docs/en/src/general-config.md @@ -197,7 +197,7 @@ Type: [Style](https://xplr.dev/en/style) The default search algorithm -Type: [Search Algorithm](https://xplr.dev/en/searching#search-algorithm) +Type: [Search Algorithm](https://xplr.dev/en/searching#algorithm) #### xplr.config.general.search.unordered diff --git a/docs/en/src/searching.md b/docs/en/src/searching.md index 44e1632..887f477 100644 --- a/docs/en/src/searching.md +++ b/docs/en/src/searching.md @@ -6,12 +6,12 @@ generally appears between filters and sorters in the `Sort & filter` panel. Example: ``` -/fzy↓abc +fzy:foo↓ ``` This line means that the nodes visible on the table are being filtered using the -[fuzzy matching][1] algorithm. The arrow means that ranking based ordering is -being applied, i.e. [sorters][2] are being ignored. +[fuzzy matching][1] algorithm on the input `foo`. The arrow means that ranking based +ordering is being applied, i.e. [sorters][2] are being ignored. ## Node Searcher Applicable @@ -36,7 +36,7 @@ Type: nullable string ### algorithm -Search algorithm to use. Defaults to `Fuzzy`. +Search algorithm to use. Defaults to [xplr.config.general.search.algorithm][8] It can be one of the following: @@ -46,7 +46,7 @@ It can be one of the following: ### unordered Whether to skip ordering the search result by algorithm based ranking. Defaults -to `false`. +to [xplr.config.general.search.unordered][9] Type: boolean @@ -57,6 +57,7 @@ local searcher = { pattern = "pattern to search", recoverable_focus = "/path/to/focus/on/cancel", algorithm = "Fuzzy", + unordered = false, } xplr.util.explore({ searcher = searcher }) @@ -71,3 +72,5 @@ See [xplr.util.explore][6] [5]: #algorithm [6]: xplr.util.md#explore [7]: #unordered +[8]: general-config.md#xplrconfiggeneralsearchalgorithm +[9]: general-config.md#xplrconfiggeneralsearchunordered diff --git a/src/init.lua b/src/init.lua index 1d425cf..7d2f0fb 100644 --- a/src/init.lua +++ b/src/init.lua @@ -258,7 +258,7 @@ xplr.config.general.selection.item.style = {} -- The default search algorithm -- --- Type: [Search Algorithm](https://xplr.dev/en/searching#search-algorithm) +-- Type: [Search Algorithm](https://xplr.dev/en/searching#algorithm) xplr.config.general.search.algorithm = "Fuzzy" -- The default search ordering @@ -473,8 +473,8 @@ xplr.config.general.sort_and_filter_ui.filter_identifiers = { -- -- Type: { format = nullable string, style = [Style](https://xplr.dev/en/style) } xplr.config.general.sort_and_filter_ui.search_identifiers = { - Fuzzy = { format = "fzy:/", style = {} }, - Regex = { format = "reg:/", style = {} }, + Fuzzy = { format = "fzy:", style = {} }, + Regex = { format = "reg:", style = {} }, } -- The shape of ordered indicator for search ordering identifiers in Sort & filter panel.