Home Download Buy Blog Forum Support

Highlighting lines changed from the last commit

Highlighting lines changed from the last commit

Postby sanya-g on Mon Jun 11, 2012 3:33 pm

Hi,

Inspired by Netbeans feture, I've created a plugin for highlighting lines changed from the last commit.

https://github.com/gornostal/Modific

Unfortunately, with existing ST2 API it's impossible to duplicate Netbeans feature :(

So, what do you think?
What can be improved?
sanya-g
 
Posts: 9
Joined: Fri May 11, 2012 6:24 am

Re: Highlighting lines changed from the last commit

Postby singw on Mon Jun 18, 2012 4:05 am

Is it possible to show the line Edited and Saved since the file is opened (without using any version control) with one color, and the line Edited but not saved yet with another color? Just like the screenshot I uploaded.
Attachments
notepad-mod-plugin.png
notepad-mod-plugin.png (40.99 KiB) Viewed 8921 times
singw
 
Posts: 59
Joined: Fri Aug 05, 2011 2:16 pm

Re: Highlighting lines changed from the last commit

Postby sanya-g on Mon Jun 18, 2012 6:29 am

It's all possible except drawing lines (with existing API you can only draw dots, circles or bookmark icons).

Here is a plugin that highlights unsaved rows: viewtopic.php?f=2&t=3796
sanya-g
 
Posts: 9
Joined: Fri May 11, 2012 6:24 am

Re: Highlighting lines changed from the last commit

Postby bizoo on Mon Jun 18, 2012 6:40 am

sanya-g wrote:It's all possible except drawing lines (with existing API you can only draw dots, circles or bookmark icons).

You can use your own icons, look at https://github.com/facelessuser/BracketHighlighter for example.
bizoo
 
Posts: 879
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Highlighting lines changed from the last commit

Postby singw on Tue Jun 19, 2012 6:37 am

sanya-g wrote:It's all possible except drawing lines (with existing API you can only draw dots, circles or bookmark icons).

Here is a plugin that highlights unsaved rows: viewtopic.php?f=2&t=3796

That means your plugin must be used with a VCS? :cry:
singw
 
Posts: 59
Joined: Fri Aug 05, 2011 2:16 pm

Re: Highlighting lines changed from the last commit

Postby sanya-g on Tue Jun 19, 2012 9:54 am

singw wrote:That means your plugin must be used with a VCS? :cry:


Yes, that's the idea of my plugin.

I don't understand how highlighting of unsaved changes might be useful.
I hit Ctrl+S every time I enter a new word or a sentence.

Why do you need that?
sanya-g
 
Posts: 9
Joined: Fri May 11, 2012 6:24 am

Re: Highlighting lines changed from the last commit

Postby singw on Tue Jun 19, 2012 10:23 am

sanya-g wrote:
singw wrote:That means your plugin must be used with a VCS? :cry:


Yes, that's the idea of my plugin.

I don't understand how highlighting of unsaved changes might be useful.
I hit Ctrl+S every time I enter a new word or a sentence.

Why do you need that?


"I hit Ctrl+S every time I enter a new word or a sentence." <- yes, me too.

That's why I need 2 functions:
1) mark the line Edited and Saved (Ctrl+S) since the file is opened (without using any version control) with one color (say Green).
2) mark the line Edited but not saved yet (not Ctrl+S yet) with another color (say Yellow).

as a result, you can see which lines has been edited since it was opened by looking the Green colored mark. That's what I intended.
singw
 
Posts: 59
Joined: Fri Aug 05, 2011 2:16 pm

Re: Highlighting lines changed from the last commit

Postby sanya-g on Tue Jun 19, 2012 11:15 am

singw wrote:mark the line Edited and Saved (Ctrl+S) since the file is opened

Oh, now I see why you need that.

Then you should probably make your own plugin. Is not as hard as it seems.
sanya-g
 
Posts: 9
Joined: Fri May 11, 2012 6:24 am

Re: Highlighting lines changed from the last commit

Postby singw on Wed Jun 20, 2012 2:08 am

sanya-g wrote:
singw wrote:mark the line Edited and Saved (Ctrl+S) since the file is opened

Oh, now I see why you need that.

Then you should probably make your own plugin. Is not as hard as it seems.


I do not know python programming, so, its quite difficult for me to do that. :(
singw
 
Posts: 59
Joined: Fri Aug 05, 2011 2:16 pm

Re: Highlighting lines changed from the last commit

Postby Xaapyks on Wed Jul 25, 2012 2:17 pm

This plugin is really nice, I've been using for some time now and it's very useful.

I found 2 issues with it though:

- Sometimes, I think when a file is missing, it complains about the svn binary not being in my path, when nothing had been changed.
- When I "svn rm" a file that is open in ST2, and close this file, ST2 asks if I want to save, I say "No" and then my file is reverted

These bugs are a bit annoying but aside from this it's a very handy plugin :)
Thanks.
Xaapyks
 
Posts: 34
Joined: Tue Apr 17, 2012 8:33 am

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests