class Object

Public Instance Methods

find_file(*) click to toggle source
# File lib/amun/features/files.rb, line 5
def find_file(*)
  Amun::Windows::MiniBufferWindow.new('Open file: ', Dir.pwd) do |window|
    file_path = window.buffer.to_s

    file_buffer = Amun::Buffer.new(file_path, File.open(file_path, 'r+'))
    Amun::Buffer.instances << file_buffer
    Amun::Buffer.current = file_buffer
  end.attach(Amun::Application.frame)

  true
end
kill_amun(*) click to toggle source
# File lib/amun/features/quit.rb, line 3
def kill_amun(*)
  exit 0
end
log(event) click to toggle source
# File lib/amun/features/echo_event.rb, line 4
def log(event)
  # log valid strings only no control characters
  event = event.encode!('UTF-8', 'UTF-8', invalid: :replace)
  Amun::Buffer.messages << "#{event}\n"
end