From d40f38551769b1673f34ffd12c051a95f77d8795 Mon Sep 17 00:00:00 2001 From: Andrey Kvichanskiy Date: Thu, 14 Jan 2016 18:06:32 +0300 Subject: [PATCH] ver-0.9.4 --- cd_ext.py | 47 ++++++++++++++++++++++++++++++---------------- install.inf | 6 ++++++ readme/history.txt | 4 ++++ 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/cd_ext.py b/cd_ext.py index 00cfe73..463261b 100644 --- a/cd_ext.py +++ b/cd_ext.py @@ -2,7 +2,7 @@ Authors: Andrey Kvichansky (kvichans on github.com) Version: - '0.9.3 2016-01-12' + '0.9.4 2016-01-14' ToDo: (see end of file) ''' @@ -13,12 +13,16 @@ import cudax_lib as apx from cudax_lib import log +FROM_API_VERSION= '1.0.119' + # Localization -ONLY_SINGLE_CRT = "{} doesn't work with multi-carets" -ONLY_FOR_NO_SEL = "{} works when no selection" -NO_PAIR_BRACKET = "Cannot find matching bracket for '{}'" -FIND_FAIL_FOR_STR = "Cannot find: {}" -NO_FILE_FOR_OPEN = "Cannot open: {}" +ONLY_SINGLE_CRT = "{} doesn't work with multi-carets" +ONLY_FOR_NO_SEL = "{} works when no selection" +NO_PAIR_BRACKET = "Cannot find matching bracket for '{}'" +FIND_FAIL_FOR_STR = "Cannot find: {}" +NO_FILE_FOR_OPEN = "Cannot open: {}" +NEED_UPDATE = "Need update CudaText" +EMPTY_CLIP = "Empty value in clipboard" pass; # Logging pass; #from pprint import pformat @@ -239,36 +243,47 @@ def paste_to_1st_col(self): # pass; #LOG and log('tru',) # return True # #def _find_cb_string_included_mlines - def find_cb_string_next(self): - self.find_cb_by_cmd('dn') - #self.find_cb_string('dn') - def find_cb_string_prev(self): - self.find_cb_by_cmd('up') - #self.find_cb_string('up') - def find_cb_by_cmd(self, updn): + def find_cb_string_next(self): self._find_cb_by_cmd('dn') + def find_cb_string_prev(self): self._find_cb_by_cmd('up') + def _find_cb_by_cmd(self, updn): + if app.app_api_version()1: return app.msg_status(ONLY_SINGLE_CRT.format('Command')) seltext = ed.get_text_sel() if not seltext: return clip = app.app_proc(app.PROC_GET_CLIP, '') + user_opt= app.app_proc(app.PROC_GET_FIND_OPTIONS, '') + # c - Case, r - RegEx, w - Word, f - From-caret, a - Wrapp, b - Back + find_opt= 'a' + find_opt= find_opt + ('c' if 'c' in user_opt else '') # As user: Case + find_opt= find_opt + ('w' if 'w' in user_opt else '') # As user: Case ed.cmd(cmds.cmd_FinderAction, chr(1).join([] +['repall'] +[seltext] +[clip] - +['a'] # a - wrapped + +[find_opt] # a - wrapped )) + app.app_proc(app.PROC_SET_FIND_OPTIONS, user_opt) #def replace_all_sel_to_cb def open_selected(self): diff --git a/install.inf b/install.inf index 91fa077..c0d773f 100644 --- a/install.inf +++ b/install.inf @@ -38,6 +38,12 @@ caption=Find clipboard string: prev method=find_cb_string_prev menu=0 +[item101] +section=commands +caption=Replace all fragment as selected with clipboard value +method=replace_all_sel_to_cb +menu=0 + [item7] section=commands caption=Open file by selected name diff --git a/readme/history.txt b/readme/history.txt index 601579a..0442635 100644 --- a/readme/history.txt +++ b/readme/history.txt @@ -1,4 +1,8 @@ +0.9.4 (2016-01-14) +added: Replace all as selection to clip +rework: Finding clip saves user settings + 0.9.2 (2016-01-11) added: Move splitters