Author Topic: Highlighting lines that have been modified?  (Read 2795 times)

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Highlighting lines that have been modified?
« on: March 04, 2019, 06:34:45 PM »
I can't figure out how to enable this feature for my C files.  Is there a tutorial for it?

Does this feature take into account version control?  It would be really cool if SlickEdit could read in the changes from "git diff" or "p4 diff" and highlight those lines, so that I don't have to manually figure out what I've changed.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: Highlighting lines that have been modified?
« Reply #1 on: March 04, 2019, 08:10:48 PM »
The attached picture illustrates which SlickEdit menu item you want to use. You do need to configure your workspace or project for a specific version control system like git or perforce.

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Re: Highlighting lines that have been modified?
« Reply #2 on: March 04, 2019, 09:16:18 PM »
That is very cool, thanks.  Is there any way to get changed code in the editor to be highlighted, without showing the diff tool itself?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Highlighting lines that have been modified?
« Reply #3 on: March 04, 2019, 10:44:41 PM »
We don't have a way to overlay the diff information into the current file.  Is that what you're looking for?  We've talked about this but figuring out how to show deleted lines and modified lines becomes a bit interesting.

If you want to just know what you've changed since you opened the file, you can open a C file, go to Document>C/C++ Options, select "View" and on the right side turn on Modified Lines.  This will show a different color for inserted and modified lines.  Does that approximate what you're looking for?

Also, if the issue isn't using the DIFFzilla editor but just that you don't want to go to a menu to activate it, you could bind the command svc-diff-with-tip to a key.

timur

  • Senior Community Member
  • Posts: 205
  • Hero Points: 3
Re: Highlighting lines that have been modified?
« Reply #4 on: March 04, 2019, 11:00:47 PM »
All I would like is a way to extend the "View Modified Lines" feature to show the modified lines since the last checkout from version control.  In other words, save this information with the file itself, so that if I exit and reload Slickedit, the same lines are still highlighted.

So for instance, instead of running svc-diff-with-tip, I could run a function called svc-resync-modified-lines-with-tip.  This would scan the current file, compare with the svc tip, and then highlight all the changed/added lines.  There'd be an option to run this command automatically whenever a file is opened.

svc-diff-with-tip is really cool as-is, and I'll be using it a lot, thanks.


Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Highlighting lines that have been modified?
« Reply #5 on: March 05, 2019, 11:42:34 AM »
I'll add a feature request for this.

To do this I'd like to go the extra mile and show deleted lines as imaginary (lines that don't save) in a strike through font.  Grouping them together properly becomes an issue.  Also in the difference editor we do intra-line differencing, where we show what changed on the line.  This is easy when there are two lines, but if we're only showing one, and something has been deleted from it, there's now way to show that except to show that it's different.

It inflates into something non-trivial pretty quickly.

JeffB

  • Senior Community Member
  • Posts: 326
  • Hero Points: 14
Re: Highlighting lines that have been modified?
« Reply #6 on: March 05, 2019, 07:31:34 PM »
As-is, the modified lines feature is rarely useful, due to closing/opening proejcts/files, submitting to git....

What I would find helpful is just a marker that shows where modifications have been made vs. the repo version.  So like what timur suggested, just a function that says re-mark added/modified lines based against the repo version. So, hit a key, all open files update themselves (also on file open).  Maybe some thin red line in between lines for deleted lines, but I could live without that.  For me this would make the modified lines feature actually useful.  I wouldn't really want a permanent inline diff (ala strikethrough font for deleted lines).

...my $.02

Jeff

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Highlighting lines that have been modified?
« Reply #7 on: March 05, 2019, 08:16:20 PM »
The line to show deleted lines is an interesting idea.

Outlier

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Re: Highlighting lines that have been modified?
« Reply #8 on: October 15, 2021, 03:15:07 AM »
I have just switched to SlickEdit from VSCode few days ago. May I know if this feature is done or not? and how to enable it? Since this feature is quite useful when I use VSCode, it would be great if SlickEdit supports it. Thank you for your attention.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Highlighting lines that have been modified?
« Reply #9 on: October 15, 2021, 02:09:42 PM »
Not yet, but we are making plans for it.  In the interim you might try Version Control>Get Blame from Git.
« Last Edit: October 15, 2021, 03:12:20 PM by Dan »