Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
format: auto sort requires
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Oct 9, 2023
1 parent 87f4418 commit 4378648
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
column_width = 100
indent_type = "Spaces"
indent_width = 2
[sort_requires]
enabled = true
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/gkeep/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ local action_set = require("telescope.actions.set")
local action_state = require("telescope.actions.state")
local actions = require("telescope.actions")
local search = require("telescope._extensions.gkeep.search")
local title_search = require("telescope._extensions.gkeep.title_search")
local telescope = require("telescope")
local title_search = require("telescope._extensions.gkeep.title_search")

-- Create our own mapping because the built-in telescope select action
-- normalizes the path, which removes the second slash from gkeep://
Expand Down
24 changes: 13 additions & 11 deletions lua/telescope/_extensions/gkeep/search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ local function search_picker(opts)
return score < 0 and 0 or score
end

pickers.new(opts, {
prompt_title = "Google Keep Notes",
finder = util.DynamicAsyncFinder:new({
curr_buf = vim.api.nvim_get_current_buf(),
fn = search,
entry_maker = util.make_entry,
}),
sorter = sorter,
previewer = util.previewer,
attach_mappings = opts.attach_mappings,
}):find()
pickers
.new(opts, {
prompt_title = "Google Keep Notes",
finder = util.DynamicAsyncFinder:new({
curr_buf = vim.api.nvim_get_current_buf(),
fn = search,
entry_maker = util.make_entry,
}),
sorter = sorter,
previewer = util.previewer,
attach_mappings = opts.attach_mappings,
})
:find()
end

return search_picker
24 changes: 13 additions & 11 deletions lua/telescope/_extensions/gkeep/title_search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ local function title_search(opts)
process_complete()
end

pickers.new(opts, {
prompt_title = "Google Keep Notes",
finder = util.DynamicAsyncFinder:new({
curr_buf = vim.api.nvim_get_current_buf(),
fn = search,
entry_maker = util.make_entry,
}),
sorter = conf.generic_sorter(opts),
previewer = util.previewer,
attach_mappings = opts.attach_mappings,
}):find()
pickers
.new(opts, {
prompt_title = "Google Keep Notes",
finder = util.DynamicAsyncFinder:new({
curr_buf = vim.api.nvim_get_current_buf(),
fn = search,
entry_maker = util.make_entry,
}),
sorter = conf.generic_sorter(opts),
previewer = util.previewer,
attach_mappings = opts.attach_mappings,
})
:find()
end

return title_search

0 comments on commit 4378648

Please sign in to comment.