Closed bound-variable closed 2 years ago
I've never used autoload
and I actually don't understand how it works, since I've created and started plug.kak from day one of me using Kakoune. Maybe it requires some more steps, but in my understanding of it, it should work as if you've sourced everything manually, and from that point it doesn't differ from initialization with plug.kak. If you'll figure out what causes the issue, please report back, so I could add it to the readme.
I just tried the "by hand" method. Now when I run Kakoune, I no longer have the command powerline-start
. With autoloading, at least the command was there.
are you sure you've loaded the rc/powerline.kak
script? It defines this command at the very top, so if it's not defined, it means it wasn't loaded.
OK, It seems I've figured it out. It works, it just didn't render. For some reason it only appears when opening new buffers. I enable powerline before window is set up in my config, so perhaps this is why I never noticed this behavior
So, you can use autoload as you were, you just need to call powerline-start
in your config, and not interactively, for it to appear in the first opened buffer.
Wonderful. It works now. Shall I close this issue?
I'll investigate more on why this doesn't call refres after calling this command. IIRC there were some issues with that so I've removed it. Once I'm certain, I'll either update the readme to be more explicit, or add a refresh and then I'll close this. For now, let's leave it open :)
I think I've remembered why this was made how it is -- the powerline-start
command can't refresh the modeline, because when it's ran from the kakrc
during load there's no window context, and it will not be able to do anything, as all of the variables are window scoped. Because of that it registers a hook:
And when this hook activates it redraws the powerline for all opened buffers. So powerline-start
only makes sense as a command to call from kakrc
. If you need to manually enable powerline you can call powerline-enable
but this requires a powerline
module to be loaded, which is also done in the powerline-start
command, and that explains why other commands weren't available, as the hook wasn't triggered and module was never loaded.
TL;DR:
Use powerline-start
from kakrc
.
Use require-module powerline
and powerline-enable
interactively.
Problem description
Powerline fails to display
Steps to reproduce
/autoload
:git clone https://github.com/andreyorst/powerline.kak
powerline-start
and tried it.What should happen
Powerline appears
What happens instead
Nothing
Environment information
Kakoune version: 2021.11.08-1 OS version: Arch
sh
executable version:sh
is linked tobash
, version 5.1.016-1