Decorating the left Gutter?


Is there an api command for decorating the left gutter (similar to the built in git color coding is)? This would be very useful for linting.


+1 – I would also like to know this.


Hello guys,

You can find the gif-diff source here

In the GitDiffView source the gutter is retrieved at line 10 from the editor view:

{@editor, @gutter} = @editorView

Then, in the renderDiffs method the instance use the @gutter.addClassToLine method to set line gutter class. Since the @gutter property contains a jQuery object you can then search for lines, append stuff, add classes, and so on :).


Gutter decoration is definitely the wild west right now as we haven’t had time to create proper APIs for it. So just beware that it could change a fair amount once we add a decent API.

At this point, the bookmarks package is a reasonable example of what’s possible. Check out the constructor in where we bind to the editor:display-updated event and monkey with classes on the line numbers in the gutter. I wish this were better, but it should let you get the job done until a more convenient API evolves.