tRemove unneeded local variables, do not find occurence from current cursor pos… | |
git clone git://src.adamsgaard.dk/ve | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit eb81dcd6d14223042118a1d85ae90f4eaf2f53cf | |
parent 893395f4cbc488e2fa942f80589d563c7648fb6e | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 7 Aug 2019 10:38:18 +0200 | |
Remove unneeded local variables, do not find occurence from current cursor pos | |
Diffstat: | |
M find.c | 15 +++++++-------- | |
1 file changed, 7 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/find.c b/find.c | |
t@@ -16,17 +16,13 @@ | |
void | |
editor_find_next_occurence(int opposite_direction) | |
{ | |
- int x_start; | |
- int y_start, y, y_end, y_inc; | |
+ int y, y_end, y_inc; | |
eRow *row; | |
char *match; | |
if (!E.find_query) | |
return; | |
- y_start = E.cursor_y; | |
- x_start = editor_row_cursor_x_to_rx(&E.row[E.cursor_y], E.cursor_x); | |
- | |
if ((E.find_direction && !opposite_direction) || | |
(!E.find_direction && opposite_direction)) { | |
y_end = E.num_rows; | |
t@@ -37,11 +33,14 @@ editor_find_next_occurence(int opposite_direction) | |
} | |
/* from cursor until end of document */ | |
- for (y = y_start; y != y_end; y += y_inc) { | |
+ for (y = E.cursor_y; y != y_end; y += y_inc) { | |
row = &E.row[y]; | |
- if (y == y_start) | |
- match = strstr(row->rchars + x_start, E.find_query); | |
+ if (y == E.cursor_y) | |
+ match = strstr(row->rchars + 1 + | |
+ editor_row_cursor_x_to_rx(&E.row[E.cursor_y], | |
+ E.cursor_x), | |
+ E.find_query); | |
else | |
match = strstr(row->rchars, E.find_query); | |
if (match) |