From ac45e6d47cd5f456f56ebc9648123ec621bf29b0 Mon Sep 17 00:00:00 2001 From: Matuush Date: Wed, 16 Apr 2025 14:07:37 +0200 Subject: [PATCH] Fix tabulator overwrite --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 2c7f756..a74fbee 100644 --- a/main.cpp +++ b/main.cpp @@ -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; }