plugin/codetool.rb in livetext-0.9.38 vs plugin/codetool.rb in livetext-0.9.39
- old
+ new
@@ -81,15 +81,17 @@
result = "<!-- colorized code -->\n" + text2
result
end
def fragment(args = nil, body = nil)
+ $code_lines ||= 0 # FIXME later
lang = api.args.empty? ? :elixir : api.args.first.to_sym # ruby or elixir
api.args = []
lines = api.body(true) # .to_a # raw
+ $code_lines += lines.size
result = send("format_#{lang}", lines)
api.out result
- api.out "\n"
+ api.out "<br>\n"
api.optional_blank_line
rescue => err
STDERR.puts "fragment Error: #{__method__} err = #{err}\n#{err.backtrace.join("\n")}"
end