Skip to content

Commit ff966c0

Browse files
committed
minor fix in diff scanner, .tmproj filetype: 1.0.3
1 parent effc7e9 commit ff966c0

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

Changes.textile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release
44

55
{{toc}}
66

7+
h2. Changes in 1.0.3
8+
9+
New:
10+
11+
* .tmproj files are recognized as XML.
12+
13+
Fixes:
14+
15+
* Removed files are highlighted inside diffs generated by git.
16+
717
h2. Changes in 1.0.2
818

919
Fixes:

lib/coderay/helpers/file_type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def shebang filename
119119
# 'sch' => :scheme,
120120
'sql' => :sql,
121121
# 'ss' => :scheme,
122+
'tmproj' => :xml,
122123
'xhtml' => :page,
123124
'xml' => :xml,
124125
'yaml' => :yaml,

lib/coderay/scanners/diff.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def scan_tokens encoder, options
4949
encoder.text_token match, :head
5050
if match = scan(/.*?(?=$|[\t\n\x00]| \(revision)/)
5151
encoder.text_token match, :filename
52-
if options[:highlight_code]
52+
if options[:highlight_code] && match != '/dev/null'
5353
file_type = FileType.fetch(match, :text)
5454
file_type = :text if file_type == :diff
5555
content_scanner = scanners[file_type]

lib/coderay/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module CodeRay
2-
VERSION = '1.0.2'
2+
VERSION = '1.0.3'
33
end

0 commit comments

Comments
 (0)