Skip to content
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

Telescope: handle multiple selections #88

Merged
merged 10 commits into from
Sep 1, 2024
Merged

Conversation

jghauser
Copy link
Owner

@jghauser jghauser commented Jul 7, 2024

TODO: handle creating multiple notes when trying to open notes which do not exist yet [DONE]

@jghauser jghauser linked an issue Jul 7, 2024 that may be closed by this pull request
@jghauser jghauser marked this pull request as draft July 7, 2024 11:48
else
for _, entry in pairs(multi) do
local ref = string.format(format_string, entry.id.ref)
string_to_insert = string_to_insert .. ref .. " "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string connecting the reference keys (" " here) could be another configuration parameter. I only use papis.nvim with tex files and I need to connect them via ,

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I'll make sure to make it configurable and try to see what would be sensible defaults for the various filetypes we configure in cite_formats. I might in fact add it to that option :)

jghauser added 6 commits August 4, 2024 12:01
@jghauser jghauser force-pushed the search-handle-multiple-entries branch from 455bfff to a473e8c Compare August 18, 2024 13:08
@jghauser
Copy link
Owner Author

hey @maxmahlke, if you have the time, it would be great if you could take another look. i implemented what you asked for (configurable strings between refs) and also managed to sort out the other issues left with opening multiple files (especially notes). note that there are breaking changes concerning the citation_formats, format_notes, and format_references options (in case you're not using the defaults). The readme should reflect these changes.

@jghauser jghauser force-pushed the search-handle-multiple-entries branch from 6e6bf35 to 43061e7 Compare August 18, 2024 16:55
@jghauser
Copy link
Owner Author

jghauser commented Aug 19, 2024

TODO: allow inserting complete citations. E.g. rather than @SomeDude2011, do [@SomeDude2011]. This should now be possible because we correctly handle multiple refs. However, I'm not sure what's the best way to handle this given that the old way is still useful at times.

@maxmahlke
Copy link
Contributor

Hi @jghauser! I tested it briefly and it worked well for me in a tex file! Also a nice solution with the settings, it's quite flexible now. I prefer not having spaces in my \cite commands, so I set separator_str=','. I'll keep using the branch and let you know if I find a bug.

@jghauser
Copy link
Owner Author

jghauser commented Aug 27, 2024

@maxmahlke, thank you so much! ❤️ Do you think that the separator without space is more common for tex files? I probably just did a super short search and saw someone using a space and made that the default. Happy to change the default though!

@jghauser jghauser force-pushed the search-handle-multiple-entries branch from b6620e0 to 1c513b2 Compare September 1, 2024 16:10
@jghauser jghauser marked this pull request as ready for review September 1, 2024 16:12
@jghauser jghauser merged commit 2e691a1 into main Sep 1, 2024
2 checks passed
@jghauser jghauser deleted the search-handle-multiple-entries branch September 1, 2024 16:15
@jghauser
Copy link
Owner Author

jghauser commented Sep 1, 2024

Thanks a lot @maxmahlke, I've merged this now as I think it's ready. 🤞 Let me know if you still come across some issues :)

@jghauser jghauser mentioned this pull request Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable multiple-selection in telescope picker
2 participants