about summary refs log tree commit diff stats
path: root/code/keys.rb
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-06 18:04:36 +0200
committerhut <hut@lavabit.com>2009-07-06 18:04:36 +0200
commit89857c607556bb95538096ea64bbbad1ab8d4085 (patch)
tree239c219d482616988f7657cb3a5f6a744603e45b /code/keys.rb
parenta96af8f0ff240db4e6a9c494e9de9290d885b9aa (diff)
downloadranger-89857c607556bb95538096ea64bbbad1ab8d4085.tar.gz
use Fm.externally instead of starti/closei in keys.rb
Diffstat (limited to 'code/keys.rb')
-rw-r--r--code/keys.rb33
1 files changed, 16 insertions, 17 deletions
diff --git a/code/keys.rb b/code/keys.rb
index ce23e8a9..1026017b 100644
--- a/code/keys.rb
+++ b/code/keys.rb
@@ -324,7 +324,8 @@ module Fm
 			if str =~ /^\s?(.*)(L|;|<cr>|<esc>)$/
 				@buffer = ''
 				@search_string = $1
-				press('l') if $2 == ';' or $2 == 'L'
+
+				press 'l' if $2 == ';' or $2 == 'L'
 			else
 				search(str)
 			end
@@ -334,31 +335,30 @@ module Fm
 		## Launching applications {{{
 
 		when 's'
-			closei
-			system('clear')
 			ls = ['ls']
 			ls << '--color=auto' #if Option.color
 			ls << '--group-directories-first' #if Option.color
-			system(*ls)
-			system('bash')
-			@pwd.schedule
-			starti
+
+			externally do
+				system("clear; #{ls * ' '}; bash")
+				@pwd.schedule
+			end
 
 		when 'tar'
-			closei
-			system('tar', 'cvvf', 'pack.tar', *selection.map{|x| x.basename})
-			@pwd.refresh!
-			starti
+			externally do
+				system('tar', 'cvvf', 'pack.tar', *selection.map{|x| x.basename})
+				@pwd.refresh!
+			end
 			
 		when /^!(.+)$/
 			str = $1
 			if str =~ /^(\!?)(.*)(<cr>|<esc>)$/
 				@buffer = ''
 				if $3 == '<cr>'
-					closei
-					system("bash", "-c", $2)
-					Action.wait_for_enter unless $1.empty?
-					starti
+					externally do
+						system("bash", "-c", $2)
+						Action.wait_for_enter unless $1.empty?
+					end
 					@pwd.schedule
 				end
 			end
@@ -390,8 +390,7 @@ module Fm
 			@bars.last.kill unless @bars.empty?
 
 		when '<redraw>'
-			closei
-			starti
+			externally
 
 		when 'R'
 			@pwd.refresh!