<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toggle_highlighting(self, state):

 """Toggle the 'highlight all results' feature"""

        if self.editor is not None:
            if state:
                self.highlight_matches()
            else:
                self.clear_matches()