summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/diff.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-05-05 13:01:39 +0000
committermurphy <murphy@rubychan.de>2010-05-05 13:01:39 +0000
commita97d39b3ca84484e45f3ff44a1ace6bdfb337c4c (patch)
treec5069e0635b438fb8da30852afa550f22c7c3758 /lib/coderay/scanners/diff.rb
parent31c6ffdffd1124e8235396d38aba99fdce77905a (diff)
downloadcoderay-a97d39b3ca84484e45f3ff44a1ace6bdfb337c4c.tar.gz
Fixed bug in diff scanner.
Diffstat (limited to 'lib/coderay/scanners/diff.rb')
-rw-r--r--lib/coderay/scanners/diff.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/coderay/scanners/diff.rb b/lib/coderay/scanners/diff.rb
index 417985a..050ffb1 100644
--- a/lib/coderay/scanners/diff.rb
+++ b/lib/coderay/scanners/diff.rb
@@ -70,22 +70,22 @@ module Scanners
encoder.text_token match[-2,2], :change
encoder.end_group :change unless line_kind
next unless match = scan(/.+/)
- CodeRay.scan match, content_lang, :tokens => encoder
+ CodeRay.scan match, content_lang, :tokens => encoder, :keep_tokens => true
next
elsif match = scan(/\+/)
encoder.begin_line line_kind = :insert
encoder.text_token match, :insert
next unless match = scan(/.+/)
- CodeRay.scan match, content_lang, :tokens => encoder
+ CodeRay.scan match, content_lang, :tokens => encoder, :keep_tokens => true
next
elsif match = scan(/-/)
encoder.begin_line line_kind = :delete
encoder.text_token match, :delete
next unless match = scan(/.+/)
- CodeRay.scan match, content_lang, :tokens => encoder
+ CodeRay.scan match, content_lang, :tokens => encoder, :keep_tokens => true
next
elsif match = scan(/ .*/)
- CodeRay.scan match, content_lang, :tokens => encoder
+ CodeRay.scan match, content_lang, :tokens => encoder, :keep_tokens => true
next
elsif match = scan(/.+/)
encoder.begin_line line_kind = :comment