QScintilla/SearchReplaceWidget.py

changeset 3039
8dd0165d805d
parent 3034
7ce719013078
child 3060
5883ce99ee12
child 3069
8a9579bbf583
equal deleted inserted replaced
3038:7fe9a53280bd 3039:8dd0165d805d
114 and so on.</td></tr> 114 and so on.</td></tr>
115 <tr><td><code>+</code></td> 115 <tr><td><code>+</code></td>
116 <td>This matches 1 or more times. For example, <code>Sa+m</code> matches 116 <td>This matches 1 or more times. For example, <code>Sa+m</code> matches
117 <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td></tr> 117 <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td></tr>
118 </table> 118 </table>
119 """) 119 """) # __IGNORE_WARNING__
120 self.setWhatsThis(whatsThis) 120 self.setWhatsThis(whatsThis)
121 121
122 self.ui.closeButton.setIcon(UI.PixmapCache.getIcon("close.png")) 122 self.ui.closeButton.setIcon(UI.PixmapCache.getIcon("close.png"))
123 self.ui.findPrevButton.setIcon( 123 self.ui.findPrevButton.setIcon(
124 UI.PixmapCache.getIcon("1leftarrow.png")) 124 UI.PixmapCache.getIcon("1leftarrow.png"))
422 ok = True 422 ok = True
423 break 423 break
424 else: 424 else:
425 ok = False 425 ok = False
426 elif (lineFrom == boundary[0] and indexFrom >= boundary[1]) or \ 426 elif (lineFrom == boundary[0] and indexFrom >= boundary[1]) or \
427 (lineFrom > boundary[0] and lineFrom < boundary[2]) or \ 427 (lineFrom > boundary[0] and lineFrom < boundary[2]) or \
428 (lineFrom == boundary[2] and indexFrom <= boundary[3]): 428 (lineFrom == boundary[2] and indexFrom <= boundary[3]):
429 ok = True 429 ok = True
430 else: 430 else:
431 ok = False 431 ok = False
432 if not ok and len(self.__selections) > 1: 432 if not ok and len(self.__selections) > 1:
433 # try again 433 # try again
434 while not ok and \ 434 while not ok and \
435 ((backwards and lineFrom >= boundary[0]) or 435 ((backwards and lineFrom >= boundary[0]) or
436 (not backwards and lineFrom <= boundary[2])): 436 (not backwards and lineFrom <= boundary[2])):
437 for ind in range(len(self.__selections)): 437 for ind in range(len(self.__selections)):
438 if lineFrom == self.__selections[ind][0]: 438 if lineFrom == self.__selections[ind][0]:
439 after = indexTo > self.__selections[ind][3] 439 after = indexTo > self.__selections[ind][3]
440 if backwards: 440 if backwards:
441 if after: 441 if after:
693 ok = True 693 ok = True
694 break 694 break
695 else: 695 else:
696 ok = False 696 ok = False
697 elif (lineFrom == boundary[0] and indexFrom >= boundary[1]) or \ 697 elif (lineFrom == boundary[0] and indexFrom >= boundary[1]) or \
698 (lineFrom > boundary[0] and lineFrom < boundary[2]) or \ 698 (lineFrom > boundary[0] and lineFrom < boundary[2]) or \
699 (lineFrom == boundary[2] and indexFrom <= boundary[3]): 699 (lineFrom == boundary[2] and indexFrom <= boundary[3]):
700 ok = True 700 ok = True
701 else: 701 else:
702 ok = False 702 ok = False
703 if not ok and len(self.__selections) > 1: 703 if not ok and len(self.__selections) > 1:
704 # try again 704 # try again
756 756
757 if found: 757 if found:
758 E5MessageBox.information( 758 E5MessageBox.information(
759 self, self.windowTitle(), 759 self, self.windowTitle(),
760 self.trUtf8("Replaced {0} occurrences.") 760 self.trUtf8("Replaced {0} occurrences.")
761 .format(replacements)) 761 .format(replacements))
762 else: 762 else:
763 E5MessageBox.information( 763 E5MessageBox.information(
764 self, self.windowTitle(), 764 self, self.windowTitle(),
765 self.trUtf8("Nothing replaced because '{0}' was not found.") 765 self.trUtf8("Nothing replaced because '{0}' was not found.")
766 .format(ftxt)) 766 .format(ftxt))
767 767
768 aw.setCursorPosition(cline, cindex) 768 aw.setCursorPosition(cline, cindex)
769 aw.ensureCursorVisible() 769 aw.ensureCursorVisible()
770 770
771 self.__finding = False 771 self.__finding = False

eric ide

mercurial