Implementing a custom file editor


#1

I’d like to add a non-text based editor to Atom for certain file types. Is there a way to capture the file->open intent?

I looked at the CommandRegistry docs, but can’t find any list of the commands that are available to listen to.

Thanks!


#2

I think you want atom.workspace::addOpener().


#3

Check out html-tab for a tiny example package to use openers and arbitrary html in a tab.


#4

Awesome!

Does the object returned from the closure passed to addOpener() just need to implement dispose(), or must it have Disposable in the prototype chain?


#5

Thanks. I might go this route too, since I want to edit HTML and share a TextBuffer with any other TextEditors open on the same file.


#6

All that is needed to implement Dispose is to have a dispose() method.