Skip to content

Commit b256ecf

Browse files
committed
diff scanner: highlight "\ No newline" as :comment
1 parent b91d633 commit b256ecf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/coderay/scanners/diff.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ def scan_tokens encoder, options
6969
next unless match = scan(/.+/)
7070
encoder.text_token match, :plain
7171
state = :added
72-
elsif match = scan(/\\ /)
73-
encoder.begin_line line_kind = :change
74-
encoder.text_token match, :change
75-
next unless match = scan(/.+/)
76-
encoder.text_token match, :plain
72+
elsif match = scan(/\\ .*/)
73+
encoder.text_token match, :comment
7774
elsif match = scan(/@@(?>[^@\n]*)@@/)
7875
content_scanner.state = :initial unless match?(/\n\+/)
7976
content_scanner_entry_state = nil

0 commit comments

Comments
 (0)