1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-07-01 00:35:06 +02:00

Invert default "ensure newline" behaviour so that it is opt-in.

See #47.
This commit is contained in:
Alec Thomas
2017-09-30 14:40:39 +10:00
parent 573c1d157d
commit ce3d6bf527
6 changed files with 7 additions and 6 deletions

View File

@ -300,7 +300,7 @@ func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator,
if options == nil {
options = defaultOptions
}
if !r.config.DontEnsureNL && !strings.HasSuffix(text, "\n") {
if r.config.EnsureNL && !strings.HasSuffix(text, "\n") {
text += "\n"
}
state := &LexerState{