tFix cursor positioning during find - ve - a minimal text editor (work in progr… | |
git clone git://src.adamsgaard.dk/ve | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit a4e92bc5c8653de0b7835802b251e521edb9438e | |
parent 132aa10bd388dc5e4a3901bfcc6d8cc204d6cce9 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 6 Aug 2019 22:26:37 +0200 | |
Fix cursor positioning during find | |
Diffstat: | |
M find.c | 2 +- | |
M row.c | 1 + | |
2 files changed, 2 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/find.c b/find.c | |
t@@ -21,7 +21,7 @@ editor_find() | |
if (match) { | |
E.cursor_y = i; | |
E.cursor_x = editor_row_cursor_rx_to_x(row, match - ro… | |
- E.row_offset = E.num_rows; | |
+ /* E.row_offset = E.num_rows; */ /* put line to top of… | |
break; | |
} | |
} | |
diff --git a/row.c b/row.c | |
t@@ -21,6 +21,7 @@ int | |
editor_row_cursor_rx_to_x(eRow *row, int cursor_rx) | |
{ | |
int cur_rx, cx; | |
+ cur_rx = 0; | |
for (cx=0; cx<row->size; ++cx) { | |
if (row->chars[cx] == '\t') | |
cur_rx += (TAB_WIDTH - 1) - (cur_rx % TAB_WIDTH); |