equal
deleted
inserted
replaced
948 if showwhtspc == True, trailing whitespace of a string is highlighted. |
948 if showwhtspc == True, trailing whitespace of a string is highlighted. |
949 """ |
949 """ |
950 # preprocess the text, converting tabs to spaces |
950 # preprocess the text, converting tabs to spaces |
951 text = text.expandtabs(4) |
951 text = text.expandtabs(4) |
952 # strip \n, and convert control characters to ^[char] representation |
952 # strip \n, and convert control characters to ^[char] representation |
953 text = re.sub(r'[\x00-\x08\x0a-\x1f]', |
953 text = re.sub(br'[\x00-\x08\x0a-\x1f]', |
954 lambda m:'^' + chr(ord(m.group()) + 64), text.strip('\n')) |
954 lambda m:'^' + chr(ord(m.group()) + 64), text.strip('\n')) |
955 |
955 |
956 if pair is not None: |
956 if pair is not None: |
957 colorpair = pair |
957 colorpair = pair |
958 elif pairname is not None: |
958 elif pairname is not None: |