-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set arg make ObsidianQuickSwitch search order #179
Conversation
@epwalsh The conflicts in the CHANGELOG have been resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bigzhu, sorry for the slow response.. I was out with COVID for a week.
Having two options called sort_by
and order_by
seems pretty confusing to me. I recommend we just have a sort_by
option and then a sort_reversed
(bool) option.
Oh, @epwalsh I didn't notice your reply. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bigzhu, thanks for those changes. I just have a couple more requests.
lua/obsidian/command.lua
Outdated
@@ -385,7 +405,8 @@ command.quick_switch = function(client, data) | |||
util.implementation_unavailable() | |||
end | |||
-- Search with telescope.nvim | |||
telescope.find_files { cwd = dir, search_file = "*.md" } | |||
local opts = attach_find_command(client, { cwd = dir, search_file = "*.md" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should support fzf.vim
and fzf-lua
too.
lua/obsidian/command.lua
Outdated
if sort_reversed == false then | ||
sort = "sort" | ||
end | ||
opts.find_command = { "rg", "--files", "--" .. sort, sort_by } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start with util.FIND_CMD
command and the --sort/--sortr
options to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_command
is the telescope.find_files
parameter, I don't understand it has any business with util.FIND_CMD
I tried to push a commit to your branch and GitHub automatically closed this PR. Not sure what's going on. |
Had to create a new PR here: #200 |
No problem, don't mind |
Use rg sort