You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've been using a feature for a while on my side with some hacked code and would like to integrate it better in the main repo, so I am asking for how to best do it. The concept is as follow: when the function is called, a telescope picker is opened with current opened projects using opened_projects registry. When a selection is made, the most recent buffer opened in that project is opened (should also lcd if enabled). Here are some screenshots:
Example of classic telescope repo.
When 2 projects have been opened and calling the function.
Link to a hacky implementation of mine: phgz@e1236c1
In there, I add a get_project_paths() function to be used by user and call user_opts.post_action(dir) if it's defined. Other than that a (I think) bug fix calling project_live_grep with user_opts instead of list_opts and a previous fix on autocmd that I mentioned a while ago, which I saw on one of your dev branch you fixed.
On the user part, here's how I define my command: I first do the inventory of active buffers and "map" them to an opened project. Then I use that list to feed to the search_dirs and set the post action to execute.
My post action function takes the selected project by the user and browses jumplist to find most recent file of that project and then simply perform a vim.cmd.edit(to_edit) on the found file.
So either there could be a possibility to leave the opportunity to the users to define their own post action, or simply add a function as a whole (like telescope.extensions.repo.switch) embedded in telescope-repo` and make it public in the API.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi!
So I've been using a feature for a while on my side with some hacked code and would like to integrate it better in the main repo, so I am asking for how to best do it. The concept is as follow: when the function is called, a telescope picker is opened with current opened projects using
opened_projects
registry. When a selection is made, the most recent buffer opened in that project is opened (should alsolcd
if enabled). Here are some screenshots:Link to a hacky implementation of mine: phgz@e1236c1
In there, I add a get_project_paths() function to be used by user and call
user_opts.post_action(dir)
if it's defined. Other than that a (I think) bug fix callingproject_live_grep
withuser_opts
instead oflist_opts
and a previous fix onautocmd
that I mentioned a while ago, which I saw on one of your dev branch you fixed.On the user part, here's how I define my command: I first do the inventory of active buffers and "map" them to an opened project. Then I use that list to feed to the
search_dirs
and set the post action to execute.My post action function takes the selected project by the user and browses jumplist to find most recent file of that project and then simply perform a
vim.cmd.edit(to_edit)
on the found file.So either there could be a possibility to leave the opportunity to the users to define their own post action, or simply add a function as a whole (like telescope.extensions.repo.switch
) embedded in
telescope-repo` and make it public in the API.Thanks!
The text was updated successfully, but these errors were encountered: