GtkSource.SearchSettings¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
Search at word boundaries |
||
r/w/c |
Case sensitive |
||
r/w/c |
Whether to search by regular expression |
||
r/w/c |
The text to search |
||
r/w/c |
Whether to exclude invisible text from the search |
||
r/w/c |
Wrap around |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GtkSource.SearchSettings(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Search settings.
A
GtkSourceSearchSettings
object represents the settings of a search. The search settings can be associated with one or several [class`SearchContext`]s.- classmethod new()¶
- Returns:
a new search settings object.
- Return type:
Creates a new search settings object.
- get_search_text()¶
-
Gets the text to search.
The return value must not be freed.
You may be interested to call [func`utils_escape_search_text`] after this function.
- get_visible_only()¶
- Returns:
whether to exclude invisible text from the search.
- Return type:
New in version 5.12.
- set_at_word_boundaries(at_word_boundaries)¶
- Parameters:
at_word_boundaries (
bool
) – the setting.
Change whether the search is done at word boundaries.
If at_word_boundaries is
True
, a search match must start and end a word. The match can span multiple words. See also [method`Gtk`.TextIter.starts_word] and [method`Gtk`.TextIter.ends_word].
- set_case_sensitive(case_sensitive)¶
- Parameters:
case_sensitive (
bool
) – the setting.
Enables or disables the case sensitivity for the search.
- set_regex_enabled(regex_enabled)¶
- Parameters:
regex_enabled (
bool
) – the setting.
Enables or disables whether to search by regular expressions.
If enabled, the [property`SearchSettings`:py:data::search-text<GtkSource.SearchSettings.props.search_text>] property contains the pattern of the regular expression.
[class`SearchContext`] uses
GLib.Regex
when regex search is enabled. See the Regular expression syntax page in the GLib reference manual.
- set_search_text(search_text)¶
- Parameters:
search_text (
str
orNone
) – the nul-terminated text to search, orNone
to disable the search.
Sets the text to search.
If search_text is
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 [func`utils_unescape_search_text`] before this function.
- set_visible_only(visible_only)¶
- Parameters:
visible_only (
bool
) – the setting.
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.
New in version 5.12.
- set_wrap_around(wrap_around)¶
- Parameters:
wrap_around (
bool
) – the setting.
Enables or disables the wrap around search.
If wrap_around is
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.
Property Details¶
- GtkSource.SearchSettings.props.at_word_boundaries¶
-
If
True
, a search match must start and end a word. The match can span multiple words.
- GtkSource.SearchSettings.props.case_sensitive¶
-
Whether the search is case sensitive.
- GtkSource.SearchSettings.props.regex_enabled¶
-
Search by regular expressions with [property`SearchSettings`:py:data::search-text<GtkSource.SearchSettings.props.search_text>] as the pattern.
- GtkSource.SearchSettings.props.search_text¶
-
A search string, or
None
if the search is disabled.If the regular expression search is enabled, [property`SearchSettings`:py:data::search-text<GtkSource.SearchSettings.props.search_text>] is the pattern.
- GtkSource.SearchSettings.props.visible_only¶
-
Exclude invisible text from the search. A search match may have invisible text interspersed.
New in version 5.12.