Rename Search to Find
This commit is contained in:
parent
5d68fa1c0e
commit
4decff67fb
3 changed files with 9 additions and 9 deletions
|
@ -7,7 +7,7 @@
|
|||
#include "file.h" // for editorSave
|
||||
#include "fn.h" // for E, editorConfig, erow, CTRL_KEY, editorKey::AR...
|
||||
#include "output.h" // for editorSetStatusMessage, editorDelChar, editorI...
|
||||
#include "search.h" // for editorFind
|
||||
#include "search.h" // for editorSearch
|
||||
#include "terminal.h" // for editorReadKey
|
||||
|
||||
|
||||
|
@ -93,7 +93,7 @@ void editorProcessKeypress() {
|
|||
int c = editorReadKey(); // Blocking!
|
||||
|
||||
switch (c) {
|
||||
case '\r':
|
||||
case '\r': // ENTER
|
||||
if (wantToQuit == 0) {
|
||||
editorInsertNewLine();
|
||||
} else {
|
||||
|
@ -135,7 +135,7 @@ void editorProcessKeypress() {
|
|||
break;
|
||||
|
||||
case CTRL_KEY('f'):
|
||||
editorFind();
|
||||
editorSearch();
|
||||
break;
|
||||
|
||||
case BACKSPACE:
|
||||
|
@ -167,7 +167,7 @@ void editorProcessKeypress() {
|
|||
break;
|
||||
|
||||
case CTRL_KEY('l'):
|
||||
case '\x1b':
|
||||
case '\x1b': // ESC
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "row.h" // for editorRowRxToCx
|
||||
|
||||
|
||||
void editorFindCallback(char *query, int key) {
|
||||
void editorSearchCallback(char *query, int key) {
|
||||
static int last_match = -1;
|
||||
static int direction = 1;
|
||||
|
||||
|
@ -58,13 +58,13 @@ void editorFindCallback(char *query, int key) {
|
|||
}
|
||||
}
|
||||
|
||||
void editorFind() {
|
||||
void editorSearch() {
|
||||
int saved_cx = E.cx;
|
||||
int saved_cy = E.cy;
|
||||
int saved_coloff = E.coloff;
|
||||
int saved_rowoff = E.rowoff;
|
||||
|
||||
char *query = editorPrompt("Search: %s (Use ESC/Arrows/Enter)", editorFindCallback);
|
||||
char *query = editorPrompt("Search: %s (Use ESC/Arrows/Enter)", editorSearchCallback);
|
||||
if (query) {
|
||||
free(query);
|
||||
} else {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef _SEARCH_H_
|
||||
#define _SEARCH_H_
|
||||
|
||||
void editorFindCallback(char *query, int key);
|
||||
void editorFind();
|
||||
void editorSearchCallback(char *query, int key);
|
||||
void editorSearch();
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue