diff --git a/data/micro.json b/data/micro.json index 8a31adda..ad1bb5d0 100644 --- a/data/micro.json +++ b/data/micro.json @@ -21,6 +21,11 @@ "type": "boolean", "default": false }, + "background": { + "description": "Whether to display the theme's background color\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options", + "type": "boolean", + "default": false + }, "backup": { "description": "Whether to backup all open buffers\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options", "type": "boolean", diff --git a/internal/action/command.go b/internal/action/command.go index 9bf979b9..715dd0a8 100644 --- a/internal/action/command.go +++ b/internal/action/command.go @@ -578,7 +578,7 @@ func doSetGlobalOptionNative(option string, nativeValue interface{}) error { config.ModifiedSettings[option] = true delete(config.VolatileSettings, option) - if option == "colorscheme" { + if option == "colorscheme" || option == "background" { // LoadSyntaxFiles() config.InitColorscheme() for _, b := range buffer.OpenBuffers { diff --git a/internal/config/colorscheme.go b/internal/config/colorscheme.go index 5376c845..bf1e9dbe 100644 --- a/internal/config/colorscheme.go +++ b/internal/config/colorscheme.go @@ -137,6 +137,11 @@ lineLoop: colors := string(matches[2]) style := StringToStyle(colors) + + if !GlobalSettings["background"].(bool) && link != "statusline" { + style = style.Background(tcell.ColorDefault) + } + c[link] = style if link == "default" { diff --git a/internal/config/settings.go b/internal/config/settings.go index 837b56ba..4152e8b7 100644 --- a/internal/config/settings.go +++ b/internal/config/settings.go @@ -55,6 +55,7 @@ var OptionChoices = map[string][]string{ var defaultCommonSettings = map[string]interface{}{ "autoindent": true, "autosu": false, + "background": true, "backup": true, "backupdir": "", "basename": false, diff --git a/runtime/help/options.md b/runtime/help/options.md index c536aabd..908e4616 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -24,7 +24,7 @@ Here are the available options: default value: `0` -* `autosu`: When a file is saved that the user doesn't have permission to +* `autosu`: when a file is saved that the user doesn't have permission to modify, micro will ask if the user would like to use super user privileges to save the file. If this option is enabled, micro will automatically attempt to use super user privileges to save without @@ -32,6 +32,12 @@ Here are the available options: default value: `false` +* `background`: whether to display the current theme's background color. + If this option is disabled, the background color of the current theme + will not be used and instead the terminal's default color will be shown. + + default value: `true` + * `backup`: micro will automatically keep backups of all open buffers. Backups are stored in `~/.config/micro/backups` and are removed when the buffer is closed cleanly. In the case of a system crash or a micro crash, the contents @@ -531,6 +537,7 @@ so that you can see what the formatting should look like. "autoindent": true, "autosave": 0, "autosu": false, + "background": true, "backup": true, "backupdir": "", "basename": false,