Closed ralf3u closed 4 months ago
In .config/geany/plugins/geanylua/:
Create the folder with this name: events
In .config/geany/plugins/geanylua/:
Create the document with this name: auto-sidebar.lua
The content of auto-sidebar.lua
:
--[[
Show/Hide sidebar based on file types in action_tbl
--]]
function hide_sidebar()
geany.signal("notebook3", "hide")
update()
end
function show_sidebar()
geany.signal("notebook3", "show")
update()
end
function update()
geany.signal("notebook1", "style-updated")
end
-- ----------
local action_tbl =
{
["HTML"] = show_sidebar,
["Markdown"] = show_sidebar,
["Fountain"] = show_sidebar,
}
infotable = geany.fileinfo()
local func = action_tbl[infotable["type"]]
if (func) then
func()
else
hide_sidebar()
end
-- uncomment the following line to show the filetype in the status window
-- geany.status(infotable["type"])
In .config/geany/plugins/geanylua/events/:
Create the document with this name: activated.lua
The content of activated.lua
:
local lua_path = geany.appinfo().scriptdir..geany.dirsep
auto_sidebar = loadfile(lua_path.."auto-sidebar.lua")
auto_sidebar()
The auto-sidebar small version works also in combination with toggle-menu-bar.
@xiota An alternative to this issue is to publish also the old version of auto-sidebar, so auto-sidebar (small version) at https://github.com/xiota/geanylua-scripts and to delete this issue.
At the moment there is a big version of
auto-sidebar
at https://github.com/xiota/geanylua-scripts, in case alsoswitch-views
are used.When
switch-views
didn't exist, there was only a small version ofauto-sidebar
. Maybe someone is not interested inswitch-views
, so the small version ofauto-sidebar
could be interesting.In the next comment is the small version of
auto-sidebar
that existed in the past at https://github.com/xiota/geanylua-scripts.