Skip to content

nav-panel is not always visible when Atom starts #19

@johnarwe

Description

@johnarwe

For example, this will reproduce the problem on Windows 10:

  1. Start an instance of Atom, open a file that results in visible markers in the panel.
  2. Terminate Atom normally, e.g. using the window X control at upper right.
  3. Start Atom again... the file open in step 1 will open again, but no markers will be visible.
    1. Toggle nav-panel-plus ... no change.
    2. Switch focus to the tree view and back to the file, or save the file,... markers become visible.

The cause is that nav-panel's activate() implementation does not populate the view for the active editor, and atom.workspace.onDidStopChangingActivePaneItem subscription does not fire when the editor is first opened; it fires when you change focus away from a file editor. Saving the file works because nav-panel adds on-save callbacks.

I am constructing a pull request to fix this, probably using observeTextEditors, but it's not quite ready yet. I don't know of any guarantee that editors are active at the point in time when activate() is called, so I'm reluctant to rely on getActiveTextEditor() in the constructor ... and doing that would have other side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions