about summary refs log tree commit diff stats
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
parent4ed0c6e8cd44b32e7bbe4935dd20fc7554166fac (diff)
downloadranger-f037fa4ba89527eff741b3889b70ecb84b0b83f0.tar.gz
Fm.externally(&block) for wrapping code in closei/starti
-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