Closed penryu closed 7 months ago
This plugin doesn't use g
variables so that won't be a good way to go here. Also tbh I think this use case is quite specific and something a user could build into their config not something that needs to ship with this plugin
I agree: I did have concerns about the use of g
vars. A key in float_opts
would probably fit a lot better.
See comment below. ~When you say "build it into their config", are you talking about a configuration of toggleterm, or a different solution entirely?~
Granted my specific use case is probably very specific — especially the name of the variable I used.
~With that in mind, is there any interest in a more generalized solution like:~
float_opts = {
horiz_align = 'left' | 'center' | 'right', -- default: 'center'
vert_align = 'top' | 'center' | 'bottom', -- default: 'center'
},
Nevermind. I just realized that row
and col
are also valid float_opts
, and looked at how M._resolve_size()
works. So yes, this is truly trivial to implement with:
float_opts = { row = 0, ... },
Here is a doc-only change instead. :)
UPDATE:
A doc-only change to describe that
row
andcol
are also configurable via number or function, likewidth
andheight
.Original description:
~This one-line patch allows me to do something like this:~
~in my
init.lua
. Then by setting~~I get a true Quake-style float terminal.~
~It didn't seem worthwhile to create an entirely new
direction
when it's such a tiny variation on the existingfloat
, but there might be an argument to make it part of thefloat_opts
table?~~If you think this change is worth incorporating, I can add the corresponding paragraph to
toggleterm.txt
.~