fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
461 stars 10 forks source link

Syntax highlighting goes wrong with commit snippets #2333

Open deltamarnix opened 1 day ago

deltamarnix commented 1 day ago

While there is only a small snippet in the preview window, and there is the end of a string, the window doesn't see that the string is actually terminating.

        """
        return self._package_container.get_package(name, type_only, name_only)

    def add_package(self, package):
        pkg_type = package.package_type.lower()
        if pkg_type in self._package_container.package_type_dict:

image

New syntax highlighting looks great!

DanPristupov commented 1 day ago

Fork can't handle such cases. There is only a hunk of code and there is no way to determine range of the string literal. When we see just a single """ we don't know if it's a start or a terminator.