Skip to content

Commit

Permalink
fix: use a fallback lexer if we can't identify the resource file
Browse files Browse the repository at this point in the history
This can happed, for example, when we find an error in a `.vale` configuration
file since is has no extension.
  • Loading branch information
jdkato committed Nov 16, 2020
1 parent e2f4984 commit f9e2702
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/error.go
Expand Up @@ -124,6 +124,10 @@ func NewE201(msg, value, path string, finder errorCondition) error {
}

lexer := lexers.Match(path)
if lexer == nil {
lexer = lexers.Fallback
}

err = quick.Highlight(
&sb,
string(f),
Expand Down

0 comments on commit f9e2702

Please sign in to comment.