Skip to content

Commit

Permalink
decorateMarker refactor marker and message saving
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 22, 2020
1 parent bfb3c67 commit 053a2dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ class Editor {
const marker = textBuffer.markRange(markerRange, {
invalidate: 'never',
})
this.saveMarker(message.key, marker)
this.messages.set(message.key, message)
this.decorateMarker(message, marker)
marker.onDidChange(({ oldHeadPosition, newHeadPosition, isValid }) => {
if (!isValid || (newHeadPosition.row === 0 && oldHeadPosition.row !== 0)) {
Expand All @@ -327,6 +325,9 @@ class Editor {
this.updateTooltip(this.cursorPosition)
}
decorateMarker(message: LinterMessage, marker: Object, paint: 'gutter' | 'editor' | 'both' = 'both') {
this.saveMarker(message.key, marker)
this.messages.set(message.key, message)

if (paint === 'both' || paint === 'editor') {
this.textEditor.decorateMarker(marker, {
type: 'text',
Expand Down

0 comments on commit 053a2dd

Please sign in to comment.