# Path: basic_editor/editor_base.py
# class BaseExtension:
#     def __init__(self, editor):
#         self.editor = editor
# 
#         self.cfg = editor.cfg
#         self.root = editor.root
#         self.text = editor.text  # ScrolledText() instance
# 
# Path: basic_editor/tkinter_utils.py
# class TkTextTag:
#     _id = 0
# 
#     def __init__(self, text_widget, **config):
#         self.id = self._id
#         self._id += 1
#         text_widget.tag_configure(self.id, config)


import tkinter
import pygments
from tkinter import font
from dragonlib.dragon32.pygments_lexer import BasicLexer
from pygments.styles import get_style_by_name
from basic_editor.editor_base import BaseExtension
from basic_editor.tkinter_utils import TkTextTag
        end_index = 0
        for ttype, value in tokensource:
            if "\n" in value:
                end_line += value.count("\n")
                end_index = len(value.rsplit("\n", 1)[1])
            else:
                end_index += len(value)

            if value not in (" ", "\n"):
                index1 = f"{start_line}.{start_index}"
                index2 = f"{end_line}.{end_index}"

                for tagname in self.text.tag_names(index1):  # FIXME
                    # print("remove %s" % tagname)
                    if tagname not in self.existing_tags:  # Don"t remove e.g.: "current line"-tag
                        # print("Skip...")
                        continue
                    self.text.tag_remove(tagname, index1, index2)

                # Mark used line numbers extra:
                if start_index == 0 and ttype == pygments.token.Name.Label:
                    if int(value) in destinations:
                        ttype = pygments.token.Name.Tag

                self.text.tag_add(self.tags[ttype], index1, index2)

            start_line = end_line
            start_index = end_index



# Path: basic_editor/editor_base.py
# class BaseExtension:
#     def __init__(self, editor):
#         self.editor = editor
# 
#         self.cfg = editor.cfg
#         self.root = editor.root
#         self.text = editor.text  # ScrolledText() instance
# 
# Path: basic_editor/tkinter_utils.py
# class TkTextTag:
#     _id = 0
# 
#     def __init__(self, text_widget, **config):
#         self.id = self._id
#         self._id += 1
#         text_widget.tag_configure(self.id, config)


# Path: basic_editor/highlighting.py
import tkinter
import pygments
from tkinter import font
from dragonlib.dragon32.pygments_lexer import BasicLexer
from pygments.styles import get_style_by_name
from basic_editor.editor_base import BaseExtension
from basic_editor.tkinter_utils import TkTextTag

        end_index = 0
        for ttype, value in tokensource:
            if "\n" in value:
                end_line += value.count("\n")
                end_index = len(value.rsplit("\n", 1)[1])
            else:
                end_index += len(value)

            if value not in (" ", "\n"):
                index1 = f"{start_line}.{start_index}"
                index2 = f"{end_line}.{end_index}"

                for tagname in self.text.tag_names(index1):  # FIXME
                    # print("remove %s" % tagname)
                    if tagname not in self.existing_tags:  # Don"t remove e.g.: "current line"-tag
                        # print("Skip...")
                        continue
                    self.text.tag_remove(tagname, index1, index2)

                # Mark used line numbers extra:
                if start_index == 0 and ttype == pygments.token.Name.Label:
                    if int(value) in destinations:
                        ttype = pygments.token.Name.Tag

                self.text.tag_add(self.tags[ttype], index1, index2)

            start_line = end_line
            start_index = end_index



class TkTextHighlightCurrentLine(BaseExtension):