handle character in the category 'nonspacing mark'

Those characters are ignored, because they decorate
the previous character.
This commit is contained in:
2022-01-29 10:43:23 +01:00
parent a413134f68
commit f0c3d34995
7 changed files with 132 additions and 26 deletions

View File

@@ -308,7 +308,7 @@ class InnerBigText(QWidget):
column_in_line = self.x_pos_to_column(e.pos().x()) + self._left_offset
column_in_line = min(column_in_line, line.length_in_columns()) # x was behind the last column of this line
char_in_line = line.column_to_char(column_in_line)
print("%s in line %s lcolumn_in_line=%s" % (char_in_line, line_number, column_in_line))
# print("%s in line %s lcolumn_in_line=%s" % (char_in_line, line_number, column_in_line))
byte_in_line = line.char_index_to_byte(char_in_line)
current_byte = line.byte_offset() + byte_in_line
# print("%s + %s = %s" % (line.byte_offset(), char_in_line, current_byte))
@@ -401,6 +401,7 @@ class InnerBigText(QWidget):
# draw hightlights first - some characters may overlap to the next line
# by drawing the background hightlights first we prevent that the hightlight
# draws over a character
start = time.time()
y_line_offset = self.char_height;
for l in self.lines:
highlight_ranges = []
@@ -412,6 +413,9 @@ class InnerBigText(QWidget):
self.draw_highlights(highlight_ranges, painter, y_line_offset)
y_line_offset = y_line_offset + self.char_height
end = time.time()
# print("highlight duration: %.3f" %((end-start)*1000))
left_offset = int(-1 * self._left_offset * self.char_width)
y_line_offset = self.char_height;
for l in self.lines: