Multiple view of the same atom-text-editor


#1

I’m trying to create a package that partly involves displaying multiple atom-text-editor s on one same pane. A user can put a atom-text-editor of an existing text editor on that pane, which involves using a package command, that command does these:

var textEditor = atom.workspace.getActiveTextEditor();
var textEditorContent = textEditor.getText();
var bubble = document.createElement('atom-text-editor');
var model = bubble.getModel();


model.insertText(textEditorContent);

#2

I clicked submit by accident, let me continue the question with a reply:
…and lastly I append the “bubble” variable to the root element.

What can I do, so that editing a text editor on the package pane will also trigger a change in the original active text editor?


#3

I’d look at how the command Pane: Split Right does it. When you have the same file open in both panes, the changes should be synced.