Skip to content

Commit

Permalink
Discard results if editor’s contents have been modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdoe committed Sep 9, 2017
1 parent e4cb025 commit 2d6af60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/linter-js-standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ module.exports = function (textEditor) {

return Q.allSettled(lintPromises)
.then(function (results) {
if (textEditor.getText() !== fileContent) {
// When the editor’s contents have been modified since we’ve started
// linting, we can’t be sure that the results are still valid.
// Therefore, we simply return `null` as not to update the results.
return null
}

var occurrences = []

results.forEach(function (result) {
Expand Down

0 comments on commit 2d6af60

Please sign in to comment.