Module modules.scite.snippets

Provides Textmate-like snippets for the scite module. There are several option variables used: PLATFORM: OS platform (linux or windows). MARK_SNIPPET: The integer mark used to identify the line that marks the end of a snippet. SCOPES_ENABLED: Flag indicating whether scopes/styles can be used for snippets. FILE_IN: Location of the temporary file used as STDIN for regex mirrors. FILE_OUT: Location of the temporary file that will contain output for regex mirrors. REDIRECT: The command line symbol used for redirecting STDOUT to a file. RUBY_CMD: The command that executes the Ruby interpreter. MARK_SNIPPET_COLOR: The Scintilla color used for the line that marks the end of the snippet.

Functions

_DEBUG (text) [Local function] Called for printing debug text if DEBUG flag is set.
cancel_current () Cancels active snippet, reverting to the state before the snippet was activated.
escape (text) [Local function] Replace escaped snippet characters with their octal equivalents.
insert (snippet_arg) Begins expansion of a snippet.
join_lines () [Local function] Joins current line with the line below it, eliminating whitespace.
list () List available snippet triggers as an autocompletion list.
match_indention (ref_line, num_lines) [Local function] When snippets are inserted, match their indentation level with their surroundings.
next_snippet_item () [Local function] Mirror or transform most recently modified field in the current snippet and move on to the next field.
prev () Goes back to the previous placeholder or tab stop, reverting changes made to subsequent ones.
remove_escapes (text) [Local function] Remove escaping forward-slashes from escaped snippet characters.
show_scope () Show the scope/style at the current caret position as a calltip.
snippet_text () [Local function] Gets the text of the snippet.
unescape (text) [Local function] Replace octal snippet characters with their escaped equivalents.

Tables

snippet [Local table] The current snippet.
snippet_stack [Local table] The stack of currently running snippets.
snippets Global container that holds all snippet definitions.


Functions

_DEBUG (text)
[Local function] Called for printing debug text if DEBUG flag is set.

Parameters

  • text: Debug text to print.
cancel_current ()
Cancels active snippet, reverting to the state before the snippet was activated.
escape (text)
[Local function] Replace escaped snippet characters with their octal equivalents.

Parameters

  • text:
insert (snippet_arg)
Begins expansion of a snippet.

Parameters

  • snippet_arg: Optional snippet to expand. If none is specified, the snippet is determined from the trigger word to the left of the caret, the lexer, and scope.
join_lines ()
[Local function] Joins current line with the line below it, eliminating whitespace. This is used to remove the empty line containing the end of snippet marker.
list ()
List available snippet triggers as an autocompletion list. Global snippets and snippets in the current lexer and scope are used.
match_indention (ref_line, num_lines)
[Local function] When snippets are inserted, match their indentation level with their surroundings.

Parameters

  • ref_line:
  • num_lines:
next_snippet_item ()
[Local function] Mirror or transform most recently modified field in the current snippet and move on to the next field.
prev ()
Goes back to the previous placeholder or tab stop, reverting changes made to subsequent ones.
remove_escapes (text)
[Local function] Remove escaping forward-slashes from escaped snippet characters. At this point, they are no longer necessary.

Parameters

  • text:
show_scope ()
Show the scope/style at the current caret position as a calltip.
snippet_text ()
[Local function] Gets the text of the snippet. This is the text bounded by the start of the trigger word to the end snippet marker on the line after the snippet's end.
unescape (text)
[Local function] Replace octal snippet characters with their escaped equivalents.

Parameters

  • text:

Tables

snippet
[Local table] The current snippet.
snippet_stack
[Local table] The stack of currently running snippets.
snippets
Global container that holds all snippet definitions.

Valid XHTML 1.0!