mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -04: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:
parent
5a62a8ead4
commit
00e568640c
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user