Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Hard-break" Trailing Spaces Removed on Manual Save #737

Closed
DeltaBravo opened this issue Apr 10, 2019 · 5 comments
Closed

"Hard-break" Trailing Spaces Removed on Manual Save #737

DeltaBravo opened this issue Apr 10, 2019 · 5 comments

Comments

@DeltaBravo
Copy link

Software Versions

PhpStorm 2019.1
Markdown Navigator 2.8.4.12

Settings

Editor > General: Other: Strip trailing spaces on Save: All
Editor > Code Style > Markdown: Document: Trailing Spaces: Document: Keep line breaks
Editor > Code Style: General: EditorConfig: Enable EditorConfig support: enabled

.editorconfig

root = true

[*]
charset                  = utf-8
end_of_line              = lf
insert_final_newline     = true
indent_size              = 4
indent_style             = space
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{json, yml}]
indent_size  = 2
indent_style = space

Expected Behaviour

Trailing spaces be removed on save from all files except Markdown files.
Ideally Markdown files would remove all trailing spaces except double spaces ("hard-breaks")

Actual Behaviour

All trailing white space is removed from all files on save.

@DeltaBravo
Copy link
Author

DeltaBravo commented Apr 10, 2019

Discovered something that seems to work. I consider this a workaround and not a proper solution. I also suspect this is an IDEA issue and not a Markdown Navigator issue.

Editor > General: Other: Strip trailing spaces on Save: None

Note that the EditorConfig plugin and configuration file are still enabling white space trimming but with an exception for Markdown files.

I am now getting my expected behaviour although not my ideal behaviour. That is, white space is trimmed in all files as expected however not in Markdown files. Ideally Markdown files would remove all trailing spaces except double spaces ("hard-breaks").

@vsch
Copy link
Owner

vsch commented Apr 10, 2019

@DeltaBravo, thank you for bringing this to my attention. I will look into what in editor config integration is causing this.

@vsch
Copy link
Owner

vsch commented Apr 12, 2019

@DeltaBravo, this was actually a bug. The IDE was not recognizing the plugin's filter.

Fixed, but minimum IDE version had to be upped to 2017.3.

EAP update with a fix for the issue is available.

Installing EAP Plugin Version

@vsch
Copy link
Owner

vsch commented Apr 12, 2019

BTW, if you set keep hard breaks in Markdown code style then you can enable trailing space stripping in editor config. It will strip all but 2 spaces on lines where they are significant and remove them where they are not, like on the last line of a paragraph.

@DeltaBravo
Copy link
Author

Thank you! It works great.

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

No branches or pull requests

2 participants