Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

commit: only mark chars that exceed line length limits

not the whole line

Changeset eeb6f11ef8c8

Parent 7837d8786a37

by Adrian Buehlmann

Changes to one file · Browse files at eeb6f11ef8c8 Showing diff from parent 7837d8786a37 Diff from another changeset...

 
149
150
151
 
152
153
154
155
156
157
158
159
160
 
 
 
 
 
 
 
 
 
 
 
161
162
163
164
165
166
167
 
168
169
170
 
149
150
151
152
153
 
154
 
 
 
 
 
 
155
156
157
158
159
160
161
162
163
164
165
166
167
168
 
169
170
 
171
172
173
174
@@ -149,22 +149,26 @@
  pos, nextpos = 0, 0   sels = []   for i, line in enumerate(text.split('\n')): + length = len(line)   pos = nextpos - length = len(line)   nextpos += length + 1 # include \n - if i == 0 and (length < sumlen or not sumlen): - continue - elif i == 1 and (length == 0 or not sumlen): - continue - elif i > 1 and (length < maxlen or not maxlen): - continue + if i == 0: + if length < sumlen or not sumlen: + continue + pos += sumlen + elif i == 1: + if length == 0 or not sumlen: + continue + else: + if length < maxlen or not maxlen: + continue + pos += maxlen   sel = QTextEdit.ExtraSelection()   sel.bgcolor = QColor('red')   sel.format.setBackground(sel.bgcolor) - sel.format.setProperty(QTextFormat.FullWidthSelection, True)   sel.cursor = QTextCursor(self.msgte.document())   sel.cursor.setPosition(pos) - sel.cursor.clearSelection() + sel.cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor)   sels.append(sel)   self.msgte.setExtraSelections(sels)