Skip to content

Bad text display for folded multi-line docstrings #560

@Pidgeot

Description

@Pidgeot

Given a multi-line docstring like this:

"""This is my
docstring.
"""

the folded docstring text becomes docstring, rather than This is my.

This behavior is caused by lines 21-23 from autoload/pymode/folding.vim (added in commit fce811d), but simply removing them breaks docstrings like this:

"""
This is my docstring.
"""

which will instead show an empty fold text.

A simple fix I've found is to replace line 21 with if getline(fs) =~ s:doc_end_regex, since this handles the case where the first line is blank - but that does assume the fold won't start with a single-line docstring, and I'm not sufficiently acquainted with the folding stuff to be sure that this won't ever be the case.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions