Class: VimMate::App

Inherits:
ActiveWindow::Application show all
Defined in:
lib/vim_mate/app.rb

Instance Attribute Summary

Attributes inherited from ActiveWindow::Application

#builder, #controller, #database, #window

Instance Method Summary collapse

Methods inherited from ActiveWindow::Application

#default_database, #dispatch, #save_default_database, #setup, #start, #widget, widget

Constructor Details

#initialize(opts = {}) ⇒ App

Returns a new instance of App.



3
4
5
6
# File 'lib/vim_mate/app.rb', line 3

def initialize(opts={})
  @excludes = opts.delete(:excludes)
  super
end

Instance Method Details

#add_path(path) ⇒ Object



26
27
28
29
30
# File 'lib/vim_mate/app.rb', line 26

def add_path(path)
  file_tree.initial_adding do
    file_tree.add_path(path)
  end
end

#file_treeObject



7
8
9
# File 'lib/vim_mate/app.rb', line 7

def file_tree
  files.file_tree
end

#filesObject



10
11
12
# File 'lib/vim_mate/app.rb', line 10

def files
  controller[:file_filter]
end

#post_setupObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/vim_mate/app.rb', line 32

def post_setup
  super

  @excludes.each do |rule|
    file_tree.exclude! rule
  end unless @excludes.blank?

  # If there are no files given, open an empty window
  # If files are specified on the command line, use them
  ARGV.each do |file|
    path = File.expand_path(file)
    add_path(path)
    #window.vim.open(path, :tab)
  end
end

#runObject



48
49
50
51
52
53
54
# File 'lib/vim_mate/app.rb', line 48

def run
  GLib::Timeout.add(23) do
    vim.start
    false
  end
  super
end

#vimObject



13
14
15
# File 'lib/vim_mate/app.rb', line 13

def vim
  controller[:vim].vim
end