This commit is contained in:
OpenSauce 2025-06-05 17:17:05 +05:00 committed by GitHub
commit 9098ebb7ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 2 deletions

View File

@ -21,6 +21,11 @@
"type": "boolean", "type": "boolean",
"default": false "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": { "backup": {
"description": "Whether to backup all open buffers\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options", "description": "Whether to backup all open buffers\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"type": "boolean", "type": "boolean",

View File

@ -578,7 +578,7 @@ func doSetGlobalOptionNative(option string, nativeValue interface{}) error {
config.ModifiedSettings[option] = true config.ModifiedSettings[option] = true
delete(config.VolatileSettings, option) delete(config.VolatileSettings, option)
if option == "colorscheme" { if option == "colorscheme" || option == "background" {
// LoadSyntaxFiles() // LoadSyntaxFiles()
config.InitColorscheme() config.InitColorscheme()
for _, b := range buffer.OpenBuffers { for _, b := range buffer.OpenBuffers {

View File

@ -137,6 +137,11 @@ lineLoop:
colors := string(matches[2]) colors := string(matches[2])
style := StringToStyle(colors) style := StringToStyle(colors)
if !GlobalSettings["background"].(bool) && link != "statusline" {
style = style.Background(tcell.ColorDefault)
}
c[link] = style c[link] = style
if link == "default" { if link == "default" {

View File

@ -55,6 +55,7 @@ var OptionChoices = map[string][]string{
var defaultCommonSettings = map[string]interface{}{ var defaultCommonSettings = map[string]interface{}{
"autoindent": true, "autoindent": true,
"autosu": false, "autosu": false,
"background": true,
"backup": true, "backup": true,
"backupdir": "", "backupdir": "",
"basename": false, "basename": false,

View File

@ -24,7 +24,7 @@ Here are the available options:
default value: `0` 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 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 privileges to save the file. If this option is enabled, micro will
automatically attempt to use super user privileges to save without automatically attempt to use super user privileges to save without
@ -32,6 +32,12 @@ Here are the available options:
default value: `false` 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 * `backup`: micro will automatically keep backups of all open buffers. Backups
are stored in `~/.config/micro/backups` and are removed when the buffer is 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 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, "autoindent": true,
"autosave": 0, "autosave": 0,
"autosu": false, "autosu": false,
"background": true,
"backup": true, "backup": true,
"backupdir": "", "backupdir": "",
"basename": false, "basename": false,