diff --git a/data/micro.json b/data/micro.json index 8a31adda0f..4352629566 100644 --- a/data/micro.json +++ b/data/micro.json @@ -337,6 +337,11 @@ "type": "boolean", "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", + "type": "boolean", + "default": false + }, "tabsize": { "description": "A tab size\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options", "type": "integer", diff --git a/internal/action/tab.go b/internal/action/tab.go index 076df5f801..d750f46d47 100644 --- a/internal/action/tab.go +++ b/internal/action/tab.go @@ -83,7 +83,8 @@ func (t *TabList) Resize() { w, h := screen.Screen.Size() iOffset := config.GetInfoBarOffset() InfoBar.Resize(w, h-1) - if len(t.List) > 1 { + globalTabAlwaysShow := config.GetGlobalOption("tabalwaysshow").(bool) + if len(t.List) > 1 || globalTabAlwaysShow { for _, p := range t.List { p.Y = 1 p.Node.Resize(w, h-1-iOffset) @@ -144,7 +145,8 @@ func (t *TabList) HandleEvent(event tcell.Event) { // Display updates the names and then displays the tab bar func (t *TabList) Display() { t.UpdateNames() - if len(t.List) > 1 { + globalTabAlwaysShow := config.GetGlobalOption("tabalwaysshow").(bool) + if len(t.List) > 1 || globalTabAlwaysShow { t.TabWindow.Display() } } diff --git a/internal/config/settings.go b/internal/config/settings.go index 685b55ef2b..f018eda128 100644 --- a/internal/config/settings.go +++ b/internal/config/settings.go @@ -130,6 +130,7 @@ var DefaultGlobalOnlySettings = map[string]any{ "sucmd": "sudo", "tabhighlight": false, "tabreverse": true, + "tabalwaysshow": false, "xterm": false, } diff --git a/runtime/help/options.md b/runtime/help/options.md index 0347f5e167..b43f0d105f 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -619,6 +619,7 @@ so that you can see what the formatting should look like. "tabhighlight": true, "tabmovement": false, "tabreverse": false, + "tabalwaysshow": false, "tabsize": 4, "tabstospaces": false, "useprimary": true,