This class handles finding text in the TextBuffer
Typically you should get an instance of this class from the TextBuffer.finder
attribute.
Method | __init__ |
constructor |
Method | find |
Find and select the next occurrence of a given string |
Method | find_next |
Skip to the next match and select it |
Method | find_previous |
Go back to the previous match and select it |
Method | get_state |
Get the query and any options. Used to copy the current state of find, can be restored later using set_state() . |
Method | replace |
Replace current match |
Method | replace_all |
Replace all matched |
Method | select_match |
Undocumented |
Method | set_highlight |
Toggle highlighting of matches in the TextBuffer |
Method | set_match |
Undocumented |
Method | set_state |
Set the query and any options. Can be used to restore the state of a find action without triggering a find immediatly. |
Method | unset_match |
Undocumented |
Instance Variable | buffer |
Undocumented |
Instance Variable | flags |
Undocumented |
Instance Variable | highlight |
Undocumented |
Instance Variable | highlight_tag |
Undocumented |
Instance Variable | match_tag |
Undocumented |
Instance Variable | regex |
Undocumented |
Instance Variable | string |
Undocumented |
Method | _check_range |
Undocumented |
Method | _find_next |
Undocumented |
Method | _parse_query |
Undocumented |
Method | _remove_tag |
Undocumented |
Method | _update_highlight |
Undocumented |
Instance Variable | _signals |
Undocumented |
Parameters | |
string | the text (or regex) to find |
flags | options, a combination of:
|
Returns | |
True if a match was found |
set_state()
.Returns | |
a 3-tuple of the search string, the option flags, and the highlight state |
Parameters | |
string | the replacement string In case of a regex find and replace the string will be expanded with terms from the regex. |
Returns | |
True is successful |
Replace all matched
Like replace()
but replaces all matches in the buffer
Parameters | |
string | the replacement string |
Returns | |
True is successful |
TextBuffer
Parameters | |
highlight | True to enable highlighting, False to disable |