Closed savetheclocktower closed 1 year ago
If anyone else is affected by this bug and has found this issue: adding this to my init.js
has solved it well enough for now.
atom.workspace.observeTextEditors(textEditor => {
// Only occurs with new (untitled) documents.
if (textEditor.getPath() !== undefined) { return; }
setTimeout(() => {
let decorations = textEditor.getDecorations();
let toBeDeleted = decorations.filter(d => {
if (d.properties.gutterName === 'linter-ui-default') { return true; }
if (d.properties.class.includes('linter')) { return true; }
return false;
});
for (let d of toBeDeleted) {
d.destroy();
}
}, 50);
});
@savetheclocktower Thank you for the quick fix, works great for me, hopefully changing the one line will be sufficient
@savetheclocktower thank you for the temporary fix, but I hope the fix will published at pulsar package repository
PRs are welcome
Let's say I've got a file open with some linter annotations.
If I do Cmd-N from here, I get a new untitled file and an empty text editor… but it's already got a gutter marker.
And at least one display marker for the text.
I've tracked down the culprit. The
filterMessages
function will not filter out any messages ifTextEditor#getPath()
returnsundefined
, as it does for a brand-new file. So the new file inherits all the messages that were present in the original file. The markers, having been asked to mark invalid ranges, instead all mark from (0, 0) to (0, 0). The marker range grows as the user types.This issue was introduced in this commit, in which an explicit
null
check was changed to a “falsy” check.If this line was changed because of an oversight, then the fix is a one-liner. If this line was changed on purpose, and there is some other reason why it can't be reverted to the original
null
check, then the fix is not straightforward. @aminya, if you happen to remember, please let me know. If I don't hear otherwise I'll probably contribute the simple fix in a few days.(I am aware that Atom has been discontinued, but I continue to use this package via Pulsar. They've reverse-engineered the package repository, so I think that publishing a new version of this package for Pulsar users would be pretty straightforward.)