class Amun::Windows::EchoArea

a line that is rendered by default at the end on the screen takes the whole width of screen should be linked to *messages* memory buffer and display new messages in the buffer text

Public Class Methods

new(size) click to toggle source
Calls superclass method Amun::Windows::Base::new
# File lib/amun/windows/echo_area.rb, line 11
def initialize(size)
  super(size)
  @last_messages_size = 0
end

Public Instance Methods

render() click to toggle source
# File lib/amun/windows/echo_area.rb, line 16
def render
  curses_window.erase
  curses_window << message
  curses_window.refresh
  update_last_messages_size
end

Private Instance Methods

message() click to toggle source
# File lib/amun/windows/echo_area.rb, line 25
def message
  Buffer.messages[@last_messages_size..-1].strip.lines.last
end
update_last_messages_size() click to toggle source
# File lib/amun/windows/echo_area.rb, line 29
def update_last_messages_size
  @last_messages_size = Buffer.messages.length
end