MCPcopy
hub / github.com/micro-editor/micro / SetOption

Method SetOption

internal/buffer/settings.go:153–164  ·  view source on GitHub ↗

SetOption sets a given option to a value just for this buffer

(option, value string)

Source from the content-addressed store, hash-verified

151
152// SetOption sets a given option to a value just for this buffer
153func (b *Buffer) SetOption(option, value string) error {
154 if _, ok := b.Settings[option]; !ok {
155 return config.ErrInvalidOption
156 }
157
158 nativeValue, err := config.GetNativeValue(option, value)
159 if err != nil {
160 return err
161 }
162
163 return b.SetOptionNative(option, nativeValue)
164}
165
166func (b *Buffer) doCallbacks(option string, oldValue any, newValue any) {
167 if b.OptionCallback != nil {

Callers 2

SetCmdMethod · 0.80
SetLocalCmdMethod · 0.80

Calls 2

SetOptionNativeMethod · 0.95
GetNativeValueFunction · 0.92

Tested by

no test coverage detected