toggleterm.nvim
toggleterm.nvim copied to clipboard
Size and direction options ordering swallow direction setting when ordered alphabetically
Hi @akinsho and thanks for this awesome project 👍️!
While playing with the configuration, I noticed a somewhat surprising behavior.
Depending on how you order the configuration options, the direction
one might be skipped.
Working configuration
In this case the direction is working as expected:
use {
'akinsho/toggleterm.nvim',
config = function()
require('toggleterm').setup {
size = 70,
direction = 'vertical',
float_opts = {
border = 'none'
},
}
end
}
Non-working configuration
In this case the direction fallbacks to horizontal
:
use {
'akinsho/toggleterm.nvim',
config = function()
require('toggleterm').setup {
direction = 'vertical',
size = 70,
float_opts = {
border = 'none'
},
}
end
}
TL;DR: size
must be set before direction
to get direction
working.
Hi @yamafaktory thanks for raising this, been a bit busy so haven't had time to dig in yet. That's definitely not intentional though.
@akinsho thanks for the swift reply! No worries at all. I haven't checked the source code and I'm pretty new to Lua and its ecosystem. I'll try to find some time to dig deeper.
I've just revisited this for the first time in a while and I don't believe this is the case (at least anymore). I've just tried moving the size key and it doesn't change whether or not the direction key works (on the latest commit of this repo).
If you're still experiencing this issue let me know on what version and also a minimal init.lua that I can use to test with