Creating a New Editor
- public function __construct($content) — Constructs an interactive editor, using the text of a document.
Editing Interactively
- public function editInteractively() — Launch an editor and edit the content. The edited content will be returned.
Configuring Options
- public function setLineOffset($offset) — Set the line offset where the cursor should be positioned when the editor opens. By default, the cursor will be positioned at the start of the content.
- public function getLineOffset() — Get the current line offset. See setLineOffset().
- public function setName($name) — Set the document name. Depending on the editor, this may be exposed to the user and can give them a sense of what they're editing.
- public function getName() — Get the current document name. See @{method:setName} for details.
- public function setContent($content) — Set the text content to be edited.
- public function getContent() — Retrieve the current content.
- public function setFallbackEditor($editor) — Set the fallback editor program to be used if the env variable $EDITOR is not available and there is no `editor` binary in PATH.
- public function setPreferredEditor($editor) — Set the preferred editor program. If set, this will override all other sources of editor configuration, like $EDITOR.
- public function setTaskMessage($task_message) — Set the message that identifies the task for which the editor is being launched, displayed to the user prior to it being launched.
- public function getTaskMessage() — Retrieve the current message that will display to the user just prior to invoking the editor.
- public function getEditor() — Get the name of the editor program to use. The value of the environmental variable $EDITOR will be used if available; otherwise, the `editor` binary if present; otherwise the best editor will be selected.
Other Methods
- public function __get($name)
- public function __set($name, $value)
- public function current()
- public function key()
- public function next()
- public function rewind()
- public function valid()
- private function throwOnAttemptedIteration()
- public function getPhobjectClassConstant($key, $byte_limit) — Read the value of a class constant.
- private function invokeEditor($editor, $path, $offset)