Fix find and enter in insert-mode

This commit is contained in:
Matúš Púll 2025-05-28 16:23:12 +02:00
parent 68b1b176e6
commit 3562a62da7

View file

@ -137,7 +137,7 @@ std::pair<bool, position> Editor::find(string text) {
count_type r = (file_offset + cur.r + _r) % file_size; count_type r = (file_offset + cur.r + _r) % file_size;
count_type start = ((_r == 0) ? (cur.c+1) : 0); 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) if(pos != string::npos)
return {true,{r, pos}}; return {true,{r, pos}};
} }
@ -243,7 +243,8 @@ bool Editor::take_action() {
file.split_line(cur + file_offset); file.split_line(cur + file_offset);
print_file(file_offset); print_file(file_offset);
cur.r++; cur.r++;
jump_line_end(); cur.c = 0;
move(cur);
break; break;
case '\t': case '\t':
// Modify current_insert TODO // Modify current_insert TODO