Add a popup feature to display diagram image in a popup window#38
Open
Mrzrb wants to merge 3 commits into3rd:masterfrom
Open
Add a popup feature to display diagram image in a popup window#38Mrzrb wants to merge 3 commits into3rd:masterfrom
Mrzrb wants to merge 3 commits into3rd:masterfrom
Conversation
added 2 commits
December 8, 2025 23:59
- Fix image position in popup floating window - Add calculate_popup_size function for proper size calculation - Scale down large images to fit 90% of terminal while maintaining aspect ratio - Use image.nvim's adjust_to_aspect_ratio for consistent sizing - Refactor code to match project style (local x = function pattern) - Use vim.defer_fn for rendering like image.nvim does
|
It'd (at least partially, if not fully) solve the issue that caused me to ask for #36. If we were able to optionally “glue” that popup in place in the middle of the right edge of the terminal, then it'd solve that feature request directly. |
Author
Position in this implement is dynamic, it depends on the window size, it's calculated dynamically. But is's easy to add an option to set the popup window to specific position. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! I hope you're doing well. Great work on this plugin – it's been really helpful for me!
I noticed that your image.nvim plugin includes a popup feature, while diagram.nvim currently doesn't have one. I've implemented this functionality and would greatly appreciate it if you could review this PR.
Implementation highlights:
Added a popup feature for displaying diagrams
The popup window automatically detects the current buffer's window size and adapts accordingly for optimal viewing
Thank you for your time and consideration!
Thx!
Just like this
