(self, changed_items)
called on main thread
called on main thread
called on main thread
def vcs_colorized(self, changed_items):
        '''called on main thread'''
        if not self.view.settings().has('dired_index'):
            return  # view was closed
        modified, untracked = [], []
        files_regions = dict((f, r) for f, r in zip(self.get_all(), self.view.split_by_newlines(Region(0, self.view.size()))))
        colorblind = self.view.settings().get('vcs_color_blind', False)
        offset = 1 if not colorblind else 0
        for fn in changed_items.keys():
            full_fn = normpath(fn)
            r = files_regions.get(full_fn, 0)
            if r:
                icon   = self._get_name_point(r) - 2
                r      = Region(icon, icon + offset)
                status = changed_items[fn]
                if status == 'M':
                    modified.append(r)
                elif status == '?':
                    untracked.append(r)
        if colorblind:
            self.view.add_regions('M', modified, 'item.colorblind.dired', '', MARK_OPTIONS | sublime.DRAW_EMPTY_AS_OVERWRITE)
            self.view.add_regions('?', untracked, 'item.colorblind.dired', '', MARK_OPTIONS | sublime.DRAW_EMPTY)
        else:
            self.view.add_regions('M', modified, 'item.modified.dired', '', MARK_OPTIONS)
            self.view.add_regions('?', untracked, 'item.untracked.dired', '', MARK_OPTIONS)
def vcs_colorized ( self , changed_items ) : if not self . view . settings ( ) . has ( 'dired_index' ) : return # view was closed modified , untracked = [ ] , [ ] files_regions = dict ( ( f , r ) for f , r in zip ( self . get_all ( ) , self . view . split_by_newlines ( Region ( 0 , self . view . size ( ) ) ) ) ) colorblind = self . view . settings ( ) . get ( 'vcs_color_blind' , False ) offset = 1 if not colorblind else 0 for fn in changed_items . keys ( ) : full_fn = normpath ( fn ) r = files_regions . get ( full_fn , 0 ) if r : icon = self . _get_name_point ( r ) - 2 r = Region ( icon , icon + offset ) status = changed_items [ fn ] if status == 'M' : modified . append ( r ) elif status == '?' : untracked . append ( r ) if colorblind : self . view . add_regions ( 'M' , modified , 'item.colorblind.dired' , '' , MARK_OPTIONS | sublime . DRAW_EMPTY_AS_OVERWRITE ) self . view . add_regions ( '?' , untracked , 'item.colorblind.dired' , '' , MARK_OPTIONS | sublime . DRAW_EMPTY ) else : self . view . add_regions ( 'M' , modified , 'item.modified.dired' , '' , MARK_OPTIONS ) self . view . add_regions ( '?' , untracked , 'item.untracked.dired' , '' , MARK_OPTIONS )