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

Set display_location by filetype #135

Closed
ruicsh opened this issue Nov 3, 2024 · 6 comments · Fixed by #130
Closed

Set display_location by filetype #135

ruicsh opened this issue Nov 3, 2024 · 6 comments · Fixed by #130
Labels
enhancement New feature or request

Comments

@ruicsh
Copy link

ruicsh commented Nov 3, 2024

Hi, great plugin.

I'd like to set display_location by file type. For example, it may be quite useful to have location displayed for lua files, but not so much for typescript files if you're using the browser where all logs already have a file location displayed by the browser's console.

I'd suggest having display_location accept an optional function where we can leverage vim.bo.filetype. Or accept display_location on the filetypes tables.

@andrewferrier
Copy link
Owner

That makes sense, and I'm fact it might even make sense to extend this to the other display_* options. Hopefully a fairly straightforward change; I'll work on this. Thanks for the feedback.

@andrewferrier
Copy link
Owner

OK, I've had a think about the right way to implement this. What I think I'll do is that for now I will support display_location, display_counter and display_snippet at the filetype level, so they can be overriden on a per-filetype basis. I think that will alleviate your immediate need.

Then, to add flexibility, I will work longer-term on implementing #21, which will allow for a dynamic callback every time a debugprint line is inserted, optionally further overriding these values in addition to the left, right, etc. for the filetype. I think that allows for maximum flexibility.

@ruicsh
Copy link
Author

ruicsh commented Nov 3, 2024

that's great, cheers!

@andrewferrier andrewferrier added the enhancement New feature or request label Nov 3, 2024
@andrewferrier
Copy link
Owner

andrewferrier commented Nov 3, 2024

Hi, I've implemented this now - I think this should do what you were after. Please test it out and let me know how it works for you (it's on the main branch, not in a release yet).

@ruicsh
Copy link
Author

ruicsh commented Nov 3, 2024

works great, thanks a lot!

@andrewferrier
Copy link
Owner

works great, thanks a lot!

Great, thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants