Notepad3 icon indicating copy to clipboard operation
Notepad3 copied to clipboard

Allow separate formatting of trailing blanks/whitespace

Open mustanggb opened this issue 5 years ago • 10 comments

I know we have: File > Line Endings > Default > Strip trailing blanks when saving, View > Show Blanks and Appearance > Customise Schemes > Common Base > Whitespace

But it would be really handy to be able to format trailing blanks separately: Appearance > Customise Schemes > Common Base > Trailing Blanks

And perhaps even have a toggle for it: View > Show Trailing Blanks

The idea is to achieve something like this: image

If this is already possible, but I've just missed the option, please let me know.

mustanggb avatar Jan 24 '20 15:01 mustanggb

You may "mark occurrences" of trailing blanks by Find RegEx '[ ]+$' and edit all matches by pressing Ctrl+Shift+Spacebar in edit window.

RaiKoHoff avatar Jan 24 '20 17:01 RaiKoHoff

You can also delete all trailing spaces once by:

  • Edit --> Selection --> Strip Trailing Blanks
  • or directly by Alt+W

hpwamr avatar Jan 24 '20 17:01 hpwamr

I think the the options to find and/or to "Strip Trailing Blanks" is good enough to handle this tasks ...

image

Ed.: ... at least I need a very good argument "why it is handy to see trailing blanks in the document". (Because I want to delete them is not good enough 😉)

RaiKoHoff avatar Feb 13 '20 15:02 RaiKoHoff

Yes I mentioned that option in the original post.

However the reason being if I'm editing a section of a file I want to be aware of creating trailing blanks and not introduce them into the file, however when saving I don't want to remove legitimate trailing blanks for the remainder of the file, only being concerned with my small section.

Realistically having to search for them every time (as previously mentioned) is going to get forgotten, so they should scream in your face automatically.

mustanggb avatar Feb 13 '20 15:02 mustanggb

So it would be enough to update the "training blanks marker/indicators" only for the visible area (instead of the whole file - marker update for whole file significantly slows down the UI response (hyperlinks, occurrence marker, multi selection, ...) )?

RaiKoHoff avatar Feb 13 '20 15:02 RaiKoHoff

Yes, I assume that would work fine, happy to give feedback on any test builds if required.

mustanggb avatar Feb 13 '20 16:02 mustanggb

@mustanggb - Thank you for opening this issue! I was looking for a "strip trailing blanks when saving" setting, but couldn't find it. (It did not occur to me to click on "Default..." because I figured that would only lead to a choice between CRLF/CR/LF.)

Small note: Maybe if it said "Defaults..." (plural) that would be a slight hint that there's more there.

As for the extra highlighting of trailing blanks, I agree with the project's developers that the use case is extremely narrow and probably not worth the development effort.

jkyeung avatar Apr 21 '21 00:04 jkyeung

@jkyeung : Maybe they are a little bit "hidden" behind that dialog 🤔 What would be a better (additional) place (add to Menu->Settings->... between X... and Y...) ?

RaiKoHoff avatar Apr 21 '21 06:04 RaiKoHoff

As for the extra highlighting of trailing blanks, I agree with the project's developers that the use case is extremely narrow and probably not worth the development effort.

That might be, but there are legitimate cases of trailing spaces (looking at you, Markdown! 😠). And I agree with @mustanggb that an option to see those trailing blanks (and only those) would be nice indeed…

engelhro avatar Apr 21 '21 07:04 engelhro

Which commit was this completed in?

mustanggb avatar Jul 21 '23 17:07 mustanggb