-
Notifications
You must be signed in to change notification settings - Fork 24
Description
I think the plugin is awesome for e.g. reading documentation, but currently, using it for feedback while editing diagrams is problematic. When you try to edit the example diagram below, 1 of 2 things happens (video further down)…
-
either the image disappears, and the text suddenly shifts up, then back down but in a different position than it was before,
-
or you get scrolled into a position where the image re-renders correctly, and doesn't throw your view around, but it's too far up to see, so you have to scroll anyway.
2025-12-01.01-39-44.mp4
On the other hand, the alternative (preview in a tab) is not enough if you're in a process of editing the diagram and want that constant feedback on your work.
Most of us do have wide monitors, however, so I think the solution would be to have an option to render the preview on the right side of the terminal in a fixed vertical position (e.g. top, middle, bottom; without scrolling – anchored to the terminal edge, and not as a character). Either that, or in a window split. This way the preview would always flicker on the side regardless of the user's actions, not interfering with their editing, moving around the document, and so on, and still letting them keep track of the image. If the preview was only visible when the cursor is inside the diagram definition, or always showed the last diagram the cursor was in, then it'd solve the issue of “which diagram to show” in documents with multiple diagrams.
Diagram from the example:
---
config:
theme: 'dark'
---
stateDiagram-v2
a : attack
i : idle
w : walk
r : run
j : jump
f : fall
c : crouch
s : sneak
e : evade
a-->j
a-->c
i-->a
i-->j
i-->w
i-->c
j-->a
j-->f
f-->a
f-->c
w-->a
w-->i
w-->j
w-->f
w-->r
w-->s
r-->a
r-->w
r-->e
r-->j
r-->f
c-->a
c-->i
c-->e
c-->sIDK if it's important in this case, but I'm on:
nvim 0.11.5
ueberzugpp 2.9.8
rxvt-unicode 9.31
tmux 3.6
Manjaro 25.1.0 + i3-wm 4.24