add a global option to always show the tab bar#3882
add a global option to always show the tab bar#38821ynxy wants to merge 1 commit intomicro-editor:masterfrom
Conversation
| "default": true | ||
| }, | ||
| "tabalwaysshow": { | ||
| "description": "Wether to show the tab bar, even if only one tab exists\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options", |
There was a problem hiding this comment.
s/Wether/Whether/ ?
But more importantly, please document this in runtime/help/options.md.
As for this data/micro.json, I'm not even sure what it is for... Ok, just looked it up: it is some strange thing introduced in #2697 "to add intellisence for micro config", whatever that means. Basically we don't care about keeping it up to date.
| iOffset := config.GetInfoBarOffset() | ||
| InfoBar.Resize(w, h-1) | ||
| if len(t.List) > 1 { | ||
| globalTabAlwaysShow := config.GetGlobalOption("tabalwaysshow").(bool) |
There was a problem hiding this comment.
nit: a separate variable doesn't seem useful here, we can just do if len(t.List) > 1 || config.GetGlobalOption("tabalwaysshow").(bool)?
Same for Display() below.
| "sucmd": "sudo", | ||
| "tabhighlight": false, | ||
| "tabreverse": true, | ||
| "tabalwaysshow": false, |
There was a problem hiding this comment.
Please keep alphabetical order.
| "tabhighlight": true, | ||
| "tabmovement": false, | ||
| "tabreverse": false, | ||
| "tabalwaysshow": false, |
There was a problem hiding this comment.
Please keep alphabetical order.
|
IMHO not a bad feature, why not. The name Also, this PR doesn't work quite well in the case when this option is enabled or disabled at runtime via --- a/internal/action/command.go
+++ b/internal/action/command.go
@@ -586,7 +586,7 @@ func doSetGlobalOptionNative(option string, nativeValue any) error {
for _, b := range buffer.OpenBuffers {
b.UpdateRules()
}
- } else if option == "infobar" || option == "keymenu" {
+ } else if option == "infobar" || option == "keymenu" || option == "tabalwaysshow" {
Tabs.Resize()
} else if option == "mouse" {
if !nativeValue.(bool) { |
This might not be the perfect way to solve this problem, but I figured that I would dive into the codebase and give it a go before asking for another feature request for something this small.
I think, if we're allowing customisability of the tab bar (reversing colour-theme, etc), that we should also allow the option to set the tab bar to "always show". This pull does that.
Discussion encouraged.