Sha256: fef8255bce3f52ac7d6c1fcf549b05de2e2b312b9b901dd514fab11b10fdf515

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

#!/usr/bin/env ruby

require "textbringer"

include Textbringer
include Commands

def load_user_config
  config_file = File.expand_path("~/.textbringer.rb")
  begin
    load(config_file)
  rescue LoadError
  end
end

$VERBOSE = nil

Controller.current = Controller.new
begin
  Window.start do
    begin
      Plugin.load_plugins
      load_user_config
      ruby_mode
      if ARGV.size > 0
        ARGV.each do |arg|
          find_file(arg)
        end
      end
      if Buffer.dumped_buffers_exist?(CONFIG[:buffer_dump_dir])
        Window.redisplay
        if yes_or_no?("Dumped buffers found; restore them?")
          buffers = Buffer.load_dumped_buffers(CONFIG[:buffer_dump_dir])
          switch_to_buffer(buffers.last)
        end
      end
    rescue Exception => e
      show_exception(e)
    end
    Window.redisplay
    begin
      trap(:CONT) { Window.redraw }
    rescue ArgumentError
    end
    begin
      loop do
        Controller.current.command_loop(TOP_LEVEL_TAG)
        Window.redisplay
      end
    rescue Exception => e
      if !e.is_a?(SystemExit)
        Buffer.dump_unsaved_buffers(CONFIG[:buffer_dump_dir])
      end
      raise
    end
  end
ensure
  Controller.current.close
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
textbringer-0.3.2 exe/textbringer
textbringer-0.3.1 exe/textbringer
textbringer-0.3.0 exe/textbringer
textbringer-0.2.9 exe/textbringer
textbringer-0.2.8 exe/textbringer
textbringer-0.2.7 exe/textbringer
textbringer-0.2.6 exe/textbringer
textbringer-0.2.4 exe/textbringer
textbringer-0.2.5 exe/textbringer
textbringer-0.2.3 exe/textbringer
textbringer-0.2.2 exe/textbringer