I have a case of "Top Icon Madness", and I'm almost sure it's something silly I'm doing (but can't figure out).
In the past, I had a simple CONFIG file with some actionButton.define directives and everything worked. At some point, things went somewhat crazy and now I either have a lot of top buttons repeated and sometimes (after a few reloads), no buttons at all!
I'm using 2.10, this is my CONFIG.md file (replaced space-lua with lua here):
actionButton.define {
icon = "github",
description = "Github",
priority = 2.6,
run = function()
editor.openUrl "https://github.com/silverbulletmd/silverbullet"
end
}
With this config, even after Alt-Ctrl-R and shift-reload, I get the following icons:
back icon
search icon
back icon
search icon
home icon
bubble icon
github icon
github icon
open page icon
command icon
The weird thing is that if I start reloading and playing with it from other browsers, I eventually get to a situation where I only have the home, open page, and command icons.
Where should I start to debug this problem? I can't find any unusual messages in the browser console.
Do you happen to have an additional config somewhere else in your space? Such configs can live basically everywhere, and not only within the CONFIG page.
Ah that is a very good point. I've noticed that I had CONFIG.conflicted files which were being loaded as well. Removing those seems to have fixed the problem. I feel dumb for not having seen this before...
Anyway, it seems to be working now, but I also noticed that the Home, Open Page and Command icons always show at the end. Is there a way to override those being added in this order? Notice that I'm not adding them and even no CONFIG.md file causes them to appear.
config.set {
actionButtons = {
{ icon = "chevron-left", description= " Back in History", run = function() editor.invokeCommand("Navigate: Back in History") end },
{ icon = "chevron-right", description= " Forward in History", run = function() editor.invokeCommand("Navigate: Forward in History") end },
{ icon = "terminal", description = "Run command", run = function() editor.invokeCommand "Open Command Palette" end },
}