about summary refs log tree commit diff stats
path: root/code
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-06 17:45:06 +0200
committerhut <hut@lavabit.com>2009-07-06 17:45:06 +0200
commitf037fa4ba89527eff741b3889b70ecb84b0b83f0 (patch)
tree9977320279712da5b73b3638066fa1ebd751d763 /code
parent4ed0c6e8cd44b32e7bbe4935dd20fc7554166fac (diff)
downloadranger-f037fa4ba89527eff741b3889b70ecb84b0b83f0.tar.gz
Fm.externally(&block) for wrapping code in closei/starti
Diffstat (limited to 'code')
-rw-r--r--code/fm.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/code/fm.rb b/code/fm.rb
index 6db5a85e..cb7dacb6 100644
--- a/code/fm.rb
+++ b/code/fm.rb
@@ -113,6 +113,14 @@ module Fm
 		CLI::lines - @bars.size
 	end
 
+	def externally(&block)
+		return unless block_given?
+
+		closei
+		yield
+		starti
+	end
+
 	def dump
 		if defined? @dump_config_on_exit
 			begin
'>125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151