Sha256: d5b54f592fafe7e917f19a83b987d6cd3c9ed33464c1d4645b3c70271983ee09
Contents?: true
Size: 1.45 KB
Versions: 1
Compression:
Stored size: 1.45 KB
Contents
#!/usr/bin/env ruby require "warning" Warning.ignore(/already initialized constant /) Warning.ignore(/previous definition of /) require "textbringer" include Textbringer include Commands def load_user_config(path) config_file = File.expand_path(path) begin load(config_file) rescue LoadError end end unless STDIN.tty? STDERR.puts("txtb: standard input is not a tty") exit 1 end Controller.current = Controller.new begin Window.start do $stdout = DefaultOutput.new begin load_user_config("~/.textbringer/init.rb") Plugin.load_plugins load_user_config("~/.textbringer.rb") 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
textbringer-1.3.0 | exe/txtb |