tFix cursor positioning during find - ve - a minimal text editor (work in progress)
(HTM) git clone git://src.adamsgaard.dk/ve
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit a4e92bc5c8653de0b7835802b251e521edb9438e
(DIR) parent 132aa10bd388dc5e4a3901bfcc6d8cc204d6cce9
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
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(-)
---
(DIR) 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 - row->rchars);
- E.row_offset = E.num_rows;
+ /* E.row_offset = E.num_rows; */ /* put line to top of screen */
break;
}
}
(DIR) 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);