SetFilename sets the filename associated with the buffer and updates the code highlighting information accordingly.
(fn string)
| 250 | // SetFilename sets the filename associated with the buffer and updates |
| 251 | // the code highlighting information accordingly. |
| 252 | func (tb *Buffer) SetFilename(fn string) *Buffer { |
| 253 | tb.Filename = core.Filename(fn) |
| 254 | tb.Stat() |
| 255 | tb.SetFileInfo(&tb.Info) |
| 256 | return tb |
| 257 | } |
| 258 | |
| 259 | // Stat gets info about the file, including the highlighting language. |
| 260 | func (tb *Buffer) Stat() error { |
no test coverage detected