Fix tabulator overwrite
This commit is contained in:
parent
4b7d0cd038
commit
ac45e6d47c
1 changed files with 4 additions and 1 deletions
5
main.cpp
5
main.cpp
|
@ -30,6 +30,9 @@ string get_line(count_type r) {
|
||||||
line[i] = ' ';
|
line[i] = ' ';
|
||||||
return line;
|
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]; }
|
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 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); }
|
void new_line(count_type r, string text = "") { file.insert(file_offset+r, text); }
|
||||||
|
@ -67,7 +70,7 @@ bool save(string filename) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for(count_type i = 0; i < file.size(); ++i)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue