Rename Search to Find

This commit is contained in:
Aaron Fischer 2019-01-22 11:44:21 +01:00
parent 5d68fa1c0e
commit 4decff67fb
3 changed files with 9 additions and 9 deletions

View file

@ -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:

View file

@ -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 {

View file

@ -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