summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/coderay/encoders/debug.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/coderay/encoders/debug.rb b/lib/coderay/encoders/debug.rb
index f4db330..6b680fc 100644
--- a/lib/coderay/encoders/debug.rb
+++ b/lib/coderay/encoders/debug.rb
@@ -15,9 +15,12 @@ module Encoders
register_for :debug
+ attr_reader :size
+
FILE_EXTENSION = 'raydebug'
def text_token text, kind
+ @size += 1
if kind == :space
@out << text
else
@@ -43,6 +46,13 @@ module Encoders
@out << ']'
end
+ protected
+
+ def setup options
+ super
+ @size = 0
+ end
+
end
end