def highlightNextMatch(self):
        """
        Select and highlight the next match in the set of matches.
        """
        # If this method was called on an empty input field (ie.
        # if the user hit <ctrl>+s again) then pick the default
        # selection.
        if self.qteText.toPlainText() == '':
            self.qteText.setText(self.defaultChoice)
            return

        # If the mathIdx variable is out of bounds (eg. the last possible
        # match is already selected) then wrap it around.
        if self.selMatchIdx < 0:
            self.selMatchIdx = 0
            return
        if self.selMatchIdx >= len(self.matchList):
            self.selMatchIdx = 0
            return

        # Shorthand.
        SCI = self.qteWidget

        # Undo the highlighting of the previously selected match.
        start, stop = self.matchList[self.selMatchIdx - 1]
        line, col = SCI.lineIndexFromPosition(start)
        SCI.SendScintilla(SCI.SCI_STARTSTYLING, start, 0xFF)
        SCI.SendScintilla(SCI.SCI_SETSTYLING, stop - start, 30)

        # Highlight the next match.
        start, stop = self.matchList[self.selMatchIdx]
        SCI.SendScintilla(SCI.SCI_STARTSTYLING, start, 0xFF)
        SCI.SendScintilla(SCI.SCI_SETSTYLING, stop - start, 31)

        # Place the cursor at the start of the currently selected match.
        line, col = SCI.lineIndexFromPosition(start)
        SCI.setCursorPosition(line, col)
        self.selMatchIdx += 1