Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/micro.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
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.

"type": "boolean",
"default": false
},
"tabsize": {
"description": "A tab size\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"type": "integer",
Expand Down
6 changes: 4 additions & 2 deletions internal/action/tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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.

if len(t.List) > 1 || globalTabAlwaysShow {
for _, p := range t.List {
p.Y = 1
p.Node.Resize(w, h-1-iOffset)
Expand Down Expand Up @@ -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()
}
}
Expand Down
1 change: 1 addition & 0 deletions internal/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ var DefaultGlobalOnlySettings = map[string]any{
"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.

"xterm": false,
}

Expand Down
1 change: 1 addition & 0 deletions runtime/help/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ so that you can see what the formatting should look like.
"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.

"tabsize": 4,
"tabstospaces": false,
"useprimary": true,
Expand Down