Init initializes the buffer. Called automatically in SetText.
()
| 184 | |
| 185 | // Init initializes the buffer. Called automatically in SetText. |
| 186 | func (tb *Buffer) Init() { |
| 187 | if tb.MarkupDoneFunc != nil { |
| 188 | return |
| 189 | } |
| 190 | tb.MarkupDoneFunc = func() { |
| 191 | tb.signalEditors(bufferMarkupUpdated, nil) |
| 192 | } |
| 193 | tb.ChangedFunc = func() { |
| 194 | tb.notSaved = true |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | // SetText sets the text to the given bytes. |
| 199 | // Pass nil to initialize an empty buffer. |