Class: GtkSource::Snippet

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ GtkSource::Snippet

Parses the snippet formatted text into a series of chunks and adds them to a new Gtk::SourceSnippet.

Parameters:

  • text (String)

    the formatted snippet text to parse

Instance Method Details

#add_chunk(chunk) ⇒ nil

Appends chunk to the snippet.

This may only be called before the snippet has been expanded.

Parameters:

Returns:

  • (nil)

#bufferGtk::TextBuffer

Returns buffer.

Returns:

#buffer=(buffer) ⇒ Gtk::TextBuffer

Parameters:

Returns:

#contextGtkSource::SnippetContext

Gets the context used for expanding the snippet.

Returns:

#copyGtkSource::Snippet

Does a deep copy of the snippet.

Returns:

#descriptionString

Returns description.

Returns:

  • (String)

    description

#description=(description) ⇒ String

Parameters:

  • description (String)

Returns:

  • (String)

    description

  • (String)

    description

#focus_positionInteger

Returns focus-position.

Returns:

  • (Integer)

    focus-position

#focus_position=(focus_position) ⇒ Integer

Parameters:

  • focus_position (Integer)

Returns:

  • (Integer)

    focus-position

  • (Integer)

    focus-position

#get_nth_chunk(nth) ⇒ GtkSource::SnippetChunk

Gets the chunk at nth.

Parameters:

  • nth (Integer)

    the nth chunk to get

Returns:

#language_idString

Returns language-id.

Returns:

  • (String)

    language-id

#language_id=(language_id) ⇒ String

Parameters:

  • language_id (String)

Returns:

  • (String)

    language-id

  • (String)

    language-id

#n_chunksInteger

Gets the number of chunks in the snippet.

Note that not all chunks are editable.

Returns:

  • (Integer)

    The number of chunks.

#nameString

Returns name.

Returns:

  • (String)

    name

#name=(name) ⇒ String

Parameters:

  • name (String)

Returns:

  • (String)

    name

  • (String)

    name

#triggerString

Returns trigger.

Returns:

  • (String)

    trigger

#trigger=(trigger) ⇒ String

Parameters:

  • trigger (String)

Returns:

  • (String)

    trigger

  • (String)

    trigger