ze
Loading...
Searching...
No Matches
Files | Functions
Collaboration diagram for Search:

Files

file  search.c
 Interactive forward search implementation.
 

Functions

void editorFindCallback (char *query, int key)
 Highlight matches and move cursor during interactive search.
 
void editorFind (void)
 Prompt for a query and perform an interactive forward search.
 

Detailed Description

Function Documentation

◆ editorFind()

void editorFind ( void  )

Prompt for a query and perform an interactive forward search.

Prompts the user with "Search: " and uses editorFindCallback() to move to matches as the query changes. Restores the original cursor and viewport if the prompt is cancelled.

Postcondition
May modify cursor and viewport on success; restores them on cancel.
See also
editorPrompt(), editorFindCallback()

◆ editorFindCallback()

void editorFindCallback ( char *  query,
int  key 
)

Highlight matches and move cursor during interactive search.

Maintains search state across invocations. On arrow keys, changes search direction; on other input, resets state. Highlights the next match in the buffer and moves the cursor there, restoring previous highlight as needed.

Parameters
[in]queryNUL-terminated search string (may be empty).
[in]keyLast key pressed to drive search behavior.
Postcondition
Cursor, row highlighting, and scroll offset may change.
See also
editorFind(), editorRowRxToCx()