openFile just loads the given file into the buffer, without doing any markup or signaling. It is typically used in other functions or for temporary buffers.
(filename core.Filename)
| 354 | // any markup or signaling. It is typically used in other functions or |
| 355 | // for temporary buffers. |
| 356 | func (tb *Buffer) openFile(filename core.Filename) error { |
| 357 | txt, err := os.ReadFile(string(filename)) |
| 358 | if err != nil { |
| 359 | return err |
| 360 | } |
| 361 | tb.SetFilename(string(filename)) |
| 362 | tb.SetText(txt) |
| 363 | return nil |
| 364 | } |
| 365 | |
| 366 | // Revert re-opens text from the current file, |
| 367 | // if the filename is set; returns false if not. |
no test coverage detected