Repository navigation
API turboframe.ui.searching
Source: turboframe/ui/searching.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.
Search > Find, Replace and Search again, in the text of the editor being edited.
SearchMixin is part of the application (a DesktopApp):
-
Find (
CM_FIND) opens the Find dialog (turboframe.ui.dialogs.SearchDialog) with the selection, or the word under the cursor, or the last text; OK selects the next match (the previous one, backward), from the cursor or from the scope's edge (Entire scope), wrapping around the text's end (the status says so). -
Replace (
CM_REPLACE) replaces the next match; Change all every one, as one edit that a single Undo restores, or one at a time asking (Prompt on replace: Yes, No, All, Cancel;replace_prompt). -
Search again (
CM_SEARCH_AGAIN) repeats the last Find or Replace from the cursor (the dialog when nothing was searched yet).
The text and the options are kept in search_text and search_options, the attributes turboframe.ui.findfiles.FindInFilesMixin keeps, so both share them; the replacement in search_replacement. The search itself is turboframe.search. search_target() is the hook that says which editor window is searched (the active editor); search_command(command) runs the three commands for the application's run_command.
CM_FIND, CM_REPLACE, CM_SEARCH_AGAIN, SEARCH_COMMANDS, initial_query, SearchMixin
10295
10296
10297
frozenset({10295, 10296, 10297})
def initial_query(editor, last: str) -> strWhat the Find dialog starts with: the selection when it is on one line, else the word under the cursor, else last.
class SearchMixinFind, Replace and Search again over an editor window's editor (a TextArea), mixed into a DesktopApp: await self.find() (replace(), search_again()) from a worker.
-
search_target(): The editor window searched: the application'sactive_editor()when it has one, else the active window when it has aneditor. -
async find(window=None) -> None: Search > Find. -
async replace(window=None) -> None: Search > Replace. -
async search_again(window=None) -> None: Search > Search again: the last Find or Replace from the cursor (the Find dialog before any). -
async search_command(command: int) -> bool: Run one ofSEARCH_COMMANDS(from a worker); False for another command. async search_dialog(window, *, replace: bool) -> None-
async search(window, *, first: bool, change_all: bool = False) -> None: Run the stored find or replace from the cursor (or the scope's edge on the first run).
TurboFrame · part of Divengine · GPL-3.0-or-later · report an issue
Tutorial
Examples
The desktop
- The Desktop
- Application Mixins
- Windows and Lists
- Dialogs
- Histories
- Progress
- Themes and Colors
- Glyphs
- Settings and Recent Files
- Command Palette
Editing
Tasks
Languages
Running
Reference
Links