debug find callback

This commit is contained in:
SowinskiBraeden committed 2022-09-11 11:56:20 -07:00
1 parent bcc6507a4d
commit ca16d20f32
1 file changed
+4 -8
+4 -8
View File
@@ -212,8 +212,7 @@ int editorRowRxToCx(erow *row, int rx) {
int cur_rx = 0;
int cx;
for (cx = 0; cx < row->size; cx++) {
if (row->chars[cx] == '\t')
cur_rx += (LEVEL_TAB_STOP - 1) - (cur_rx % LEVEL_TAB_STOP);
if (row->chars[cx] == '\t') cur_rx += (LEVEL_TAB_STOP - 1) - (cur_rx % LEVEL_TAB_STOP);
cur_rx++;
if (cur_rx > rx) return cx;
@@ -320,9 +319,8 @@ void editorInsertChar(int c) {
}
void editorInsertNewLine() {
if (E.cx == 0) {
editorInsertRow(E.cy, "", 0);
} else {
if (E.cx == 0) editorInsertRow(E.cy, "", 0);
else {
erow *row = &E.row[E.cy];
editorInsertRow(E.cy + 1, &row->chars[E.cx], row->size - E.cx);
row = &E.row[E.cy];
@@ -427,7 +425,7 @@ void editorFindCallback(char *query, int key) {
static int last_match = -1;
static int direction = 1;
if (key == '\r' || key == '\x1b') {
if (key == '\r' || key == ESCAPE_CONST) {
last_match = -1;
direction = 1;
return;
@@ -455,8 +453,6 @@ void editorFindCallback(char *query, int key) {
break;
}
}
free(query);
}
void editorFind() {