Commits

Andrea Stagi committed 243a38c

manifestdialog: set ignorecase during init, fixes highlighting on Annotate File in search

Comments (0)

Files changed (2)

tortoisehg/hgqt/grep.py

 
         self.tv.setSortingEnabled(False)
         self.tv.pattern = pattern
+        self.tv.icase = icase
         self.regexple.selectAll()
         inc = hglib.fromunicode(self.incle.text())
         if inc: inc = inc.split(', ')
 
         self.repo = repo
         self.pattern = None
+        self.icase = False
         self.embedded = parent.parent() is not None
         self.selectedRows = ()
 
     def onAnnotateFile(self):
         from tortoisehg.hgqt.manifestdialog import run
         from tortoisehg.hgqt.run import qtrun
-        repo, ui, pattern = self.repo, self.repo.ui, self.pattern
+        repo, ui, pattern, icase = self.repo, self.repo.ui, self.pattern, self.icase
         seen = set()
         for rev, path, line in self.selectedRows:
             # Only open one annotate instance per file
                         rev = repo['.'].rev()
                     srepo = thgrepo.repository(None, root)
                     opts = {'repo': srepo, 'canonpath' : path, 'rev' : rev,
-                            'line': line, 'pattern': pattern}
+                            'line': line, 'pattern': pattern, 'ignorecase': icase}
                     qtrun(run, ui, **opts)
                 else:
                     continue
                 if rev is None:
                     rev = repo['.'].rev()
                 opts = {'repo': repo, 'canonpath' : path, 'rev' : rev,
-                        'line': line, 'pattern': pattern}
+                        'line': line, 'pattern': pattern, 'ignorecase': icase}
                 qtrun(run, ui, **opts)
 
     def onViewChangeset(self):

tortoisehg/hgqt/manifestdialog.py

         """Set search pattern [unicode]"""
         self._manifest_widget._fileview.searchbar.setPattern(text)
 
+    def setSearchCaseInsensitive(self, ignorecase):
+        """Set if search is case insensitive"""
+        self._manifest_widget._fileview.searchbar.setCaseInsensitive(ignorecase)
+
     @pyqtSlot(unicode, dict)
     def _openSearchWidget(self, pattern, opts):
         opts = dict((str(k), str(v)) for k, v in opts.iteritems())
                 dlg.setSearchPattern(opts['pattern'])
             if dlg._manifest_widget._fileview.actionAnnMode.isEnabled():
                 dlg._manifest_widget._fileview.actionAnnMode.trigger()
+            dlg.setSearchCaseInsensitive(opts['ignorecase'])
         except IndexError:
             pass
         dlg.setSearchPattern(hglib.tounicode(opts.get('pattern')) or '')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.