mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
feat: add default_workspace setting (#43)
This commit is contained in:
parent
4c46d46859
commit
ea44b316f4
@ -105,6 +105,10 @@ See [default configuration](https://github.com/nvim-telescope/telescope.nvim#tel
|
|||||||
Path to parent directory of custom database location.
|
Path to parent directory of custom database location.
|
||||||
Defaults to `$XDG_DATA_HOME/nvim` if unset.
|
Defaults to `$XDG_DATA_HOME/nvim` if unset.
|
||||||
|
|
||||||
|
- `default_workspace` (default: `nil`)
|
||||||
|
|
||||||
|
Default workspace tag to filter by e.g. `'CWD'` to filter by default to the current directory. Can be overridden at query time by specifying another filter like `':*:'`.
|
||||||
|
|
||||||
- `ignore_patterns` (default: `{"*.git/*", "*/tmp/*"}`)
|
- `ignore_patterns` (default: `{"*.git/*", "*/tmp/*"}`)
|
||||||
|
|
||||||
Patterns in this table control which files are indexed (and subsequently which you'll see in the finder results).
|
Patterns in this table control which files are indexed (and subsequently which you'll see in the finder results).
|
||||||
|
|||||||
@ -29,6 +29,7 @@ local state = {
|
|||||||
previous_buffer = nil,
|
previous_buffer = nil,
|
||||||
cwd = nil,
|
cwd = nil,
|
||||||
show_scores = false,
|
show_scores = false,
|
||||||
|
default_workspace = nil,
|
||||||
user_workspaces = {},
|
user_workspaces = {},
|
||||||
lsp_workspaces = {},
|
lsp_workspaces = {},
|
||||||
picker = {},
|
picker = {},
|
||||||
@ -189,6 +190,7 @@ local frecency = function(opts)
|
|||||||
if matched then
|
if matched then
|
||||||
query_text = query_text:sub(matched:len() + 1)
|
query_text = query_text:sub(matched:len() + 1)
|
||||||
end
|
end
|
||||||
|
new_filter = new_filter or state.default_workspace
|
||||||
|
|
||||||
local new_finder
|
local new_finder
|
||||||
local results_updated = update_results(new_filter)
|
local results_updated = update_results(new_filter)
|
||||||
@ -274,6 +276,7 @@ return telescope.register_extension {
|
|||||||
set_config_state("show_filter_column", ext_config.show_filter_column, true)
|
set_config_state("show_filter_column", ext_config.show_filter_column, true)
|
||||||
set_config_state("user_workspaces", ext_config.workspaces, {})
|
set_config_state("user_workspaces", ext_config.workspaces, {})
|
||||||
set_config_state("disable_devicons", ext_config.disable_devicons, false)
|
set_config_state("disable_devicons", ext_config.disable_devicons, false)
|
||||||
|
set_config_state("default_workspace", ext_config.default_workspace, nil)
|
||||||
|
|
||||||
-- start the database client
|
-- start the database client
|
||||||
db_client.init(
|
db_client.init(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user