:right-sidebar: True SearchSettings =================================================================== .. currentmodule:: gi.repository.GtkSource .. class:: SearchSettings(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Search settings. A ``GtkSourceSearchSettings`` object represents the settings of a search. The search settings can be associated with one or several :obj:`~gi.repository.GtkSource.SearchContext`\s. Constructors ------------ .. rst-class:: interim-class .. class:: SearchSettings :no-index: .. classmethod:: new() -> ~gi.repository.GtkSource.SearchSettings Creates a new search settings object. Methods ------- .. rst-class:: interim-class .. class:: SearchSettings :no-index: .. method:: get_at_word_boundaries() -> bool .. method:: get_case_sensitive() -> bool .. method:: get_regex_enabled() -> bool .. method:: get_search_text() -> str | None Gets the text to search. The return value must not be freed. You may be interested to call :obj:`~gi.repository.GtkSource.utils_escape_search_text` after this function. .. method:: get_visible_only() -> bool .. versionadded:: 5.12 .. method:: get_wrap_around() -> bool .. method:: set_at_word_boundaries(at_word_boundaries: bool) -> None Change whether the search is done at word boundaries. If ``at_word_boundaries`` is :const:`True`, a search match must start and end a word. The match can span multiple words. See also :obj:`~gi.repository.Gtk.TextIter.starts_word` and :obj:`~gi.repository.Gtk.TextIter.ends_word`\. :param at_word_boundaries: the setting. .. method:: set_case_sensitive(case_sensitive: bool) -> None Enables or disables the case sensitivity for the search. :param case_sensitive: the setting. .. method:: set_regex_enabled(regex_enabled: bool) -> None Enables or disables whether to search by regular expressions. If enabled, the :obj:`~gi.repository.GtkSource.SearchSettings.props.search_text` property contains the pattern of the regular expression. :obj:`~gi.repository.GtkSource.SearchContext` uses :obj:`~gi.repository.GLib.Regex` when regex search is enabled. See the `Regular expression syntax `__ page in the GLib reference manual. :param regex_enabled: the setting. .. method:: set_search_text(search_text: str | None = None) -> None Sets the text to search. If ``search_text`` is :const:`None` or is empty, the search will be disabled. A copy of ``search_text`` will be made, so you can safely free ``search_text`` after a call to this function. You may be interested to call :obj:`~gi.repository.GtkSource.utils_unescape_search_text` before this function. :param search_text: the nul-terminated text to search, or :const:`None` to disable the search. .. method:: 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. .. versionadded:: 5.12 :param visible_only: the setting. .. method:: set_wrap_around(wrap_around: bool) -> None Enables or disables the wrap around search. If ``wrap_around`` is :const:`True`, 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. :param wrap_around: the setting. Properties ---------- .. rst-class:: interim-class .. class:: SearchSettings :no-index: .. attribute:: props.at_word_boundaries :type: bool The type of the None singleton. .. attribute:: props.case_sensitive :type: bool The type of the None singleton. .. attribute:: props.regex_enabled :type: bool The type of the None singleton. .. attribute:: props.search_text :type: str The type of the None singleton. .. attribute:: props.visible_only :type: bool The type of the None singleton. .. versionadded:: 5.12 .. attribute:: props.wrap_around :type: bool The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: SearchSettings :no-index: .. attribute:: parent_instance