5

What I've tried is a exe ':'.pupid.'windo norm! zi' however the command fails upfront with and 'Invalid range` error. The pupid is being obtained via popup_findpreview() and is correct. That's because popup_findpreview() gives you a window ID, but the range passed to :windo expects window numbers: :[range]windo {cmd} Execute {cmd} in each window or if [...


2

If you look at the help for the :pedit command, you will see this: :ped :pedit :ped[it][!] [++opt] [+cmd] {file} Edit {file} in the preview window. The preview window is opened like with :ptag. The current window and cursor position isn't changed. Useful example: ...


2

:h BufWinEnter is the event: :autocmd! BufWinEnter * if &previewwindow | setlocal cursorline | endif I guess the discrepancy is because WinEnter is triggered before 'previewwindow' is set. Possibly what's meant by this note in the help: Note: For split and tabpage commands the WinEnter event is triggered after the split or tab ...


1

After seven hours of fiddling with the documentation and searching, I was able to write a function that takes a filetype, an array of strings and show a dummy buffer based on that. function! showInPreview(name, fileType, lines) let l:command = "silent! pedit! +setlocal\\ " . \ "buftype=nofile\\ nobuflisted\\ " . \ "...


Only top voted, non community-wiki answers of a minimum length are eligible