Having issues with: railroad images, health check, popup display
Hi there, I'm trying to see the railroad image you mentioned:
return {
{
'bennypowers/nvim-regexplainer',
url = 'https://github.com/bennypowers/nvim-regexplainer.git',
dependencies = {
'edluffy/hologram.nvim',
'MunifTanjim/nui.nvim',
},
ft = {
'cjs',
'cjsx',
'html',
'javascript',
'js',
'jsx',
'mjs',
'mjsx',
'ts',
'tsx',
},
opts = {
mode = 'graphical',
},
},
}
but when I gR on a regex, neovim hangs for a few a coupld of seconds, and I end up with an "empty" popup:
Or with border config:
opts = {
mode = 'graphical',
popup = {
border = {
padding = { 1, 2 },
style = 'rounded',
},
},
}
Tried running :checkhealth regexplainer, and I see errors/warnings:
nui.nvimis included as a dependency, so not sure why there's an error saying it's not there- For Python dependencies, when I activate the
.venvdir mentioned in health check, I see:
Package Version
----------------- -------
cairocffi 1.7.1
CairoSVG 2.8.2
cffi 2.0.0
cssselect2 0.8.0
defusedxml 0.7.1
pillow 11.3.0
pip 25.2
pycparser 2.22
railroad-diagrams 3.0.1
tinycss2 1.4.0
webencodings 0.5.1
Where it lists the packages being complained about.
I'm pretty sure it's me missing something, so not sure what's happening.
Thanks for the report.
Please turn on debug = true option and paste output here. Confirm that nui is in fact installed
paste output here
Sorry, where are the logs written to?
Confirm that nui is in fact installed
I think it's installed, given that Lazy shows a solid circle for it
Hello, I can confirm I am having the same issue. Here is my output of debug = true:
Split mounted, winid: 1005
Installing Python dependencies for graphical mode...
Python dependencies installed successfully
Generated railroad diagram: 23972 bytes, actual size: 939x270 pixels
Image fits: 939x270 pixels
Pattern popup check: winid=1008, valid=true
Raw config: row=1.0, col=2.0, relative=win
Win-relative calc: topline=1 + row=1.0 = 2
Cursor at line 16, popup starts at line 2 (relative=win)
Popup covers cursor - showing pattern popup
Image window position: row=1.0, col=2.0, relative=win, pattern will be at row=0.0
Cursor window row: line 16 - topline 1 = row 15
Image spans rows 1.0 to 13.0, cursor at window row 15
Pattern row would be invisible, using cursor row 15
Pattern popup positioning: image at row=1.0, pattern at row=15.0, relative=win
Gutter width: 4, image col: 2.0 + padding: 2 + gutter: 4 = pattern col: 8.0
after_render called
Buffer: 8, Lines: 0
State has image_data: yes
I have a similar issue. The railroad diagrams do display for me, however they don't dissappear after moving away my cursor, and I have to press gR again for it to dissappear.
steps to reproduce (in my case):
- move cursor over a JS regex.
- press
gR - wait for < 1 second
- The "selected" regex appears somewhere in the document, and the railroad diagram gets displayed under the cursor
- move cursor away
- the regex that appeared in 4. disappears, the diagram stays.
- press
gRagin - diagram disappears.
(Step 4 visualized)
when running checkhealth regexplainer I have the same output.
I turned on the debug option and i believe these are the logs, correct me if I'm wrong.
"Pattern popup check: winid=1037, valid=true"
"Raw config: row=1.0, col=2.0, relative=win"
"Win-relative calc: topline=99 + row=1.0 = 100"
"Cursor at line 139, popup starts at line 100 (relative=win)"
"Popup covers cursor - showing pattern popup"
"Image window position: row=1.0, col=2.0, relative=win, pattern will be at row=0.0"
"Cursor window row: line 139 - topline 99 = row 40"
"Image spans rows 1.0 to 10.0, cursor at window row 40"
"Pattern row would be invisible, using cursor row 40"
"Pattern popup positioning: image at row=1.0, pattern at row=40.0, relative=win"
"Gutter width: 4, image col: 2.0 + padding: 2 + gutter: 4 = pattern col: 8.0"
"after_render called"
"Buffer: 41, Lines: 0"
"State has image_data: yes"