Class: GtkSource::Completion

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.fuzzy_highlight(haystack, casefold_query) ⇒ Pango::AttrList

This will add <b> tags around matched characters in haystack based on casefold_query.

Parameters:

  • haystack (String)

    the string to be highlighted

  • casefold_query (String)

    the typed-text used to highlight haystack

Returns:

  • (Pango::AttrList)

    a Pango::AttrList or nil

.fuzzy_match(haystack, casefold_needle, priority) ⇒ Boolean

This helper function can do a fuzzy match for you giving a haystack and casefolded needle.

Casefold your needle using [funcGLib.utf8_casefold] before running the query.

Score will be set with the score of the match upon success. Otherwise, it will be set to zero.

Parameters:

  • haystack (String)

    the string to be searched.

  • casefold_needle (String)

    A g_utf8_casefold() version of the needle.

  • priority (Integer)

    An optional location for the score of the match

Returns:

  • (Boolean)

    true if haystack matched casefold_needle, otherwise false.

Instance Method Details

#add_provider(provider) ⇒ nil

Adds a [ifaceCompletionProvider] to the list of providers to be queried for completion results.

Parameters:

Returns:

  • (nil)

#block_interactivenil

Returns:

  • (nil)

#bufferGtk::TextView

The Gtk::TextBuffer for the #GtkSourceCompletion:view. This is a convenience property for providers.

Returns:

#buffer=(buffer) ⇒ Gtk::TextView

The Gtk::TextBuffer for the #GtkSourceCompletion:view. This is a convenience property for providers.

Parameters:

Returns:

#hidenil

Emits the "hide" signal.

When the "hide" signal is emitted, the completion window will be dismissed.

Returns:

  • (nil)

#page_sizeInteger

The number of rows to display to the user before scrolling.

Returns:

  • (Integer)

    page-size

#page_size=(page_size) ⇒ Integer

The number of rows to display to the user before scrolling.

Parameters:

  • page_size (Integer)

Returns:

  • (Integer)

    page-size

  • (Integer)

    page-size

#remember_info_visibility=(remember_info_visibility) ⇒ Boolean

Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.

Parameters:

  • remember_info_visibility (Boolean)

Returns:

  • (Boolean)

    remember-info-visibility

  • (Boolean)

    remember-info-visibility

#remember_info_visibility?Boolean

Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.

Returns:

  • (Boolean)

    remember-info-visibility

#remove_provider(provider) ⇒ nil

Removes a [ifaceCompletionProvider] previously added with [methodCompletion.add_provider].

Parameters:

Returns:

  • (nil)

#select_on_show=(select_on_show) ⇒ Boolean

Determines whether the first proposal should be selected when the completion is first shown.

Parameters:

  • select_on_show (Boolean)

Returns:

  • (Boolean)

    select-on-show

  • (Boolean)

    select-on-show

#select_on_show?Boolean

Determines whether the first proposal should be selected when the completion is first shown.

Returns:

  • (Boolean)

    select-on-show

#shownil

Emits the "show" signal.

When the "show" signal is emitted, the completion window will be displayed if there are any results available.

Returns:

  • (nil)

#show_icons=(show_icons) ⇒ Boolean

The "show-icons" property denotes if icons should be displayed within the list of completions presented to the user.

Parameters:

  • show_icons (Boolean)

Returns:

  • (Boolean)

    show-icons

  • (Boolean)

    show-icons

#show_icons?Boolean

The "show-icons" property denotes if icons should be displayed within the list of completions presented to the user.

Returns:

  • (Boolean)

    show-icons

#unblock_interactivenil

Returns:

  • (nil)

#viewGtkSource::View

The "view" property is the Gtk::TextView for which this #GtkSourceCompletion is providing completion features.

Returns:

#view=(view) ⇒ GtkSource::View

The "view" property is the Gtk::TextView for which this #GtkSourceCompletion is providing completion features.

Parameters:

Returns: