QScintilla/SearchReplaceWidget.py

changeset 6841
43af1e698c9d
parent 6645
ad476851d7e0
equal deleted inserted replaced
6840:98bb329e39ce 6841:43af1e698c9d
117 and so on.</td></tr> 117 and so on.</td></tr>
118 <tr><td><code>+</code></td> 118 <tr><td><code>+</code></td>
119 <td>This matches 1 or more times. For example, <code>Sa+m</code> matches 119 <td>This matches 1 or more times. For example, <code>Sa+m</code> matches
120 <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td></tr> 120 <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td></tr>
121 </table> 121 </table>
122 <p>When using the Extended (C++11) regular expression mode more features are
123 available, generally similar to regular expression support in JavaScript. See
124 the documentation of your C++ runtime for details on what is supported.<p>
122 """ 125 """
123 ) 126 )
124 self.setWhatsThis(whatsThis) 127 self.setWhatsThis(whatsThis)
125 128
126 # set icons 129 # set icons
437 indexFrom = 0 440 indexFrom = 0
438 lineTo = -1 441 lineTo = -1
439 indexTo = -1 442 indexTo = -1
440 if self.ui.selectionCheckBox.isChecked(): 443 if self.ui.selectionCheckBox.isChecked():
441 lineFrom, indexFrom, lineTo, indexTo = self.__selectionBoundary() 444 lineFrom, indexFrom, lineTo, indexTo = self.__selectionBoundary()
445 posixMode = (Preferences.getEditor("SearchRegexpMode") == 0 and
446 self.ui.regexpCheckBox.isChecked())
447 cxx11Mode = (Preferences.getEditor("SearchRegexpMode") == 1 and
448 self.ui.regexpCheckBox.isChecked())
442 449
443 aw.clearSearchIndicators() 450 aw.clearSearchIndicators()
444 ok = aw.findFirstTarget( 451 ok = aw.findFirstTarget(
445 txt, 452 txt,
446 self.ui.regexpCheckBox.isChecked(), 453 self.ui.regexpCheckBox.isChecked(),
447 self.ui.caseCheckBox.isChecked(), 454 self.ui.caseCheckBox.isChecked(),
448 self.ui.wordCheckBox.isChecked(), 455 self.ui.wordCheckBox.isChecked(),
449 lineFrom, indexFrom, lineTo, indexTo) 456 lineFrom, indexFrom, lineTo, indexTo,
457 posix=posixMode, cxx11=cxx11Mode)
450 while ok: 458 while ok:
451 tgtPos, tgtLen = aw.getFoundTarget() 459 tgtPos, tgtLen = aw.getFoundTarget()
452 if tgtLen == 0: 460 if tgtLen == 0:
453 break 461 break
454 if len(self.__selections) > 1: 462 if len(self.__selections) > 1:
539 else: 547 else:
540 line = lineTo 548 line = lineTo
541 index = indexTo 549 index = indexTo
542 550
543 if ok: 551 if ok:
552 posixMode = (Preferences.getEditor("SearchRegexpMode") == 0 and
553 self.ui.regexpCheckBox.isChecked())
554 cxx11Mode = (Preferences.getEditor("SearchRegexpMode") == 1 and
555 self.ui.regexpCheckBox.isChecked())
544 ok = aw.findFirst( 556 ok = aw.findFirst(
545 txt, 557 txt,
546 self.ui.regexpCheckBox.isChecked(), 558 self.ui.regexpCheckBox.isChecked(),
547 self.ui.caseCheckBox.isChecked(), 559 self.ui.caseCheckBox.isChecked(),
548 self.ui.wordCheckBox.isChecked(), 560 self.ui.wordCheckBox.isChecked(),
549 self.ui.wrapCheckBox.isChecked(), 561 self.ui.wrapCheckBox.isChecked(),
550 not backwards, 562 not backwards,
551 line, index, 563 line, index,
552 posix=self.ui.regexpCheckBox.isChecked()) 564 posix=posixMode,
565 cxx11=cxx11Mode)
553 566
554 if ok and self.ui.selectionCheckBox.isChecked(): 567 if ok and self.ui.selectionCheckBox.isChecked():
555 lineFrom, indexFrom, lineTo, indexTo = aw.getSelection() 568 lineFrom, indexFrom, lineTo, indexTo = aw.getSelection()
556 if len(self.__selections) > 1: 569 if len(self.__selections) > 1:
557 for sel in self.__selections: 570 for sel in self.__selections:
599 self.ui.caseCheckBox.isChecked(), 612 self.ui.caseCheckBox.isChecked(),
600 self.ui.wordCheckBox.isChecked(), 613 self.ui.wordCheckBox.isChecked(),
601 self.ui.wrapCheckBox.isChecked(), 614 self.ui.wrapCheckBox.isChecked(),
602 not backwards, 615 not backwards,
603 line, index, 616 line, index,
604 posix=self.ui.regexpCheckBox.isChecked()) 617 posix=posixMode,
618 cxx11=cxx11Mode)
605 if ok: 619 if ok:
606 lineFrom, indexFrom, lineTo, indexTo = \ 620 lineFrom, indexFrom, lineTo, indexTo = \
607 aw.getSelection() 621 aw.getSelection()
608 if lineFrom < boundary[0] or \ 622 if lineFrom < boundary[0] or \
609 lineFrom > boundary[2] or \ 623 lineFrom > boundary[2] or \
626 self.ui.caseCheckBox.isChecked(), 640 self.ui.caseCheckBox.isChecked(),
627 self.ui.wordCheckBox.isChecked(), 641 self.ui.wordCheckBox.isChecked(),
628 self.ui.wrapCheckBox.isChecked(), 642 self.ui.wrapCheckBox.isChecked(),
629 not backwards, 643 not backwards,
630 line, index, 644 line, index,
631 posix=self.ui.regexpCheckBox.isChecked()) 645 posix=posixMode,
646 cxx11=cxx11Mode)
632 if ok: 647 if ok:
633 lineFrom, indexFrom, lineTo, indexTo = \ 648 lineFrom, indexFrom, lineTo, indexTo = \
634 aw.getSelection() 649 aw.getSelection()
635 if len(self.__selections) > 1: 650 if len(self.__selections) > 1:
636 for sel in self.__selections: 651 for sel in self.__selections:
838 if self.ui.selectionCheckBox.isChecked(): 853 if self.ui.selectionCheckBox.isChecked():
839 line, index = boundary[:2] 854 line, index = boundary[:2]
840 else: 855 else:
841 line = 0 856 line = 0
842 index = 0 857 index = 0
858 posixMode = (Preferences.getEditor("SearchRegexpMode") == 0 and
859 self.ui.regexpCheckBox.isChecked())
860 cxx11Mode = (Preferences.getEditor("SearchRegexpMode") == 1 and
861 self.ui.regexpCheckBox.isChecked())
843 ok = aw.findFirst( 862 ok = aw.findFirst(
844 ftxt, 863 ftxt,
845 self.ui.regexpCheckBox.isChecked(), 864 self.ui.regexpCheckBox.isChecked(),
846 self.ui.caseCheckBox.isChecked(), 865 self.ui.caseCheckBox.isChecked(),
847 self.ui.wordCheckBox.isChecked(), 866 self.ui.wordCheckBox.isChecked(),
848 False, True, line, index, 867 False, True, line, index,
849 posix=self.ui.regexpCheckBox.isChecked()) 868 posix=posixMode,
869 cxx11=cxx11Mode)
850 870
851 if ok and self.ui.selectionCheckBox.isChecked(): 871 if ok and self.ui.selectionCheckBox.isChecked():
852 lineFrom, indexFrom, lineTo, indexTo = aw.getSelection() 872 lineFrom, indexFrom, lineTo, indexTo = aw.getSelection()
853 if len(self.__selections) > 1: 873 if len(self.__selections) > 1:
854 for sel in self.__selections: 874 for sel in self.__selections:
884 ftxt, 904 ftxt,
885 self.ui.regexpCheckBox.isChecked(), 905 self.ui.regexpCheckBox.isChecked(),
886 self.ui.caseCheckBox.isChecked(), 906 self.ui.caseCheckBox.isChecked(),
887 self.ui.wordCheckBox.isChecked(), 907 self.ui.wordCheckBox.isChecked(),
888 False, True, line, index, 908 False, True, line, index,
889 posix=self.ui.regexpCheckBox.isChecked()) 909 posix=posixMode,
910 cxx11=cxx11Mode)
890 if ok: 911 if ok:
891 lineFrom, indexFrom, lineTo, indexTo = \ 912 lineFrom, indexFrom, lineTo, indexTo = \
892 aw.getSelection() 913 aw.getSelection()
893 if lineFrom < boundary[0] or \ 914 if lineFrom < boundary[0] or \
894 lineFrom > boundary[2] or \ 915 lineFrom > boundary[2] or \

eric ide

mercurial