def OnDTEChange(self, *args):
        '''Called after a material change to the text widget contents

        First element of *args will be the text widget commannd
        that caused the change ("insert", "delete", or "replace")
        the rest of the arguments will vary depending on that
        command
        '''
        # make sure there is always a newline at the end (well, two
        # newlines since tk always adds one). Why? So the user
        # always has a blank line on which to click. It's just a 
        # little usability thing
        if (self.dte.get("end-2c", "end") != "\n\n"):
            insert = self.dte.index("insert")
            self.dte.insert("end", "\n")
            self.dte.mark_set("insert", insert)

        # remove all special tags
        block_start = self.dte.index("start_change linestart")
        block_end = self.dte.index("end_change lineend +1c")
        for tag in ("name", "variable", "noise","heading", 
                    "comment", "keyword", "bold", "cell", "ellipsis"):
            self.dte.tag_remove(tag, block_start, block_end)
        
        # now add all the special highlighting
        self.dte.highlight_pattern(r'^\*+\s*(Test Cases?|(User\s+)?Keywords?|Settings?|Variables?)\s*\**', 
                                   "heading", block_start, block_end, whole_lines = True)
        self.dte.highlight_pattern(r'\$\{.*?\}', "variable", block_start, block_end)
        self.dte.highlight_pattern(r'^\s*\*+[^\*]+\*+\s*$', "bold", block_start, block_end)
        self.dte.highlight_pattern(r'^\s*#[^\n]*?$', "comment", block_start, block_end)
        self.dte.highlight_pattern(r'\|\s+#[^\n]*?$', "comment", block_start, block_end)
        self.dte.highlight_pattern('\|', "column_marker", block_start, block_end)
        self.dte.highlight_pattern(" \.\.\. ", "ellipsis", block_start, block_end)

        # only do this for test cases
        # TODO: make sure we only do this in a test case table. ie: don't
        # mark things with "name" if they are in the settings table.
        name_pattern = r'^\|\s+[^\|\s][^\n]*?$'
        for (start, end) in self.get_table_regions("test cases"):
            self.dte.highlight_pattern(name_pattern, "name", start, end)

        # ... and keywords
        for (start, end) in self.get_table_regions("keywords"):
            self.dte.highlight_pattern(name_pattern, "name", start, end)
        
        number_of_lines = 1-int(float(self.dte.index("end")))
        self.dte.tag_configure("cell", background="pink")
        start_line = int(float(block_start))
        end_line = int(float(block_end))

        self.event_generate("<<FileChanged>>", data="this is bogus")
dataset/ETHPy150Open boakley/robotframework-workbench/rwb/editor/editor_page.py/EditorPage.OnDTEChange/swapped operands of `-`