lib/gm/notepad/input_handlers/comment_handler.rb in gm-notepad-0.0.10 vs lib/gm/notepad/input_handlers/comment_handler.rb in gm-notepad-0.0.11
- old
+ new
@@ -4,21 +4,19 @@
module InputHandlers
class CommentHandler < DefaultHandler
COMMENT_PREFIX = '#'.freeze
def self.handles?(input:)
- return false unless input[0] == COMMENT_PREFIX
+ return false unless input.match(/^#/)
true
end
def after_initialize!
- self.to_interactive = true
- self.to_output = false
- self.expand_line = false
- end
-
- def lines
- [input]
+ input.render_current_text(
+ to_interactive: true,
+ to_output: false,
+ expand_line: false
+ )
end
end
end
end
end