Skip to content

Commit

Permalink
Add Unique Marker Names & Info Marker
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlyons0 committed Sep 11, 2018
1 parent bba312a commit 5c6d000
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/lint-scroll-marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ async function clearLayerForMessage(message, cleanedLayers) {
return;
}

const errorMarkerLayer = scrollMarker.getLayer(editor, "lint-scroll-marker", "#fb392e");
const warnMarkerLayer = scrollMarker.getLayer(editor, "link-scroll-marker", "#ffaa00");
const errorMarkerLayer = scrollMarker.getLayer(editor, "lint-scroll-marker-error", "#fb392e");
const warnMarkerLayer = scrollMarker.getLayer(editor, "link-scroll-marker-warn", "#fd8926");
const infoMarkerLayer = scrollMarker.getLayer(editor, "link-scroll-marker-info", "rgba(20, 146, 255, 0.69)");

await errorMarkerLayer.clear();
await warnMarkerLayer.clear();
await infoMarkerLayer.clear();

cleanedLayers.push(lintMessage.location.file);
}
Expand All @@ -51,11 +53,14 @@ function addMarkerForMessage(message) {
return;
}

const errorMarkerLayer = scrollMarker.getLayer(editor, "lint-scroll-marker", "#fb392e");
const warnMarkerLayer = scrollMarker.getLayer(editor, "link-scroll-marker", "#ffaa00");
const errorMarkerLayer = scrollMarker.getLayer(editor, "lint-scroll-marker-error", "#fb392e");
const warnMarkerLayer = scrollMarker.getLayer(editor, "link-scroll-marker-warn", "#fd8926");
const infoMarkerLayer = scrollMarker.getLayer(editor, "link-scroll-marker-info", "rgba(20, 146, 255, 0.69)");

if(lintMessage.type === "Warning")
warnMarkerLayer.addMarker(lintMessage.location.position.start.row);
else if(lintMessage.type === "Info")
infoMarkerLayer.addMarker(lintMessage.location.position.start.row);
else
errorMarkerLayer.addMarker(lintMessage.location.position.start.row);
}
Expand Down

0 comments on commit 5c6d000

Please sign in to comment.