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 "file.h" // for editorSave
|
||||||
#include "fn.h" // for E, editorConfig, erow, CTRL_KEY, editorKey::AR...
|
#include "fn.h" // for E, editorConfig, erow, CTRL_KEY, editorKey::AR...
|
||||||
#include "output.h" // for editorSetStatusMessage, editorDelChar, editorI...
|
#include "output.h" // for editorSetStatusMessage, editorDelChar, editorI...
|
||||||
#include "search.h" // for editorFind
|
#include "search.h" // for editorSearch
|
||||||
#include "terminal.h" // for editorReadKey
|
#include "terminal.h" // for editorReadKey
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ void editorProcessKeypress() {
|
||||||
int c = editorReadKey(); // Blocking!
|
int c = editorReadKey(); // Blocking!
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '\r':
|
case '\r': // ENTER
|
||||||
if (wantToQuit == 0) {
|
if (wantToQuit == 0) {
|
||||||
editorInsertNewLine();
|
editorInsertNewLine();
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,7 +135,7 @@ void editorProcessKeypress() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CTRL_KEY('f'):
|
case CTRL_KEY('f'):
|
||||||
editorFind();
|
editorSearch();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BACKSPACE:
|
case BACKSPACE:
|
||||||
|
@ -167,7 +167,7 @@ void editorProcessKeypress() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CTRL_KEY('l'):
|
case CTRL_KEY('l'):
|
||||||
case '\x1b':
|
case '\x1b': // ESC
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "row.h" // for editorRowRxToCx
|
#include "row.h" // for editorRowRxToCx
|
||||||
|
|
||||||
|
|
||||||
void editorFindCallback(char *query, int key) {
|
void editorSearchCallback(char *query, int key) {
|
||||||
static int last_match = -1;
|
static int last_match = -1;
|
||||||
static int direction = 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_cx = E.cx;
|
||||||
int saved_cy = E.cy;
|
int saved_cy = E.cy;
|
||||||
int saved_coloff = E.coloff;
|
int saved_coloff = E.coloff;
|
||||||
int saved_rowoff = E.rowoff;
|
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) {
|
if (query) {
|
||||||
free(query);
|
free(query);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef _SEARCH_H_
|
#ifndef _SEARCH_H_
|
||||||
#define _SEARCH_H_
|
#define _SEARCH_H_
|
||||||
|
|
||||||
void editorFindCallback(char *query, int key);
|
void editorSearchCallback(char *query, int key);
|
||||||
void editorFind();
|
void editorSearch();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue