Skip to content

Conversation

@1ynxy
Copy link

@1ynxy 1ynxy commented Oct 9, 2025

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.

"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",
Copy link
Collaborator

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)
Copy link
Collaborator

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,
Copy link
Collaborator

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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep alphabetical order.

@dmaluka
Copy link
Collaborator

dmaluka commented Dec 1, 2025

IMHO not a bad feature, why not.

The name tabalwaysshow may be a bit of a mouthful... Maybe just tabalways? (Better suggestions are welcome.)

Also, this PR doesn't work quite well in the case when this option is enabled or disabled at runtime via set tabalwaysshow on or set tabalwaysshow off (when there is just one tab open). It can be fixed as follows:

--- 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) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants