@@ -8,13 +8,9 @@ import (
88 "github.com/zyedidia/micro/v2/internal/screen"
99)
1010
11- func (b * Buffer ) SetOptionNative (option string , nativeValue interface {}) error {
12- if err := config .OptionIsValid (option , nativeValue ); err != nil {
13- return err
14- }
15-
11+ func (b * Buffer ) DoSetOptionNative (option string , nativeValue interface {}) {
1612 if reflect .DeepEqual (b .Settings [option ], nativeValue ) {
17- return nil
13+ return
1814 }
1915
2016 b .Settings [option ] = nativeValue
@@ -46,10 +42,14 @@ func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
4642 // filetype should not override volatile settings
4743 continue
4844 }
45+ if _ , ok := b .LocalSettings [k ]; ok {
46+ // filetype should not override local settings
47+ continue
48+ }
4949 if _ , ok := settings [k ]; ok {
50- b .SetOptionNative (k , settings [k ])
50+ b .DoSetOptionNative (k , settings [k ])
5151 } else {
52- b .SetOptionNative (k , v )
52+ b .DoSetOptionNative (k , v )
5353 }
5454 }
5555 b .UpdateRules ()
@@ -101,6 +101,15 @@ func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
101101 if b .OptionCallback != nil {
102102 b .OptionCallback (option , nativeValue )
103103 }
104+ }
105+
106+ func (b * Buffer ) SetOptionNative (option string , nativeValue interface {}) error {
107+ if err := config .OptionIsValid (option , nativeValue ); err != nil {
108+ return err
109+ }
110+
111+ b .DoSetOptionNative (option , nativeValue )
112+ b .LocalSettings [option ] = true
104113
105114 return nil
106115}
0 commit comments