docs: fix typo and formatting (#226)

* style: fix formatting

* test: fix options to construct FS

* test: add cspell.json to validate doc

* docs: fix typo
This commit is contained in:
JINNOUCHI Yasushi 2024-07-14 22:33:44 +09:00 committed by GitHub
parent 1154548e61
commit 03d43510d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 8 deletions

1
cspell.json Normal file
View File

@ -0,0 +1 @@
{"words":["frecency","nvim","frecently","frecent","devicons","Neovim","shada","oldfiles","keymap","smartcase","frecencydelete","frecencyvalidate","frecencyopts","stdpath","substr","unindexed","fdfind","telescopebufferloaded","telescopepathseparator","telescopefrecencyscores","telescopequeryfilter","norl","noet","compl"],"flagWords":[],"language":"en","version":"0.2"}

View File

@ -139,7 +139,7 @@ imported.
USAGE *telescope-frecency-usage* USAGE *telescope-frecency-usage*
>vim >vim
:Telescope frecency :Telescope frecency
" Use a specifix workspace tag: " Use a specific workspace tag:
:Telescope frecency workspace=CWD :Telescope frecency workspace=CWD
" You can use with telescope's options " You can use with telescope's options
:Telescope frecency workspace=CWD path_display={"shorten"} theme=ivy :Telescope frecency workspace=CWD path_display={"shorten"} theme=ivy
@ -149,7 +149,7 @@ or to map to a key:
vim.keymap.set("n", "<Leader>tf", function() vim.keymap.set("n", "<Leader>tf", function()
require("telescope").extensions.frecency.frecency {} require("telescope").extensions.frecency.frecency {}
end) end)
-- Use a specifix workspace tag: -- Use a specific workspace tag:
vim.keymap.set("n", "<Leader>tw", function() vim.keymap.set("n", "<Leader>tw", function()
require("telescope").extensions.frecency.frecency { require("telescope").extensions.frecency.frecency {
workspace = "CWD", workspace = "CWD",
@ -293,9 +293,9 @@ Options: *telescope-frecency-function-query-options*
`Type: `"count"|"path"|"score"|"timestamps"` `Type: `"count"|"path"|"score"|"timestamps"`
This is used to sort results with their properties. With This is used to sort results with their properties. With
`"count"`, `"score"` and `"timestamps"`, when candidates have the `"count"`, `"score"` and `"timestamps"`, when candidates have the
same value, they will be sorted by `"path"` always ascendingly. same value, they will be sorted by `"path"` always in ascending
With `"path"`, the order direction differs by the value of order. With `"path"`, the order direction differs by the value
`direction`. of `direction`.
*telescope-frecency-function-query-options-record* *telescope-frecency-function-query-options-record*
- `record` Default: `false - `record` Default: `false
Type: `boolean` Type: `boolean`
@ -599,7 +599,7 @@ Default: `{}`
Type: `table<string, string>` Type: `table<string, string>`
This table contains mappings of `workspace_tag` → `workspace_directory`. The key This table contains mappings of `workspace_tag` → `workspace_directory`. The key
corresponds to the `:tag_name` used to select the filter in queies. The value corresponds to the `:tag_name` used to select the filter in queries. The value
corresponds to the top level directory by which results will be filtered. corresponds to the top level directory by which results will be filtered.
>lua >lua
-- example configuration -- example configuration

View File

@ -145,7 +145,7 @@ Config.setup = function(ext_config)
db_root = { opts.db_root, "s" }, db_root = { opts.db_root, "s" },
db_safe_mode = { opts.db_safe_mode, "b" }, db_safe_mode = { opts.db_safe_mode, "b" },
db_validate_threshold = { opts.db_validate_threshold, "n" }, db_validate_threshold = { opts.db_validate_threshold, "n" },
debug = { opts.debug, 'b' }, debug = { opts.debug, "b" },
default_workspace = { opts.default_workspace, "s", true }, default_workspace = { opts.default_workspace, "s", true },
disable_devicons = { opts.disable_devicons, "b" }, disable_devicons = { opts.disable_devicons, "b" },
filter_delimiter = { opts.filter_delimiter, "s" }, filter_delimiter = { opts.filter_delimiter, "s" },

View File

@ -16,7 +16,7 @@ local function make_epoch(datetime)
end end
local function with_database(f) local function with_database(f)
local fs = FS.new { ignore_patterns = {} } local fs = FS.new {}
local dir, close = util.tmpdir() local dir, close = util.tmpdir()
dir:joinpath("file_frecency.bin"):touch() dir:joinpath("file_frecency.bin"):touch()
return function() return function()