Fix find and enter in insert-mode
This commit is contained in:
parent
68b1b176e6
commit
3562a62da7
1 changed files with 3 additions and 2 deletions
|
@ -137,7 +137,7 @@ std::pair<bool, position> Editor::find(string text) {
|
|||
count_type r = (file_offset + cur.r + _r) % file_size;
|
||||
|
||||
count_type start = ((_r == 0) ? (cur.c+1) : 0);
|
||||
count_type pos = file.get_line(r, 0).find(text, start);
|
||||
count_type pos = file.get_line(r, 1).find(text, start);
|
||||
if(pos != string::npos)
|
||||
return {true,{r, pos}};
|
||||
}
|
||||
|
@ -243,7 +243,8 @@ bool Editor::take_action() {
|
|||
file.split_line(cur + file_offset);
|
||||
print_file(file_offset);
|
||||
cur.r++;
|
||||
jump_line_end();
|
||||
cur.c = 0;
|
||||
move(cur);
|
||||
break;
|
||||
case '\t':
|
||||
// Modify current_insert TODO
|
||||
|
|
Loading…
Reference in a new issue