SetFileInfo sets the syntax highlighting and other parameters based on the type of file specified by given fileinfo.FileInfo.
(info *fileinfo.FileInfo)
| 147 | // SetFileInfo sets the syntax highlighting and other parameters |
| 148 | // based on the type of file specified by given fileinfo.FileInfo. |
| 149 | func (ls *Lines) SetFileInfo(info *fileinfo.FileInfo) { |
| 150 | ls.Lock() |
| 151 | defer ls.Unlock() |
| 152 | |
| 153 | ls.ParseState.SetSrc(string(info.Path), "", info.Known) |
| 154 | ls.Highlighter.Init(info, &ls.ParseState) |
| 155 | ls.Options.ConfigKnown(info.Known) |
| 156 | if ls.numLines() > 0 { |
| 157 | ls.initialMarkup() |
| 158 | ls.startDelayedReMarkup() |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | // SetFileType sets the syntax highlighting and other parameters |
| 163 | // based on the given fileinfo.Known file type |
no test coverage detected