Plugins - RedHatter/Splat GitHub Wiki

Document

Handles the base TextView. Also contains the gutter (line numbers).

document.new [title=Untitled] [id?]
Creates a new document named title. If id is set will attempt to load contents from cache.
Returns the document id.

document.insert [id] [text] [location=*]
Inserts text at location in document signified by id. location defaults to end of document.

document.delete [id] [start] [end]
Removes the segment start to end from the document signified by id.

document.contents [id] [start=0] [end=?]
Returns the segment start to end from the document signified by id. end defaults to the end of the document.

document.active
Returns the id of the last active (focused) document.

Partial - needs more commands.

Files

All file related operations.

files.save [id] [path=?]
Writes the contents of the document signified by id to the file at path. If path is absent will attempt to retrieve where it was loaded from.

files.open [path]
Opens a new document from file at path.
Returns the id of the new document.

files.dialog [isOpen=true]
Opens a dialog for the user to select a file. Returns the path to the file the user picked.

Partial - Unimplemented features.

  • Menu item for recently open files.
  • Open dialog in working directory or last open directory.
  • Drag and drop files to load.

History

Undo and redo.

history.undo [id]
Steps the stack for id back.

history.redo [id]
Steps the stack for id forward.

history.panel
Open a view of the stack.
Note: Can only be one history view. It will show the active document.

Partial - Unimplemented features.

  • Undo in selection.
  • Undo an edit not at the head of the stack.
  • On new edit instead of erasing undone edits split the stack.
  • Save/load undo stack.
  • History view should show where the stack head is.
  • The stack LinkedList is unneeded. Use the TreeStore directly.

Search

Find, find and replace, goto etc.

search.panel
Opens search gui.

search.set_flags [flag] ...
Set all flags to true.

     flags
---------------
REGEX              Is search a regular expression?  
CASELESS           Is search case sensitive?  
SCOPE_FILE         Search in active file.  
SCOPE_ALL_FILES    Search in all open files.  
SCOPE_SELECTION    Search in selection.

search.clear_flags [flag] ...
Set all flags to false.

search.set_search [search] [replace]
Set next search to find search and replace with replace.

search.find_next [id] [pos=?]
Highlight the next match. Call set_search first pos defaults to last match or cursor position.

search.find_prv [id] [pos=?]
Same as find_next, search backwards.

search.replace_all [id]
Replace all matches.

search.replace [id] [pos=?]
Replace next match. pos defaults to last match or cursor position.

Partial - Unimplemented features.

  • Find all.
  • Highlight all matches.
  • Quick find floating input.
  • Multi-line entries.

Syntax

AST building and theming (syntax highlighting). Sublime and TextMate language and theme definitions formate.

syntax.set_theme [id] [theme]
Sets the theme of document id.

Syntax.set_lang [id] [lang]
Sets the language of document id.

Partial - Unimplemented features.

  • Implement language context, and import from other language.
  • Overlapping tags (vala return types?).
  • Guess language from file name.
  • Restyle on delete.
  • Asynchronous styling.