summary refs log tree commit diff stats
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
parent9c2bd85db83c302d03d24045236d0613522be563 (diff)
downloadranger-b4934e4221ce6cf72bb8375b8a117caada47f938.tar.gz
settings: allow to toggle flushinput
-rw-r--r--TODO2
-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
5 files changed, 7 insertions, 4 deletions
diff --git a/TODO b/TODO
index bef08455..f41108be 100644
--- a/TODO
+++ b/TODO
@@ -30,7 +30,7 @@ General
    ( ) #36  10/01/11  help coloring is terribly inefficient
    ( ) #37  10/01/13  better tab completion for OpenConsole
    ( ) #38  10/01/16  searching in pager
-   ( ) #39  10/01/17  flushinput not always good
+   (X) #39  10/01/17  flushinput not always good
    (X) #42  10/01/17  memorize directory for `` when using :cd
    (X) #43  10/01/18  internally treat the bookmarks ` and ' the same
    ( ) #44  10/01/18  more error messages :P
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()
5' href='#n295'>295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352