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

timur

  • Senior Community Member
  • Posts: 188
  • 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: 6127
  • Hero Points: 470
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: 188
  • 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: 2679
  • Hero Points: 143
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: 188
  • 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: 2679
  • Hero Points: 143
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: 314
  • 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: 2679
  • Hero Points: 143
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: 2679
  • Hero Points: 143
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 »