Sublime Forum

Highlighting lines changed from the last commit

#1

Hi,

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

github.com/gornostal/Modific

Unfortunately, with existing ST2 API it’s impossible to duplicate Netbeans feature :frowning:

So, what do you think?
What can be improved?

0 Likes

Andy Edits
#2

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.

0 Likes

Highlight changed rows
#3

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: Hightlight changed row

0 Likes

#4

You can use your own icons, look at https://github.com/facelessuser/BracketHighlighter for example.

0 Likes

#5

[quote=“sanya-g”]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: https://forum.sublimetext.com/t/hightlight-changed-row/3187/1[/quote]

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

0 Likes

#6

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?

0 Likes

#7

[quote=“sanya-g”]

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?[/quote]

“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.

0 Likes

#8

Oh, now I see why you need that.

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

0 Likes

#9

[quote=“sanya-g”]

Oh, now I see why you need that.

Then you should probably make your own plugin. Is not as hard as it seems.[/quote]

I do not know python programming, so, its quite difficult for me to do that. :frowning:

0 Likes

#10

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 :smile:
Thanks.

0 Likes

#11
  1. How does it complain? Is it shows you an error dialog or it just print error to the console?
  2. Maybe try to turn off autosaving in configuration.

And If you have some issues with plugin it would be better to post it on github.

0 Likes

#12

Hi,

  1. It’s an error dialog window, I’ll screenshot it if I get it again.
  2. I’ll try that, thanks

Next reports will be done in github if I have to report.

Edit : just got the case now : THe file is sometimes restored even without asking me about saving the buffer but I can’t reproduce it :\

0 Likes

#13

This is awesome, thank you very much for working on this. I must buy you a coffee!

0 Likes

#14

It seems to be seeking git in /usr/bin/git which triggers an annoying error dialog on OSX.

How can I specify the correct path to git?

0 Likes