Bug 489692 - [WISH] Show changes in git in gutter
Summary: [WISH] Show changes in git in gutter
Status: CONFIRMED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: unspecified
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-03 18:37 UTC by Diego Gangl
Modified: 2025-01-13 11:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Gangl 2024-07-03 18:37:25 UTC
SUMMARY

There's an option to mark which lines have changed or unsaved lines in the left side border, but this only accounts for the time the file has been open and edited in kate. This isn't super useful when working with a VCS, and it's often confusing since one might think there are uncommited changes but it's really a line that was changed at some point and it's already saved and commited. 

It would be nice to have the same highlights but showing what has changed in Git (or any VCS the project plugin supports).
Comment 1 TraceyC 2024-07-10 21:27:45 UTC
I can confirm the behavior described.

I'm using the following plugins:
    Project plugin (commit / status / branch compare / stashing / file history)
    Documents Plugin (file history)
    Git blame (git blame support)

I also have the setting enabled to highlight changed lines (saved / unsaved)
If I change a word in a line of a file, and then change it back and save, the line has a green highlight in the left hand bar
The file has not changed vs. what is merged in the git branch

In contrast, here's how VS Code handles it:
- Open a file that is up to date with the local and remote branches
- Delete a word from a line and save - the line has a blue highlight (changed vs. branch)
- Restore the word - highlight is removed even before the file is saved (same as branch)
- Add a new line and save - line has a green highlight (new line vs branch)
Comment 2 Waqar Ahmed 2024-07-19 07:06:04 UTC
Would need to be implemented in KTextEditor as an optional feature.
Comment 3 goo 2025-01-04 20:49:18 UTC
would it help with this issue if the settings were to split up saved and unsaved highlights?

it would be nice if there were a way to just not have the green saved highlight, but keep the red unsaved ones.
Comment 4 Rakshit Kumar Singh 2025-01-07 13:34:41 UTC
(In reply to goo from comment #3)
> would it help with this issue if the settings were to split up saved and
> unsaved highlights?
> 
> it would be nice if there were a way to just not have the green saved
> highlight, but keep the red unsaved ones.

Yup same issue I was facing https://discuss.kde.org/t/how-to-disable-green-change-indicators-in-kate-after-saving/27814

I tried to get my hands dirty and add that feature myself but currently stuck because `Configure Kate...` seems to be not part of the source repo. (I might be incorrect sorry)

Can someone guide me to it. I will try to make this feature in upcoming day.
Comment 5 Waqar Ahmed 2025-01-13 11:38:16 UTC
See the KateMainWindow::slotConfigure() function.