Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Don't remove empty trailing lines if it would move the cursor #192

@allefeld

Description

@allefeld

When I write a Markdown or LaTeX document, after I've created an blank line at the end in preparation for writing the next paragraph, I save the file. This blank line is then removed by this package.

I appreciate the utility of stripping whitespace, and I don't want to disable this function. But it is getting in the way in the situation outlined above. I propose to modify the behavior of the package such that if the cursor position would be changed by removing trailing blank lines, the blank lines are kept.


For illustration: Say I wrote the first paragraph of this comment and I'm about to write the second, my text looks like this:

When I write a Markdown or LaTeX document, after I've created an blank line at the end in
preparation for writing the next paragraph, I save the file. This blank line is then removed
by this package.

_

where the underline indicates the cursor position. I would now continue to type I appreciate. But after saving the file, the text is modified to

When I write a Markdown or LaTeX document, after I've created an blank line at the end in
preparation for writing the next paragraph, I save the file. This blank line is then removed
by this package.
_

so that I have to create the blank line before the next paragraph again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions