about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-19 19:10:32 +0100
committerhut <hut@lavabit.com>2010-01-19 19:10:32 +0100
commitb4934e4221ce6cf72bb8375b8a117caada47f938 (patch)
tree1ce2a3ca7da75bbc3a1d90ce1d7c53b1e1468dc9 /ranger
parent9c2bd85db83c302d03d24045236d0613522be563 (diff)
downloadranger-b4934e4221ce6cf72bb8375b8a117caada47f938.tar.gz
settings: allow to toggle flushinput
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/keys.py3
-rw-r--r--ranger/defaults/options.py1
-rw-r--r--ranger/gui/ui.py3
-rw-r--r--ranger/shared/settings.py2
4 files changed, 6 insertions, 3 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index b11cd85a..194f7746 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -103,9 +103,10 @@ def initialize_commands(command_list):
 
 	# -------------------------------------------------- toggle options
 	hint('t', "show_//h//idden //p//review_files //d//irectories_first " \
-			"//c//ollapse_preview")
+			"//c//ollapse_preview flush//i//nput")
 	bind('th', fm.toggle_boolean_option('show_hidden'))
 	bind('tp', fm.toggle_boolean_option('preview_files'))
+	bind('ti', fm.toggle_boolean_option('flushinput'))
 	bind('td', fm.toggle_boolean_option('directories_first'))
 	bind('tc', fm.toggle_boolean_option('collapse_preview'))
 
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index 236f57a8..254230a4 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -22,6 +22,7 @@ max_history_size = 20
 scroll_offset = 2
 max_dirsize_for_autopreview = None
 preview_files = False
+flushinput = True
 
 sort = 'basename'
 reverse = False
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index c7c4a14b..32ba114e 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -148,7 +148,8 @@ class UI(DisplayableContainer):
 		"""Waits for key input and returns the pressed key"""
 		key = self.win.getch()
 		if key is not -1:
-			curses.flushinp()
+			if self.settings.flushinput:
+				curses.flushinp()
 		return key
 
 	def setup(self):
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py
index 552154cd..ac024494 100644
--- a/ranger/shared/settings.py
+++ b/ranger/shared/settings.py
@@ -17,7 +17,7 @@ show_hidden scroll_offset
 directories_first sort reverse
 preview_files max_history_size colorscheme
 collapse_preview
-hidden_filter
+hidden_filter flushinput
 max_dirsize_for_autopreview autosave_bookmarks
 apps keys
 """.split()