-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use decorations API #147
Use decorations API #147
Conversation
This new API is designed exactly for our use case. One benefit is that `GutterView.render` is now no longer called hundreds of times a second (!) I copied most of the implementation from the git-diff package. Test plan: Opened a new editor and verified that gutter markers appear and disappear when lint errors are caused and resolved. Also added a logging statement to `GutterView.render` to verify that it's now only called when the file is linted.
Again the implementation is inspired by the git-diff package. Test Plan: Opened a new editor and verified that highlights show up. I had to tweak the indexing for columns after noticing that errors on the final line didn't show up after this change.
Since `GutterView` and `HighlightsView` were basically the same thing, I extracted out the shared code to `LinterView` and deleted them. Test Plan: Opened a file with lint errors. In another Atom window, went to settings and turned gutter and highlights on and off and made sure that these settings still updated in the other window.
# errors on line 1 | ||
if (rowStart == -1) | ||
rowStart = rowEnd = 0 | ||
decrementParse = (x) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a lot of places we need to decrement a base-1 index into a base-0 index. This function does that, as well as parses as an integer and makes sure we don't end up with -1
.
I'm finished with this now, can someone review and consider merging? |
Conflicts: lib/linter-view.coffee
FYI this conflicts with #137. If you pull one of them I can fix up the other one. |
ok. please fix #137 |
I'm converting the gutter and highlights view to use the new decorations API.
This is good because it lets us delete a lot of functionality that's now provided by core Atom.