Murmele / Gittyup

Understand your Git history!
https://murmele.github.io/Gittyup
MIT License
1.37k stars 108 forks source link

feat: add an option to render whitespace in the diff and editor views #751

Closed mwerle closed 1 month ago

mwerle commented 2 months ago

UPDATE 2024-05-08 Refactored the PR; code changes have been minimised and commits have been merged where it made logical sense.

DESCRIPTION:

This PR adds an option to the "Editor" configuration tab to show whitespace. When this option is checked, whitespace is rendered in the diff and blame editor views. This can be very useful to see incorrect whitespaces (eg tabs vs spaces) when viewing diffs prior to committing files.

ASSOCIATED EDITS:

The translation files were updated to match the updated source files (using the CMake script).

A new translation entry was added for the new configuration option, and the german translation added.

ISSUES:

QUESTIONS:

  1. Is the option path "editor/view/showWhitespace" ok or should another path be used?
  2. fixed should some/all of these commits be squashed prior to merging?
mwerle commented 2 months ago

Just noticed, when rebasing, I lost/accidentally merged 2 commits.

I initially showed EOL marks as well, but they are quite intrusive. I didn't investigate to see if alternate, less intrusive, glyphs can be shown in Scintilla and instead disabled showing EOL marks. This was a separate commit.

This merged commit is af75f39570947794f68c7ce5b21dae9f9d6940b4

Murmele commented 1 month ago

I have this macos problem now as well

Murmele commented 1 month ago

Can you rebase? I think I fixed the macos problem. For some reason macos 14 does not work

lonix1 commented 1 month ago

Is this related to https://github.com/Murmele/Gittyup/issues/603 ?

mwerle commented 1 month ago

Is this related to #603 ?

No it wasn't; it was purely because I recently had some issues with different types of whitespace in some source files and I like to be able to visualise it to see what's going on. Being told there's a difference but not seeing what that difference actually is makes it difficult to fix..

603 sounds like it's a feature-request to make it easier to toggle whitespace significance for diffs; ie, instead of in settings, to have a button or menu item.

lonix1 commented 1 month ago

to be able to visualise it to see what's going on.

Yes this is driving me nuts too! :)

I was wondering what this PR does because I'm using not using the dev release, I thought maybe they're related. Regardless, it seems like a good addition from what I've read above - thanks for working on it!

mwerle commented 1 month ago

Pictures paint a thousand words ;)

Default (whitespace hidden): Gittyup - hide whitespace

New option selected (whitespace shown): Gittyp - show whitespace

lonix1 commented 1 month ago

Ooooh... those little dots? Very nice!

mwerle commented 1 month ago

And arrows for tabs, I felt the EOL marker was too intrusive, but have since read that it's possible to override the glyph. Still, not a big requirement for me so left it off for now.