Closed sbrl closed 3 years ago
I can reproduce this. I will look into it tonight.
looks like the issue is in minimap
@aminya it looks like minimap becomes null when using zen mode
I haven't used Zen mode before. We should also fix the error message. Does it seem that one of the packages is modifying the MinimapElement
? If you can reproduce it, it would be nice to get a PR.
It seems like zen mode toggles minimap but minimap doesn't stop trying to create markers.
Toggling works without issues unless you overdo it consecutively and close/open text editors multiple times (#772). Once Minimap.destory
is called inside toggle the classes become null.
https://github.com/atom-minimap/minimap/blob/47cb1088e57c194d90890c638eb1ea647d7973fe/lib/main.js#L166
The solution is that the plugins should check if what they are getting is valid. They should check if the return of the old API is valid (non-null). https://github.com/atom-minimap/minimap/blob/47cb1088e57c194d90890c638eb1ea647d7973fe/lib/minimap.js#L1131
The other solution is to use the new DecorationsManagement API from the minimapElement
and not minimap.
We can also do something like the following if the plugins don't already do the null check. In this case, we should return null
from getDecorationManagement
instead of throwing, and then return an empty array, which keeps the API type-safe preventing null-bugs
getDecorations() {
return this.getDecorationManagement()?.getDecorations() ?? []
}
:tada: This issue has been resolved in version 4.39.14 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Reproduction steps
zen
,highlight-selected
, andminimap-highlight-selected
This bug was also previously reported here which was apparently a duplicate of this bug, but ultimately it was determined that the bug is located in this package, not
highlight-selected
.Atom: 1.56.0 x64 Electron: 9.4.4 OS: Ubuntu 20.10 Thrown From: highlight-selected package 0.17.0
Stack Trace
Uncaught TypeError: Converting circular structure to JSON --> starting at object with constructor 'TextEditor' | property 'decorationManager' -> object with constructor 'DecorationManager' --- property 'editor' closes the circle
Commands
Non-Core Packages