Integrate character remove
This commit is contained in:
parent
6942a0cf01
commit
05213ff3e6
1 changed files with 5 additions and 0 deletions
5
main.cpp
5
main.cpp
|
@ -24,6 +24,7 @@ void set(int r, int s, char ch) { file.find(r)->text[s] = ch; }
|
|||
void add_line(int r, string text = "") { file.insert(r, text); }
|
||||
void remove_line(int r) { file.remove(r); }
|
||||
void insert_char(int r, int s, char ch) { file.find(r)->text.insert(s, string{ch}); }
|
||||
void remove_char(int r, int s) { file.find(r)->text.erase(s); }
|
||||
|
||||
// For normal mode not to write to terminal
|
||||
void step_back() {
|
||||
|
@ -151,6 +152,10 @@ int main(int argc, char* argv[]) {
|
|||
remove_line(row);
|
||||
print_file();
|
||||
break;
|
||||
case 'x':
|
||||
remove_char(row, col);
|
||||
print_line(row);
|
||||
break;
|
||||
case 'o':
|
||||
add_line(row);
|
||||
print_file();
|
||||
|
|
Loading…
Reference in a new issue