Commit 7126b132 authored by twanvl's avatar twanvl

cursor position fix

parent 64fbf5ab
...@@ -198,7 +198,6 @@ size_t index_to_cursor(const String& str, size_t index, Movement dir) { ...@@ -198,7 +198,6 @@ size_t index_to_cursor(const String& str, size_t index, Movement dir) {
} }
} }
if (cursor == 0) return 0; if (cursor == 0) return 0;
if (i == str.size()) return cursor;
if (dir == MOVE_LEFT) return cursor - 1; if (dir == MOVE_LEFT) return cursor - 1;
if (dir == MOVE_RIGHT) return cursor - (start == index); if (dir == MOVE_RIGHT) return cursor - (start == index);
// which is nearer? start or end? // which is nearer? start or end?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment