First, let's start with creating a vocabulary for our editor:
"editors.foo" scaffold-basis
Open it up in your favourite editor (or your second favourite.)
To create a new integration, we need to implement the editor protocol:
•
Define a new class to represent your integration, set in editor-class
•
Define an editor-command method to construct a command that opens your editor
•
Define an editor-detached? method that denotes whether your editor should be run in detached mode. This should return t for editors that run in a separate terminal.
•
Define an editor-is-child? method that tells Factor whether it should be eun as a child process.
Every editor is required to reserve its own editor-class. For example:
SINGLETON: foo
editor-class will be set to this singleton when Factor is set to use your editor of choice. Now, we will define words that will dispatch when the editor class is set to foo.
editor-command takes a file path and line number as strings. Your implementation should form a command that opens the editor to the given line. Many editors have a + option for this. For a simple example of this word's implementation, we can look at editors.gedit: