mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
refactor: use a more modern writing style to simplify code (#3834)
Signed-off-by: deepdring <deepdrink@icloud.com>
This commit is contained in:
@@ -59,7 +59,7 @@ func (b *Buffer) ReloadSettings(reloadFiletype bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Buffer) DoSetOptionNative(option string, nativeValue interface{}) {
|
||||
func (b *Buffer) DoSetOptionNative(option string, nativeValue any) {
|
||||
oldValue := b.Settings[option]
|
||||
if reflect.DeepEqual(oldValue, nativeValue) {
|
||||
return
|
||||
@@ -138,7 +138,7 @@ func (b *Buffer) DoSetOptionNative(option string, nativeValue interface{}) {
|
||||
b.doCallbacks(option, oldValue, nativeValue)
|
||||
}
|
||||
|
||||
func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
|
||||
func (b *Buffer) SetOptionNative(option string, nativeValue any) error {
|
||||
if err := config.OptionIsValid(option, nativeValue); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -163,7 +163,7 @@ func (b *Buffer) SetOption(option, value string) error {
|
||||
return b.SetOptionNative(option, nativeValue)
|
||||
}
|
||||
|
||||
func (b *Buffer) doCallbacks(option string, oldValue interface{}, newValue interface{}) {
|
||||
func (b *Buffer) doCallbacks(option string, oldValue any, newValue any) {
|
||||
if b.OptionCallback != nil {
|
||||
b.OptionCallback(option, newValue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user