SetOption sets a given option to a value just for this buffer
(option, value string)
| 151 | |
| 152 | // SetOption sets a given option to a value just for this buffer |
| 153 | func (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 | |
| 166 | func (b *Buffer) doCallbacks(option string, oldValue any, newValue any) { |
| 167 | if b.OptionCallback != nil { |
no test coverage detected