lib/sup/modes/log-mode.rb in sup-0.0.6 vs lib/sup/modes/log-mode.rb in sup-0.0.7

- old
+ new

@@ -1,10 +1,11 @@ module Redwood class LogMode < TextMode register_keymap do |k| k.add :toggle_follow, "Toggle follow mode", 'f' + k.add :save_to_disk, "Save log to disk", 's' end def initialize @follow = true super @@ -32,9 +33,14 @@ super if buffer && @follow follow_top = lines - buffer.content_height + 1 jump_to_line follow_top if topline < follow_top end + end + + def save_to_disk + fn = BufferManager.ask :filename, "Save log to file: " + save_to_file(fn) { |f| f.puts text } if fn end def status super + " (follow: #@follow)" end