-
Notifications
You must be signed in to change notification settings - Fork 1.3k
add a global option to always show the tab bar #3882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep alphabetical order.
| "tabhighlight": true, | ||
| "tabmovement": false, | ||
| "tabreverse": false, | ||
| "tabalwaysshow": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.