When a text-mode is spawned to view an attachment, pass in the atachment
filename, so that saving the buffer provies the filename as a default
value.
k.add :pipe, "Pipe to process", '|'
end
- def initialize text=""
+ def initialize text="", filename=nil
@text = text
+ @filename = filename
update_lines
buffer.mark_dirty if buffer
super()
end
def save_to_disk
- fn = BufferManager.ask_for_filename :filename, "Save to file: "
+ fn = BufferManager.ask_for_filename :filename, "Save to file: ", @filename
save_to_file(fn) { |f| f.puts text } if fn
end
BufferManager.erase_flash
BufferManager.completely_redraw_screen
unless success
- BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s)
+ BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s, chunk.filename)
BufferManager.flash "Couldn't execute view command, viewing as text."
end
end