Skip to content
This repository has been 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

Open
allefeld opened this issue May 12, 2020 · 1 comment
Open

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

allefeld opened this issue May 12, 2020 · 1 comment

Comments

@allefeld
Copy link

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.

@Yokissa
Copy link

Yokissa commented Jun 15, 2020

Personally I feel this would be a better criteria than just allowing multiple new lines at the end of file. Seems not many people is maintaining this repo though. Guess we will have to look into it ourselves.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants