(self, row, orig_start, orig_stop)
return start, stop
Update the DBCS buffer.
Update the DBCS buffer.
Update the DBCS buffer .
def _refresh_dbcs(self, row, orig_start, orig_stop):
        """Update the DBCS buffer."""
        raw = b''.join(self._rows[row-1].chars)
        # get a new converter each time so we don't share state between calls
        conv = self._codepage.get_converter(preserve=b'', use_substitutes=True)
        sequences = conv.to_unicode_list(raw, flush=True)
        updated = [old != new for old, new in zip(self._dbcs_text[row-1], sequences)]
        self._dbcs_text[row-1] = sequences
        try:
            start = updated.index(True) + 1
            stop = len(updated) - updated[::-1].index(True)
        except ValueError:
            # no change to text in dbcs buffer
            start, stop = len(updated), 0
        start, stop = min(start, orig_start), max(stop, orig_stop)
        return start, stop
def _refresh_dbcs ( self , row , orig_start , orig_stop ) : raw = b'' . join ( self . _rows [ row - 1 ] . chars ) # get a new converter each time so we don't share state between calls conv = self . _codepage . get_converter ( preserve = b'' , use_substitutes = True ) sequences = conv . to_unicode_list ( raw , flush = True ) updated = [ old != new for old , new in zip ( self . _dbcs_text [ row - 1 ] , sequences ) ] self . _dbcs_text [ row - 1 ] = sequences try : start = updated . index ( True ) + 1 stop = len ( updated ) - updated [ : : - 1 ] . index ( True ) except ValueError : # no change to text in dbcs buffer start , stop = len ( updated ) , 0 start , stop = min ( start , orig_start ) , max ( stop , orig_stop ) return start , stop