andreyorst / plug.kak

Plugin manager for Kakoune
MIT License
197 stars 18 forks source link

Errors in config blocks don't get brought to the user's attention #118

Closed cole-h closed 3 years ago

cole-h commented 3 years ago

Earlier today, I was porting my config from alexherbo2's plug.kak (which seems to have disappeared) to yours, and I made a mistake trying to set an option that is only valid after a plugin was loaded.

If I go into the debug buffer, I do indeed see an error, but I'm never presented with a "banner" that points me to the buffer -- I just notice that some of my plugins are not loaded.

'plug.kak' loaded in 0.001 sec
'prelude.kak' loaded in 0.004 sec
[...]/plugins/plug.kak/..//.build/smarttab.kak/config:4:3: 'set-option': option not found: 'softtabstop'. Use declare-option first

If possible, it'd be nice if there would be a nice error message to tell the user to look at the debug buffer or something like that.

You can probably reproduce with the following config:

plug-chain "https://github.com/andreyorst/plug.kak" noload config %{
} plug "https://github.com/alexherbo2/prelude.kak" config %{
} plug "https://github.com/andreyorst/smarttab.kak" config %{
  set-option global softtabstop 4
}

(the config on smarttab should be defer smarttab for proper functionality)

andreyorst commented 3 years ago

I think it should be possible to display a message in the modeline, or even create an info box with a more detailed report, but keep this optional, and let users disable it.

Will gladly accept PR for this enhancement, but I'm not sure when I'll be able to work on it myself.

cole-h commented 3 years ago

I've opened https://github.com/andreyorst/plug.kak/pull/120 in an attempt to fix this.