This makes observeActiveTextEditor consistent with observers like
observeActivePaneItem, which always invoke the callback with the current
value, regardless of whether that value is undefined or not.
Fixes the following bug:
1. Open Atom
2. Open a file
3. Observe the file's encoding in the status bar
4. Reload Atom
5. Close the file
6. Observe that the closed file's encoding is still present in the
status bar
This bug occured because the reload did not deserialize/serialze the
workspace's active text editor state. As a result, when closing the
text editor in step 5, we failed to notify observers that there is no
longer an active text editor.
We're updating Atom to disallow editors in docks. As a result, we need
to remove Dock::getTextEditors(). Normally, we would deprecate a method
before removing it, but this method is broken and has never worked:
atom.workspace.getLeftDock().getTextEditors()
(unknown) Uncaught TypeError: this.paneContainer.getTextEditors is not a function
at Dock.getTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:590:37)
at <anonymous>:1:30
Since the method is broken, we know that nobody is relying on it.
Instead of deprecating the method, we can just remove it.
We're updating Atom to disallow editors in docks. As a result, we need
to remove Dock::observeTextEditors(callback). Normally, we would
deprecate a method before removing it, but this method is broken and has
never worked:
atom.workspace.getLeftDock().observeTextEditors(console.log)
(unknown) Uncaught TypeError: this.paneContainer.getTextEditors is not a function
at Dock.getTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:590:37)
at Dock.observeTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:396:41)
at <anonymous>:1:30
getTextEditors @ <embedded>:29933
observeTextEditors @ <embedded>:29739
(anonymous) @ VM1941:1
Since the method is broken, we know that nobody is relying on it.
Instead of deprecating the method, we can just remove it.