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

changeset: fix searching

Changeset e07dd9f267cd

Parent 2375ca57462b

by Adrian Buehlmann

Changes to one file · Browse files at e07dd9f267cd Showing diff from parent 2375ca57462b Diff from another changeset...

 
95
96
97
98
99
100
101
102
103
 
 
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
 
 
124
125
126
 
221
222
223
224
 
 
225
226
227
228
 
 
229
230
 
231
232
 
233
234
235
236
 
 
 
237
238
239
240
241
 
 
242
243
244
 
245
246
247
248
 
 
95
96
97
 
 
 
 
 
 
98
99
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
102
103
104
105
 
200
201
202
 
203
204
205
206
 
 
207
208
209
210
211
212
 
213
214
 
 
 
215
216
217
218
219
220
 
 
221
222
223
224
 
225
226
227
228
 
229
@@ -95,32 +95,11 @@
  self.refreshDisplay()     def selectNone(self): - cursor = self.textCursor() - cursor.clearSelection() - cursor.setPosition(0) - self.setTextCursor(cursor) - self.setExtraSelections([]) - + self._message.selectNone() +   def searchString(self, text): - self.selectNone() - if text in unicode(self.toPlainText()): - clist = [] - while self.find(text): - eselect = self.ExtraSelection() - eselect.cursor = self.textCursor() - eselect.format.setBackground(QtGui.QColor('#ffffbb')) - clist.append(eselect) - self.selectNone() - self.setExtraSelections(clist) - def finditer(self, text): - if text: - while True: - if self.find(text): - yield self.ctx.rev(), None - else: - break - return finditer(self, text) - + self._message.searchString(text) +   def refreshDisplay(self):   ctx = self.ctx   rev = ctx.rev() @@ -221,28 +200,30 @@
  self._message.setHtml(buf)     def selectNone(self): - cursor = self.textCursor() + msg = self._message + cursor = msg.textCursor()   cursor.clearSelection()   cursor.setPosition(0) - self.setTextCursor(cursor) - self.setExtraSelections([]) + msg.setTextCursor(cursor) + msg.setExtraSelections([])     def searchString(self, text): + msg = self._message   self.selectNone() - if text in unicode(self.toPlainText()): + if text in unicode(msg.toPlainText()):   clist = [] - while self.find(text): - eselect = self.ExtraSelection() - eselect.cursor = self.textCursor() + while msg.find(text): + eselect = msg.ExtraSelection() + eselect.cursor = msg.textCursor()   eselect.format.setBackground(QtGui.QColor('#ffffbb'))   clist.append(eselect)   self.selectNone() - self.setExtraSelections(clist) - def finditer(self, text): + msg.setExtraSelections(clist) + def finditer(msg, text):   if text:   while True: - if self.find(text): + if msg.find(text):   yield self.ctx.rev(), None   else:   break - return finditer(self, text) + return finditer(msg, text)