Permalink
Browse files

Merge branch 'themaset/screen'

* themaset/screen:
  Avoid repeated evaluations of "term"
  doc: add Nadav Samet to AUTHORS section
  Add screen as a possible client
  • Loading branch information...
wincent committed Mar 25, 2012
2 parents 6bf694e + d583f06 commit 15a66cc9e09bd2d9dc61e27559a2e6d79564f75c
Showing with 6 additions and 7 deletions.
  1. +1 −0 doc/command-t.txt
  2. +5 −7 ruby/command-t/controller.rb
View
@@ -613,6 +613,7 @@ order):
Matthew Todd Victor Hugo Borja
Mike Lundy Woody Peterson
Nate Kane Zak Johnson
+ Nadav Samet
As this was the first Vim plug-in I had ever written I was heavily influenced
by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
@@ -264,12 +264,8 @@ def map key, function, param = nil
":call CommandT#{function}(#{param})<CR>"
end
- def xterm?
- !!(::VIM::evaluate('&term') =~ /\Axterm/)
- end
-
- def vt100?
- !!(::VIM::evaluate('&term') =~ /\Avt100/)
+ def term
+ @term ||= ::VIM::evaluate('&term')
end
def register_for_key_presses
@@ -304,7 +300,9 @@ def register_for_key_presses
end
else
[value].flatten.each do |mapping|
- map mapping, key unless mapping == '<Esc>' && (xterm? || vt100?)
+ unless mapping == '<Esc>' && term =~ /\A(screen|xterm|vt100)/
+ map mapping, key
+ end
end
end
end

0 comments on commit 15a66cc

Please sign in to comment.