lib/snibbets.rb in snibbets-2.0.31 vs lib/snibbets.rb in snibbets-2.0.32
- old
+ new
@@ -284,10 +284,11 @@
puts '-' * header.length
puts ''
end
code = snip['code']
lang = snip['language']
+
print(code, filepath, lang)
end
end
elsif snippets.length > 1
if Snibbets.options[:all]
@@ -347,17 +348,17 @@
end
end
end
def print(output, filepath, syntax = nil)
+ if Snibbets.options[:copy]
+ OS.copy(Snibbets.options[:all_notes] ? output : output.clean_code)
+ warn 'Copied to clipboard'
+ end
if Snibbets.options[:highlight] && Snibbets.options[:output] == 'raw'
$stdout.puts(Highlight.highlight(output, filepath, syntax))
else
$stdout.puts(Snibbets.options[:all_notes] ? output : output.clean_code)
- end
- if Snibbets.options[:copy]
- OS.copy(output)
- $stderr.puts "Copied to clipboard"
end
end
end
end