SetFileExt sets syntax highlighting and other parameters based on the given file extension (without the . prefix), for cases where an actual file with fileinfo.FileInfo is not available.
(ext string)
| 170 | // for cases where an actual file with fileinfo.FileInfo is not |
| 171 | // available. |
| 172 | func (ls *Lines) SetFileExt(ext string) { |
| 173 | if len(ext) == 0 { |
| 174 | return |
| 175 | } |
| 176 | if ext[0] == '.' { |
| 177 | ext = ext[1:] |
| 178 | } |
| 179 | fn := "_fake." + strings.ToLower(ext) |
| 180 | fi, _ := fileinfo.NewFileInfo(fn) |
| 181 | ls.SetFileInfo(fi) |
| 182 | } |
| 183 | |
| 184 | // SetHighlighting sets the highlighting style. |
| 185 | func (ls *Lines) SetHighlighting(style core.HighlightingName) { |
nothing calls this directly
no test coverage detected