Possible Bug, inconsistency with eachEditorView


#1

atom.workspaceView.eachEditorView seems to be inconsistent.

It gets the current views by calling getEditorViews() which returns only those under “.pane .item-views .editor” but the callback is set on all new editors (which emit “editor:attached”).

My specific use case was this: I tried setting up extra stuff on the find-and-replace search editor (where you type what to search), because it is not under “.pane .item-views”.

So I was using eachEditorView which worked fine until I made my plugin activate on a specific keymap. Now if I activate my plugin before ever showing the find-and-replace view it will be okay, otherwise no.

I propose you chose of:

  1. eachEditorView takes in account all .editor from the workspaceView that already exist
  2. When you set up the callback on editor:activate you add an extra check to verify it is under “.pane .item-views”

I would personally go with 1) :smile: