-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow opening floating windows not relative to the cursor #60
Comments
Added some config options for different relative floats, and made the width/height options more flexible (you can specify percentages, rows/cols, or both). There's an escape hatch in Give it a try! Let me know if the defaults make sense. I also had to rework a decent chunk of the existing width calculation logic, so let me know if you find any bugs. |
Oops, sorry for the delay, totally thought I had already responded. Thank you very much! I played around with it a bit, and everything seems to be working. Nice work! Yeah, the defaults seem pretty reasonable. (Note: I'm personally using something a bit more customized (in Yuescript):
) |
I think that you should be able to get a similar layout with: require('aerial').setup({
float = {
relative = 'editor',
width = 0.8,
max_width = 0.8,
height = 0.8,
max_height = 0.8,
}
}) But regardless, glad it's working for you! |
Hello!
I've noticed that an option for opening Aerial as a floating window relative to the cursor was added with issue #23. It would be nice, however, to also support opening a floating window that is not relative to the cursor, akin to Fzf/Telescope.
If I'm not mistaken, this would mean an alternate call to
nvim_open_win
withrelative
set to"editor"
, and withwidth
,height
,row
andcol
set in a manner to have some padding.In terms of adding this to the config, I propose the following: add a field to the
float
section,relative
, which can be either"cursor"
or"editor"
(and maybe also "buffer
" in the future?). If it's"cursor"
(the default), then it follows the current logic, reading therow
,col
,max_height
andmin_height
fields. However, if it's set to"editor"
, then it should look forpadding_x
andpadding_y
fields. The shape of the floating window would then be as follows, wherew
andh
are the width and height of the terminal:width = w - 2*floor(padding_x*w)
,height = h - 2*floor(padding_y*h)
,row = floor(padding_y*h)
,col = floor(padding_x*w)
.The text was updated successfully, but these errors were encountered: