Skip to content

Commit

Permalink
remove ;
Browse files Browse the repository at this point in the history
  • Loading branch information
guidezpl committed May 5, 2019
1 parent 9bd6d48 commit a5c6b49
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions lib/git-scroll-marker-binding.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
'use babel';
'use babel'

import { CompositeDisposable } from 'atom';
import { repositoryForPath } from './helpers';
import { CompositeDisposable } from 'atom'
import { repositoryForPath } from './helpers'

const MAX_BUFFER_LENGTH_TO_DIFF = 2 * 1024 * 1024;
const MAX_BUFFER_LENGTH_TO_DIFF = 2 * 1024 * 1024

export default class GitScrollMarkerBinding {
constructor(editor, scrollMarkerAPI) {
if (!editor) return console.warn('git-scroll-marker binding created without an editor');
if (!scrollMarkerAPI) throw Error('git-scroll-marker binding created without scrollMarkerAPI');
if (!editor) return console.warn('git-scroll-marker binding created without an editor')
if (!scrollMarkerAPI) throw Error('git-scroll-marker binding created without scrollMarkerAPI')

this.editor = editor;
this.addLayer = scrollMarkerAPI.getLayer(this.editor, "git-marker-layer-add", "#43d08a");
this.editLayer = scrollMarkerAPI.getLayer(this.editor, "git-marker-layer-edit", "#e0c285");
this.removeLayer = scrollMarkerAPI.getLayer(this.editor, "git-marker-layer-remove", "#e05252");
this.subscriptions = new CompositeDisposable();
this.editor = editor
this.addLayer = scrollMarkerAPI.getLayer(this.editor, "git-marker-layer-add", "#43d08a")
this.editLayer = scrollMarkerAPI.getLayer(this.editor, "git-marker-layer-edit", "#e0c285")
this.removeLayer = scrollMarkerAPI.getLayer(this.editor, "git-marker-layer-remove", "#e05252")
this.subscriptions = new CompositeDisposable()
this.updateDiffs = this.updateDiffs.bind(this)
}

Expand Down Expand Up @@ -54,7 +54,7 @@ export default class GitScrollMarkerBinding {
}

updateDiffs() {
console.log('updateDiffs');
console.log('updateDiffs')
if (this.editor.isDestroyed()) return
const path = this.editor && this.editor.getPath()
if (
Expand All @@ -74,34 +74,34 @@ export default class GitScrollMarkerBinding {
const endRow = newStart + newLines - 1
if (oldLines === 0 && newLines > 0) {
for (let row = startRow; row <= endRow; row++) {
this.addLayer.addMarker(row);
this.addLayer.addMarker(row)
}
} else if (newLines === 0 && oldLines > 0) {
if (startRow < 0) {
this.removeLayer.addMarker(0);
this.removeLayer.addMarker(0)
} else {
this.removeLayer.addMarker(startRow);
this.removeLayer.addMarker(startRow)
}
} else {
for (let row = startRow; row <= endRow; row++) {
this.editLayer.addMarker(row);
this.editLayer.addMarker(row)
}
}
}
}

removeDecorations() {
this.addLayer.clear();
this.editLayer.clear();
this.removeLayer.clear();
this.addLayer.clear()
this.editLayer.clear()
this.removeLayer.clear()
}

cancelUpdate() {
clearImmediate(this.immediateId);
clearImmediate(this.immediateId)
}

scheduleUpdate(editor) {
this.cancelUpdate();
this.immediateId = setImmediate(this.updateDiffs);
this.cancelUpdate()
this.immediateId = setImmediate(this.updateDiffs)
}
};
}

0 comments on commit a5c6b49

Please sign in to comment.