From b4934e4221ce6cf72bb8375b8a117caada47f938 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 19 Jan 2010 19:10:32 +0100 Subject: settings: allow to toggle flushinput --- TODO | 2 +- ranger/defaults/keys.py | 3 ++- ranger/defaults/options.py | 1 + ranger/gui/ui.py | 3 ++- ranger/shared/settings.py | 2 +- 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() -- cgit 1.4.1-2-gfad0