nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit 4a0eaa212db7f0b6ebc226e5695dfc89d706da14
parent 47a582c390e04e721d593594e8717e56828581f2
Author: Samuel Walladge <samuel@swalladge.id.au>
Date:   Mon, 23 Jan 2017 13:48:37 +1030

improve search prompts

make it clearer to see whether searching with regex or default gstyle by
changing the prompt to `(regex) /` or `(regex) ?` when performing regex search

Diffstat:
Msimplenote_cli/sncli.py | 20+++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -806,19 +806,25 @@ def gui_frame_keypress(self, size, key): else: self.view_note.search_direction = 'forward' + options = [ + 'gstyle' if key == self.config.get_keybind('search_gstyle') + or key == self.config.get_keybind('search_prev_gstyle') + else 'regex', + 'backward' if key == self.config.get_keybind('search_prev_gstyle') + or key == self.config.get_keybind('search_prev_regex') + else 'forward' + ] + + caption = '{}{}'.format('(regex) ' if options[0] == 'regex' else '', '/' if options[1] == 'forward' else '?') + self.gui_footer_input_set( urwid.AttrMap( user_input.UserInput( self.config, - key, + caption, '', self.gui_search_input, - [ 'gstyle' if key == self.config.get_keybind('search_gstyle') - or key == self.config.get_keybind('search_prev_gstyle') - else 'regex', - 'backward' if key == self.config.get_keybind('search_prev_gstyle') - or key == self.config.get_keybind('search_prev_regex') - else 'forward' ]), + options), 'user_input_bar')) self.gui_footer_focus_input() self.master_frame.keypress = self.gui_footer_input_get().keypress