Remove the highlighted line when editor lost focus. The behaviour is the same as Overlay mode.
What caused the issue
When using Underneath mode, the current line is highlighted by the current editor's layout manager. The editor is not aware when the focus changed to somewhere else, so the highlighted line remains there.
Why not happen in Overlay mode
In Overlay mode, when focus changed to another editor, the NSWindowDidBecomeKeyNotification will fire in the new editor. Then in moveBacklightInTextView: method, [self.currentBacklightView removeFromSuperview]; will execute and the old highlighted line will be removed.
Remove the highlighted line when editor lost focus. The behaviour is the same as Overlay mode.
What caused the issue
When using Underneath mode, the current line is highlighted by the current editor's layout manager. The editor is not aware when the focus changed to somewhere else, so the highlighted line remains there.
Why not happen in Overlay mode
In Overlay mode, when focus changed to another editor, the NSWindowDidBecomeKeyNotification will fire in the new editor. Then in
moveBacklightInTextView:
method,[self.currentBacklightView removeFromSuperview];
will execute and the old highlighted line will be removed.