Plugin That Create Panel For Specific Editor


#1

I’m trying to write an Atom plugin that add a panel to a text editor. The panel need to she few buttons for compiling the active text editor file and an output text area.
From what I’ve seen so far the only way to add panel in Atom is to the whole workspace which means if the user tab away to another file or close the file the plugin’s panel remain there “detached” from the active editor.

I guess it is possible to simulate the link between the active editor and the panel by listen to workspace events but I think it’s a common requirements.

Any help will be great.

Thank you,
Ido.


#2

The Atom API doesn’t have a way to create a panel that is attached to a specific pane item. Panels are attached to the edges of the pane area. The pane area itself can be subdivided multiple times by splitting panes. If you want to have a panel attached to a specific pane item, then you should probably create a pane item that contains your panel and the text editor as two components. This is the only UI construct that I can think of that wouldn’t have edge cases around split panes and switching tabs.


#3

Thanks. I’ve found minimap plugin which listen to events and add the minimap-element to each editor-element - I’ll try to follow that example.