SearchSettings#
Superclasses: Object
Search settings.
A GtkSourceSearchSettings object represents the settings of a search. The
search settings can be associated with one or several
SearchContexts.
Constructors#
- class SearchSettings
- classmethod new() SearchSettings#
Creates a new search settings object.
Methods#
- class SearchSettings
-
- get_search_text() str | None#
Gets the text to search.
The return value must not be freed.
You may be interested to call
utils_escape_search_textafter this function.
- set_at_word_boundaries(at_word_boundaries: bool) None#
Change whether the search is done at word boundaries.
If
at_word_boundariesisTrue, a search match must start and end a word. The match can span multiple words. See alsostarts_wordandends_word.- Parameters:
at_word_boundaries – the setting.
- set_case_sensitive(case_sensitive: bool) None#
Enables or disables the case sensitivity for the search.
- Parameters:
case_sensitive – the setting.
- set_regex_enabled(regex_enabled: bool) None#
Enables or disables whether to search by regular expressions.
If enabled, the
search_textproperty contains the pattern of the regular expression.SearchContextusesRegexwhen regex search is enabled. See the Regular expression syntax page in the GLib reference manual.- Parameters:
regex_enabled – the setting.
- set_search_text(search_text: str | None = None) None#
Sets the text to search.
If
search_textisNoneor is empty, the search will be disabled. A copy ofsearch_textwill be made, so you can safely freesearch_textafter a call to this function.You may be interested to call
utils_unescape_search_textbefore this function.- Parameters:
search_text – the nul-terminated text to search, or
Noneto disable the search.
- set_visible_only(visible_only: bool) None#
Enables or disables whether to exclude invisible text from the search.
If enabled, only visible text will be searched. A search match may have invisible text interspersed.
Added in version 5.12.
- Parameters:
visible_only – the setting.
- set_wrap_around(wrap_around: bool) None#
Enables or disables the wrap around search.
If
wrap_aroundisTrue, the forward search continues at the beginning of the buffer if no search occurrences are found. Similarly, the backward search continues to search at the end of the buffer.- Parameters:
wrap_around – the setting.
Properties#
- class SearchSettings
Fields#
- class SearchSettings
- parent_instance#