Closed shaunsingh closed 3 years ago
It's related to your personal configuration. Please see the screenshot below.
grip-mode
uses built-in function pop-to-buffer
.
Several years ahead (and Doom Emacs using xwidgets to open the preview), I hit the same problem. I tried a lot of stuff. Found a solution that I will share just in case anyone else needs the preview to open in a side window (not at the bottom):
Thanks! Actually it should be related to the doom's settings of display-buffer-alist
.
Some of my attempts (while using Doom Emacs), where:
(set-popup-rules!
'(("^\\*^xwidget-webkit:.*(?:- Grip|\.html)\\*$"
:actions (display-buffer-in-side-window)
:side right
:width 0.5
:select t
:quit nil
:ttl nil)))
(add-to-list 'display-buffer-alist
'("^\\*^xwidget-webkit:.*(?:- Grip|\.html)\\*$"
(+popup-buffer)
(actions)
(side . right)
(size . 0.5)
(window-parameters (ttl) (quit))))
None worked for me. Am I missing something?
"^\\*^xwidget-webkit:.*(?:- Grip|\.html)\\*$"
The single backslash behind the .html
looks like a typo, and the group (the parens and pipe) needs to be escaped as well. Try this instead:
(set-popup-rule!
"^\\*^xwidget-webkit:.*\\(?:- Grip\\|\\.html\\)\\*$"
:side 'right
:width 0.5
:select t
:quit nil
:ttl nil)
(got rid of the unneeded :actions
, and am using the simpler set-popup-rule!
).
@hlissner
M-: (buffer-name)
returns "*xwidget-webkit: README.md - Grip*"
for me.
If I call M-x +popup/close-all
nothing closes. So, I don't completely understand what's going on here.
EDIT: Correct regex is: "^\\*xwidget-webkit:.*(?:- Grip|\.html)\\*$"
I had an additional ^
that I didn't notice 🫤
Hi, when opening a preview using grip-mode, it always opens on the bottom instead of the right, how would I fix this?
I'm using doom emacs with emacs-plus@28 (with xwidgets), my config is here: https://github.com/shaunsingh/vimrc-dotfiles/blob/main/.doom.d/config.org