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

feat: add nvim-tree awareness to avoid space collisions #163

Closed
hlmtre opened this issue Nov 13, 2023 · 10 comments · Fixed by #190
Closed

feat: add nvim-tree awareness to avoid space collisions #163

hlmtre opened this issue Nov 13, 2023 · 10 comments · Fixed by #190
Labels
enhancement New feature or request integration ui Related to formatting or positioning

Comments

@hlmtre
Copy link

hlmtre commented Nov 13, 2023

Have just moved off fidget.nvim's legacy tag and am very excited! I have discovered a small bug - fidget draws over the nvim-tree window. See below screenshot.

https://aql.ink/7a49ff07.png

It appears to do this whether or not nvim-tree is open before or after fidget's first appearance in that session of nvim.

@j-hui j-hui added bug Something isn't working ui Related to formatting or positioning labels Nov 14, 2023
@j-hui
Copy link
Owner

j-hui commented Nov 14, 2023

Ugh, that’s because Fidget now uses editor-relative positioning and doesn’t know that it’s fighting for real estate with nvim-tree.

I’ll have to think about how to fix this. The pragmatic way is to teach Fidget to be aware of nvim-tree, but I’m wondering if there’s any generic way to avoid buffer collisions without having to teach Fidget about every tray-style plugin out there.

@hlmtre
Copy link
Author

hlmtre commented Nov 14, 2023

Perhaps a reasonable partial/temporary solution would be to give fidget an option to be offset from the right, specified in its configuration.

@j-hui
Copy link
Owner

j-hui commented Nov 14, 2023

Yeah, that would be the way to do it.

I was reading up on the nvim-tree API and it’s definitely doable for that one plugin at least.

(Note to self: other plugins: trouble.nvim, treesitter playground, aerial (?), telescope… ugh there’s so many.)

@fitrh
Copy link

fitrh commented Nov 14, 2023

Is there a reason why the window-relative options are not currently exposed?

j-hui added a commit that referenced this issue Nov 14, 2023
Helps mitigate #163 little (though not a real solution)
@j-hui
Copy link
Owner

j-hui commented Nov 14, 2023

@fitrh because I didn't get around to testing it yet...

Anyway, I just pushed a commit that adds this feature

@hlmtre
Copy link
Author

hlmtre commented Nov 14, 2023

Brilliant!

@hlmtre
Copy link
Author

hlmtre commented Nov 14, 2023

Thanks @j-hui. I looked through the commit and didn't realize neovim offered an API that would make for such a simple fix. Nicely done!

@j-hui
Copy link
Owner

j-hui commented Nov 14, 2023

No problem, glad it works for you (:

It was actually a feature in the legacy implementation that I actually wasn't sure if I wanted to bring back, because the idea of the notification window bouncing around from window to window was a little weird. (In fact, I think it used to be the default.) But I forgot about this use case for it, as a workaround to things like nvim-tree.

@j-hui
Copy link
Owner

j-hui commented Nov 14, 2023

Also, update: I added 22b2ed8 to expose an API for dynamically adjusting the horizontal offset, but still need to figure out how to integrate that with nvim-tree (I'm not sure how to query the window size).

I'm going to remove the bug label from this issue since a workaround exists, but I'll keep it open until Fidget properly integrates with nvim-tree (or until we decide to give up on that).

@j-hui j-hui added enhancement New feature or request and removed bug Something isn't working labels Nov 14, 2023
@j-hui j-hui changed the title Fidget draws over nvim-tree feat: add nvim-tree awareness to avoid space collisions Nov 14, 2023
@j-hui
Copy link
Owner

j-hui commented Nov 20, 2023

GitHub path compression:

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

Successfully merging a pull request may close this issue.

3 participants