Fix tabulator overwrite

This commit is contained in:
Matúš Púll 2025-04-16 14:07:37 +02:00
parent 4b7d0cd038
commit ac45e6d47c

View file

@ -30,6 +30,9 @@ string get_line(count_type r) {
line[i] = ' ';
return line;
}
string get_line_raw(count_type r) {
return file.find(file_offset+r)->text;
}
char get(position p) { return get_line(file_offset+p.r)[p.c]; }
void set(position p, char ch) { file.find(file_offset+p.r)->text[p.c] = ch; }
void new_line(count_type r, string text = "") { file.insert(file_offset+r, text); }
@ -67,7 +70,7 @@ bool save(string filename) {
return 1;
for(count_type i = 0; i < file.size(); ++i)
outfile << get_line(i-file_offset) << std::endl;
outfile << get_line_raw(i-file_offset) << std::endl;
return 0;
}