Small fixes

This commit is contained in:
Zachary Yedidia
2019-06-15 22:23:19 -04:00
parent 0f4f60c018
commit 7cd5024e34
3 changed files with 7 additions and 5 deletions

View File

@@ -134,8 +134,8 @@ func NewBufferFromFile(path string, btype BufType) (*Buffer, error) {
defer file.Close()
cursorLoc, err := ParseCursorLocation(cursorPos)
if err != nil {
cursorLoc, cursorerr := ParseCursorLocation(cursorPos)
if cursorerr != nil {
cursorLoc = Loc{-1, -1}
}
@@ -449,7 +449,7 @@ func (b *Buffer) UpdateRules() {
}
ft := b.Settings["filetype"].(string)
if (ft == "Unknown" || ft == "") && !rehighlight {
if (ft == "unknown" || ft == "") && !rehighlight {
if highlight.MatchFiletype(ftdetect, b.Path, b.lines[0].data) {
header := new(highlight.Header)
header.FileType = file.FileType