示例#1
0
def do_load_ops():
  global MIN_LEN              
  global SEL_ALLOW            
  global SEL_ALLOW_WHITE_SPACE
  global SEL_CASE_SENSITIVE   
  global SEL_WORDS_ONLY       
  global SEL_WHOLE_WORDS      
  global CARET_ALLOW          
  global CARET_CASE_SENSITIVE 
  global CARET_WHOLE_WORDS    
  global COLOR_FONT_OTHER     
  global COLOR_BG_OTHER       
  global COLOR_FONT_CURRENT   
  global COLOR_BG_CURRENT     

  MIN_LEN               = int(app.ini_read(fn_ini, 'op', 'min_len', '1'))
  
  SEL_ALLOW             = app.ini_read(fn_ini, 'op', 'sel_allow', '1')=='1'
  SEL_ALLOW_WHITE_SPACE = app.ini_read(fn_ini, 'op', 'sel_allow_white_space', '0')=='1'
  SEL_CASE_SENSITIVE    = app.ini_read(fn_ini, 'op', 'sel_case_sensitive', '0')=='1'
  SEL_WORDS_ONLY        = app.ini_read(fn_ini, 'op', 'sel_words_only', '0')=='1'
  SEL_WHOLE_WORDS       = app.ini_read(fn_ini, 'op', 'sel_whole_words', '0')=='1'
  
  CARET_ALLOW           = app.ini_read(fn_ini, 'op', 'caret_allow', '1')=='1'
  CARET_CASE_SENSITIVE  = app.ini_read(fn_ini, 'op', 'caret_case_sensitive', '1')=='1'
  CARET_WHOLE_WORDS     = app.ini_read(fn_ini, 'op', 'caret_whole_words', '1')=='1'
  
  COLOR_FONT_OTHER      = apx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'font_other', int_to_html(0x000000)))
  COLOR_BG_OTHER        = apx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'bg_other', int_to_html(0x80ffff)))
  COLOR_FONT_CURRENT    = apx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'font_current', int_to_html(0x000000)))
  COLOR_BG_CURRENT      = apx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'bg_current', int_to_html(0xe3c1e3)))
示例#2
0
def do_color(ed, n):

    color = COLOR_NONE
    color_border = COLOR_NONE
    bold = 0
    italic = 0
    strikeout = 0
    border = 0

    st = ini_read(ini, 'colors', str(n), '')
    if st:
        color = html_color_to_int(st)

    st = ini_read(ini, 'border_colors', str(n), '')
    if st:
        color_border = html_color_to_int(st)

    st = ini_read(ini, 'styles', str(n), '')
    if st:
        if 'b' in st: bold = 1
        if 'i' in st: italic = 1
        if 'u' in st: border = 1
        if 's' in st: strikeout = 1

    set_text_attribute(
        ed,
        [TAG_UNIQ + n, color, bold, italic, strikeout, border, color_border])
示例#3
0
    def update_colors(self):
        global PALETTE
        global COLOR_COMMA

        if option_use_theme_colors:
            COLOR_COMMA = _theme_item("Symbol")
            PALETTE = [_theme_item(s) for s in option_colors_themed.split(",")]
            return True
        else:
            COLOR_COMMA = html_color_to_int(option_color_comma)
            PALETTE = [html_color_to_int(s) for s in option_colors_fixed.split(",")]
            return False
示例#4
0
    def __init__(self):

        global CODE_TABLE
        CODE_TABLE = ini_read(fn_config, 'op', 'encoding', CODE_TABLE)

        self.shell_path = ini_read(fn_config, 'op', 'shell_path', DEF_SHELL)
        self.add_prompt = str_to_bool(ini_read(fn_config, 'op', 'add_prompt', bool_to_str(DEF_ADD_PROMPT)))
        self.font_size = int(ini_read(fn_config, 'op', 'font_size', '9'))
        self.color_back = html_color_to_int(ini_read(fn_config, 'color', 'back', '#555'))
        self.color_font = html_color_to_int(ini_read(fn_config, 'color', 'font', '#eee'))
        self.history = []
        self.h_menu = menu_proc(0, MENU_CREATE)

        self.menu_calls = []
        self.menu_calls += [ lambda: self.run_cmd_n(0) ]
        self.menu_calls += [ lambda: self.run_cmd_n(1) ]
        self.menu_calls += [ lambda: self.run_cmd_n(2) ]
        self.menu_calls += [ lambda: self.run_cmd_n(3) ]
        self.menu_calls += [ lambda: self.run_cmd_n(4) ]
        self.menu_calls += [ lambda: self.run_cmd_n(5) ]
        self.menu_calls += [ lambda: self.run_cmd_n(6) ]
        self.menu_calls += [ lambda: self.run_cmd_n(7) ]
        self.menu_calls += [ lambda: self.run_cmd_n(8) ]
        self.menu_calls += [ lambda: self.run_cmd_n(9) ]
        self.menu_calls += [ lambda: self.run_cmd_n(10) ]
        self.menu_calls += [ lambda: self.run_cmd_n(11) ]
        self.menu_calls += [ lambda: self.run_cmd_n(12) ]
        self.menu_calls += [ lambda: self.run_cmd_n(13) ]
        self.menu_calls += [ lambda: self.run_cmd_n(14) ]
        self.menu_calls += [ lambda: self.run_cmd_n(15) ]
        self.menu_calls += [ lambda: self.run_cmd_n(16) ]
        self.menu_calls += [ lambda: self.run_cmd_n(17) ]
        self.menu_calls += [ lambda: self.run_cmd_n(18) ]
        self.menu_calls += [ lambda: self.run_cmd_n(19) ]
        self.menu_calls += [ lambda: self.run_cmd_n(20) ]
        self.menu_calls += [ lambda: self.run_cmd_n(21) ]

        self.title = 'Terminal'
        self.h_dlg = self.init_form()
        app_proc(PROC_BOTTOMPANEL_ADD_DIALOG, (self.title, self.h_dlg, fn_icon))
        self.p = None
        self.block = Lock()
        self.block.acquire()
        self.btext = b''
        timer_proc(TIMER_START, self.timer_update, 200, tag='')
def do_load_ops():
  opt.MIN_LEN               = int(app.ini_read(fn_ini, 'op', 'min_len', '2'))
  opt.MAX_LINES             = int(app.ini_read(fn_ini, 'op', 'max_lines', '5000'))
  opt.USE_NEAREST_LINE_COUNT = int(app.ini_read(fn_ini, 'op', 'use_nearest_line_count', '10000'))

  opt.SEL_ALLOW             = str_to_bool(app.ini_read(fn_ini, 'op', 'sel_allow', '1'))
  opt.SEL_ALLOW_WHITE_SPACE = str_to_bool(app.ini_read(fn_ini, 'op', 'sel_allow_white_space', '0'))
  opt.SEL_CASE_SENSITIVE    = str_to_bool(app.ini_read(fn_ini, 'op', 'sel_case_sensitive', '0'))
  opt.SEL_WORDS_ONLY        = str_to_bool(app.ini_read(fn_ini, 'op', 'sel_words_only', '0'))
  opt.SEL_WHOLE_WORDS       = str_to_bool(app.ini_read(fn_ini, 'op', 'sel_whole_words', '0'))

  opt.CARET_ALLOW           = str_to_bool(app.ini_read(fn_ini, 'op', 'caret_allow', '1'))
  opt.CARET_CASE_SENSITIVE  = str_to_bool(app.ini_read(fn_ini, 'op', 'caret_case_sensitive', '1'))
  opt.CARET_WHOLE_WORDS     = str_to_bool(app.ini_read(fn_ini, 'op', 'caret_whole_words', '1'))

  opt.COLOR_FONT_OTHER      = appx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'font_other', '#000'))
  opt.COLOR_BG_OTHER        = appx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'bg_other', '#ff0'))
  opt.COLOR_FONT_CURRENT    = appx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'font_current', '#000'))
  opt.COLOR_BG_CURRENT      = appx.html_color_to_int(app.ini_read(fn_ini, 'colors', 'bg_current', '#e4c0e4'))
def color_tab(ed_self):
    filename = ed_self.get_filename()
    lexer = ed_self.get_prop(PROP_LEXER_FILE)
    val = None

    global colormap
    for key in colormap:
        if key[0] == '.':
            if filename.endswith(key):
                val = colormap[key]
                break
        elif key.lower() == lexer.lower():
            val = colormap[key]
            break

    if val is not None:
        try:
            n = html_color_to_int(val)
            ed_self.set_prop(PROP_TAB_COLOR, n)
        except:
            print('NOTE: Tab Colors: bad color string in config "%s"' % val)
            pass
示例#7
0
    def do_setv(self, aid, ag, data):
        M,m = self.__class__,self
        pass;                  #LOG and log('aid,m.cur_op={}',(aid,m.cur_op))
        if not m.cur_op:   return []
        #m.col_ws= [ci['wd'] for ci in m.ag.cattr('lvls', 'cols')]

        cur_val = data

        trg     = 'lexer '+m.lexr+'.json' if m.for_ulf=='l' else 'user.join'
        key4v   = m.for_ulf+'val'
        op      = m.cur_op
        oi      = m.opts_full[op]
        frm     = oi['frm']

        dval    = oi.get( 'def')
        uval    = oi.get('uval')
        lval    = oi.get('lval')
        fval    = oi.get('fval')
        ulfvl   = oi.get(key4v ) #fval if m.for_ulf=='f' else lval if m.for_ulf=='l' else uval
        jval    = oi['jlvl']    if m.for_ulf=='l' else \
                  oi['juvl']    if m.for_ulf=='u' else \
                  oi['jfvl']

        # Get new value
        newv    = None
        erpt_s  = ''
        if False:pass

        elif aid=='setd'  and  m.for_ulf=='f'  and  op in apx.OPT2PROP:
            # Remove from file - set over def/user/lex val
            newv    = oi.get('lval', oi.get('uval', oi.get('def')))
            if newv==ulfvl:
                #m.stbr_act(M.STBR_MSG, _('No need changes'))
                return []
            erpt_s  = 'reset-f'
            m.ed.set_prop(apx.OPT2PROP[op], newv)

        elif aid=='setd'  and  ulfvl is not None  and  m.for_ulf!='f':
            # Remove from user/lexer
            newv= None

        elif aid=='setv':                   # Add/Set opt for user/lexer/file
            # Enter from edit. Need parse some string
            #newv    = m.ag.cval('eded')
            newv    = cur_val
            try:
                newv    =   int(newv)   if frm=='int'   else \
                          float(newv)   if frm=='float' else \
                                newv
            except Exception as ex:
                app.msg_box(f(_('Incorrect value. It\'s needed in format: {}'), frm)
                           , app.MB_OK+app.MB_ICONWARNING)
                return d(form=d(fid='eded'))
            if frm=='#rgb' or frm=='#rgb-e' and newv:       # Testing new val
                try:
                    apx.html_color_to_int(newv)
                except Exception as ex:
                    app.msg_box(f(_('Incorrect value. It\'s needed in format: {}'), '#RGB or #RRGGBB')
                               , app.MB_OK+app.MB_ICONWARNING)
                    return d(form=d(fid='eded'))


        ### Use new value to change env
        if newv is not None and newv==ulfvl:
            #m.stbr_act(M.STBR_MSG, _('No need changes'))
            return []

        if m.for_ulf=='f' and newv is not None and op in apx.OPT2PROP:
            # Change for file
            erpt_s  = 'set-f'
            ed.set_prop(apx.OPT2PROP[op], newv)

        if m.for_ulf!='f':
            # Change target file
            pass;              #LOG and log('?? do_erpt',())
            erpt_s  =('reset-u' if newv  is None and m.for_ulf=='u' else
                      'reset-l' if newv  is None and m.for_ulf=='l' else
                      'add-u'   if ulfvl is None and m.for_ulf=='u' else
                      'add-l'   if ulfvl is None and m.for_ulf=='l' else
                      'set-u'   if                   m.for_ulf=='u' else
                      'set-l'   if                   m.for_ulf=='l' else '')
            pass;              #LOG and log('?? set_opt',())
            apx.set_opt(op
                       ,newv
                       ,apx.CONFIG_LEV_LEX  if m.for_ulf=='l' else apx.CONFIG_LEV_USER
                       ,ed_cfg  =None
                       ,lexer   =m.lexr     if m.for_ulf=='l' else None
                       ,user_json=m.how.get('stor_json', 'user.json')
                       )

            if not m.apply_one:
                pass;          #LOG and log('?? OpsReloadAndApply',())
                ed.cmd(cmds.cmd_OpsReloadAndApply)
            else:
                m.apply_need    = True

        # Use new value to change dlg data
        pass;                  #LOG and log('?? oi={}',(oi))
        pass;                  #LOG and log('?? m.opts_full={}',pf(m.opts_full))
        if False:pass
        elif aid=='setd':
            oi.pop(key4v, None)     if m.for_ulf!='f' else 0
        else:
            pass;              #LOG and log('key4v, newv={}',(key4v, newv))
            oi[key4v] = newv
        pass;                  #LOG and log('oi={}',(oi))
        upd_cald_vals(m.opts_full)
        pass;                  #LOG and log('oi={}',(oi))

        jnewv   = oi['jlvl']   if m.for_ulf=='l' else oi['juvl']    if m.for_ulf=='u' else oi['jfvl']
        #m.do_erpt(erpt_s, jnewv, jval)
        pass;                  #LOG and log('ok oi={}',(oi))
        pass;                  #LOG and log('ok m.opts_full={}',pf(m.opts_full))

        pass;                  #LOG and log('?? get_cnts',())

        if m.for_ulf!='f' and m.auto4file and op in apx.OPT2PROP:
            # Change FILE to over  (("over" - override?))
            newv    = oi.get('lval', oi.get('uval', oi.get('def')))
            if newv!=oi.get('fval'):
                erpt_s      = 'reset-f'
                m.ed.set_prop(apx.OPT2PROP[op], newv)
                oi['fval']  = newv
                jval        = oi['jfvl']
                upd_cald_vals(m.opts_full)
                jnewv       = oi['jfvl']
                #m.do_erpt('auset-f', jnewv, jval)

        pass;                  #LOG and log('m.get_vals(lvls-cur)={}',(m.get_vals('lvls-cur')))
示例#8
0
import shutil
from cudatext import *
from cudax_lib import html_color_to_int
from .proc_brackets import *

MARKTAG = 10  #uniq value for all markers plugins
CANNOT_USE_SEL = False  #cannot work if selection

NAME_INI = 'cuda_brackets_hilite.ini'
ini_app = os.path.join(app_path(APP_DIR_SETTINGS), NAME_INI)
ini_def = os.path.join(os.path.dirname(__file__), NAME_INI)

if not os.path.isfile(ini_app) and os.path.isfile(ini_def):
    shutil.copyfile(ini_def, ini_app)

COLOR_FONT = html_color_to_int(ini_read(ini_app, 'color', 'fore', '#000000'))
COLOR_BG = html_color_to_int(ini_read(ini_app, 'color', 'back', '#80c080'))

prev_lexer = None
prev_chars = ''


def get_chars():
    global prev_lexer
    global prev_chars

    lex = ed.get_prop(PROP_LEXER_CARET)
    if prev_lexer is not None:
        if lex == prev_lexer:
            return prev_chars
示例#9
0
import shutil
from cudatext import *
from cudax_lib import html_color_to_int
from .proc_brackets import *

MARKTAG = 10 #uniq value for all markers plugins
CANNOT_USE_SEL = False #cannot work if selection

NAME_INI = 'cuda_brackets_hilite.ini'
ini_app = os.path.join(app_path(APP_DIR_SETTINGS), NAME_INI)
ini_def = os.path.join(os.path.dirname(__file__), NAME_INI)

if not os.path.isfile(ini_app) and os.path.isfile(ini_def):
    shutil.copyfile(ini_def, ini_app)

COLOR_FONT = html_color_to_int(ini_read(ini_app, 'color', 'fore', '#000000'))
COLOR_BG = html_color_to_int(ini_read(ini_app, 'color', 'back', '#80c080'))

prev_lexer = None
prev_chars = ''


def get_chars():
    global prev_lexer
    global prev_chars
    
    lex = ed.get_prop(PROP_LEXER_CARET)
    if prev_lexer is not None:
        if lex==prev_lexer:
            return prev_chars
示例#10
0
 def get_color(key, default_color):
     s = get_opt(key, '')
     if s:
         return ctx.html_color_to_int(s)
     else:
         return default_color
示例#11
0
 def toggle(self):
     global FIND_REGEX
     global CASE_SENSITIVE
     if len(ed.get_carets())!=1:
         msg_status('Sync Editing: Need single caret')
         return
     original = ed.get_text_sel()
     # Check if we have selection of text
     if not original and self.saved_sel == (0,0):
         msg_status('Sync Editing: Make selection first')
         return
     self.set_progress(3)
     if self.saved_sel != (0,0):
         self.start_l, self.end_l = self.saved_sel
         self.selected = True
     else:
         # Save cords
         self.start_l, self.end_l = ed.get_sel_lines()
         self.selected = True
         # Save text selection
         self.saved_sel = ed.get_sel_lines()
         # Break text selection
         ed.set_sel_rect(0,0,0,0)
     # Mark text that was selected
     self.set_progress(5)
     ed.set_prop(PROP_MARKED_RANGE, (self.start_l, self.end_l))
     ed.set_prop(PROP_TAG, 'sync_edit:1')
     # Load lexer config
     CASE_SENSITIVE = get_opt('case_sens', True, lev=CONFIG_LEV_LEX)
     FIND_REGEX = get_opt('id_regex', FIND_REGEX_DEFAULT, lev=CONFIG_LEV_LEX)
     # Compile regex
     self.pattern = re.compile(FIND_REGEX)
     # Run lexer scan form start
     self.set_progress(10)
     ed.lexer_scan(self.start_l)
     self.set_progress(40)
     # Find all occurences of regex
     tokenlist = ed.get_token(TOKEN_LIST_SUB, self.start_l, self.end_l)
     if not tokenlist:
         self.reset()
         self.saved_sel = (0,0)
         msg_status('Sync Editing: Cannot find IDs in selection')
         self.set_progress(-1)
         return
     for token in tokenlist:
         if not token_style_ok(token['style']):
             continue
         idd = token['str'].strip()
         if not CASE_SENSITIVE:
             idd = idd.lower()
         old_style_token = ((token['x1'], token['y1']), (token['x2'], token['y2']), token['str'], token['style'])
         if idd in self.dictionary:
             if old_style_token not in self.dictionary[idd]:
                 self.dictionary[idd].append(old_style_token)
         else:
             self.dictionary[idd] = [(old_style_token)]
     # Fix tokens
     self.set_progress(60)
     self.fix_tokens()
     # Exit if no id's (eg: comments and etc)
     if len(self.dictionary) == 0:
         self.reset()
         self.saved_sel = (0,0)
         msg_status('Sync Editing: Cannot find IDs in selection')
         self.set_progress(-1)
         return
     # Exit if 1 occurence found (issue #44)
     elif len(self.dictionary) == 1 and len(self.dictionary[list(self.dictionary.keys())[0]]) == 1:
         self.reset()
         self.saved_sel = (0,0)
         msg_status('Sync Editing: Need several IDs in selection')
         self.set_progress(-1)
         return
     self.set_progress(90)
     # Mark all words that we can modify with pretty light color
     if MARK_COLORS:
         rand_color = randomcolor.RandomColor()
         for key in self.dictionary:
             color  = html_color_to_int(rand_color.generate(luminosity='light')[0])
             for key_tuple in self.dictionary[key]:
                 ed.attr(MARKERS_ADD, tag = MARKER_CODE, \
                 x = key_tuple[0][0], y = key_tuple[0][1], \
                 len = key_tuple[1][0] - key_tuple[0][0], \
                 color_font=0xb000000, color_bg=color, color_border=0xb000000, border_down=1)
     self.set_progress(-1)
     if self.want_exit:
         msg_status('Sync Editing: Cancel? Click somewhere else to cancel, or on ID to continue.')
     else:
         msg_status('Sync Editing: Click on ID to edit it, or somewhere else to cancel')
def options_load():

    opt.cannot_use_sel = str_to_bool(ini_read(ini_app, 'op', 'cannot_use_sel', '0'))
    opt.max_lines = int(ini_read(ini_app, 'op', 'max_line_count', str(opt.max_lines)))
    opt.color_font = html_color_to_int(ini_read(ini_app, 'color', 'fore', '#000000'))
    opt.color_back = html_color_to_int(ini_read(ini_app, 'color', 'back', '#80c080'))
 def toggle(self):
     global FIND_REGEX
     global CASE_SENSITIVE
     global STYLES_DEFAULT
     global STYLES_NO_DEFAULT
     global STYLES
     global STYLES_NO
     if len(ed.get_carets()) != 1:
         msg_status('Sync Editing: Need single caret')
         return
     original = ed.get_text_sel()
     # Check if we have selection of text
     if not original and self.saved_sel is None:
         msg_status('Sync Editing: Make selection first')
         return
     self.set_progress(3)
     if self.saved_sel is not None:
         self.start_l, self.end_l = self.saved_sel
         self.selected = True
     else:
         # Save cords
         self.start_l, self.end_l = ed.get_sel_lines()
         self.selected = True
         # Save text selection
         self.saved_sel = ed.get_sel_lines()
         # Break text selection
         ed.set_sel_rect(0, 0, 0, 0)
     # Mark text that was selected
     self.set_progress(5)
     ed.set_prop(PROP_MARKED_RANGE, (self.start_l, self.end_l))
     ed.set_prop(PROP_TAG, 'sync_edit:1')
     # Go naive way if lexer id none or other text file
     cur_lexer = ed.get_prop(PROP_LEXER_FILE)
     if cur_lexer in NON_STANDART_LEXERS:
         # If it if non-standart lexer, change it's behaviour
         STYLES_DEFAULT = NON_STANDART_LEXERS[cur_lexer]
     elif cur_lexer == '':
         # If lexer is none, go very naive way
         self.naive_mode = True
     if cur_lexer in NAIVE_LEXERS or get_opt(
             'syncedit_naive_mode', False, lev=CONFIG_LEV_LEX):
         self.naive_mode = True
     # Load lexer config
     CASE_SENSITIVE = get_opt('case_sens', True, lev=CONFIG_LEV_LEX)
     FIND_REGEX = get_opt('id_regex',
                          FIND_REGEX_DEFAULT,
                          lev=CONFIG_LEV_LEX)
     STYLES = get_opt('id_styles', STYLES_DEFAULT, lev=CONFIG_LEV_LEX)
     STYLES_NO = get_opt('id_styles_no',
                         STYLES_NO_DEFAULT,
                         lev=CONFIG_LEV_LEX)
     # Compile regex
     self.pattern = re.compile(FIND_REGEX)
     self.pattern_styles = re.compile(STYLES)
     self.pattern_styles_no = re.compile(STYLES_NO)
     # Run lexer scan form start
     self.set_progress(10)
     ed.action(EDACTION_LEXER_SCAN, self.start_l)  #API 1.0.289
     self.set_progress(40)
     # Find all occurences of regex
     tokenlist = ed.get_token(TOKEN_LIST_SUB, self.start_l, self.end_l)
     #print(tokenlist)
     if not tokenlist and not self.naive_mode:
         self.reset()
         self.saved_sel = None
         msg_status('Sync Editing: Cannot find IDs in selection')
         self.set_progress(-1)
         return
     elif self.naive_mode:
         # Naive filling
         for y in range(self.start_l, self.end_l + 1):
             cur_line = ed.get_text_line(y)
             for match in self.pattern.finditer(cur_line):
                 token = ((match.start(), y), (match.end(), y),
                          match.group(), 'id')
                 if match.group() in self.dictionary:
                     self.dictionary[match.group()].append(token)
                 else:
                     self.dictionary[match.group()] = [(token)]
     else:
         for token in tokenlist:
             if not self.token_style_ok(token['style']):
                 continue
             idd = token['str'].strip()
             if not CASE_SENSITIVE:
                 idd = idd.lower()
             old_style_token = ((token['x1'], token['y1']), (token['x2'],
                                                             token['y2']),
                                token['str'], token['style'])
             if idd in self.dictionary:
                 if old_style_token not in self.dictionary[idd]:
                     self.dictionary[idd].append(old_style_token)
             else:
                 self.dictionary[idd] = [(old_style_token)]
     # Fix tokens
     self.set_progress(60)
     self.fix_tokens()
     # Exit if no id's (eg: comments and etc)
     if len(self.dictionary) == 0:
         self.reset()
         self.saved_sel = None
         msg_status('Sync Editing: Cannot find IDs in selection')
         self.set_progress(-1)
         return
     # Exit if 1 occurence found (issue #44)
     elif len(self.dictionary) == 1 and len(self.dictionary[list(
             self.dictionary.keys())[0]]) == 1:
         self.reset()
         self.saved_sel = None
         msg_status('Sync Editing: Need several IDs in selection')
         self.set_progress(-1)
         return
     self.set_progress(90)
     # Mark all words that we can modify with pretty light color
     if MARK_COLORS:
         rand_color = randomcolor.RandomColor()
         for key in self.dictionary:
             color = html_color_to_int(
                 rand_color.generate(luminosity='light')[0])
             for key_tuple in self.dictionary[key]:
                 ed.attr(MARKERS_ADD, tag = MARKER_CODE, \
                 x = key_tuple[0][0], y = key_tuple[0][1], \
                 len = key_tuple[1][0] - key_tuple[0][0], \
                 color_font=0xb000000, color_bg=color, color_border=0xb000000, border_down=1)
     self.set_progress(-1)
     if self.want_exit:
         msg_status(
             'Sync Editing: Cancel? Click somewhere else to cancel, or on ID to continue.'
         )
     else:
         msg_status(
             'Sync Editing: Click on ID to edit it, or somewhere else to cancel'
         )