mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
buffer: Fix ReloadSettings(true) for volatile filetype
We shall not overwrite a volatile set `filetype` provided as argument for micro: `micro -filetype shell foo`
This commit is contained in:
@@ -13,7 +13,9 @@ import (
|
|||||||
func (b *Buffer) ReloadSettings(reloadFiletype bool) {
|
func (b *Buffer) ReloadSettings(reloadFiletype bool) {
|
||||||
settings := config.ParsedSettings()
|
settings := config.ParsedSettings()
|
||||||
|
|
||||||
if _, ok := b.LocalSettings["filetype"]; !ok && reloadFiletype {
|
_, local := b.LocalSettings["filetype"]
|
||||||
|
_, volatile := config.VolatileSettings["filetype"]
|
||||||
|
if reloadFiletype && !local && !volatile {
|
||||||
// need to update filetype before updating other settings based on it
|
// need to update filetype before updating other settings based on it
|
||||||
b.Settings["filetype"] = "unknown"
|
b.Settings["filetype"] = "unknown"
|
||||||
if v, ok := settings["filetype"]; ok {
|
if v, ok := settings["filetype"]; ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user