Question

I am using python-mode for syntax highlighting. Everything is fine except the highlighting of docstrings, which makes reading code in github repositories with complex docstrings very difficult to do. Here an example:

class DoubleQuotesDocString:
    """
    This is a doc string but inside double quotes " the highlinting breaks: in for type while " so this is a bug
    """

class SingleQuotesDocString:
    '''
    This is a doc string but inside single quotes ' the highlinting breaks: in for type while ' so this is a bug
'''

And the corresponding screenshot where you see that it is not properly highlighted:

bad-highlighting

Of course this is a simple example. A complex docstring full of such highlighting bugs is completely unreadable.

Is there a solution for this?

EDIT: funny, stackoverflow highlighting also has trouble with this.

Was it helpful?

Solution

The solution was to swtich from python-mode.el version 5.1.0 to version 6.1.1.

OTHER TIPS

It does not seem to affect the default python-mode that comes bundled with Emacs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top