diff --git a/main.cpp b/main.cpp index bcf4af3..2bbd5da 100644 --- a/main.cpp +++ b/main.cpp @@ -89,11 +89,11 @@ void print_file(int start = 0) { clear_line(i); } // Splitting lines -string split_line(int r, int s) { +void split_line(int r, int s) { string line = get_line(r); - string ret = line.substr(s, line.size()); + string newline = line.substr(s, line.size()); remove(r, s, line.size()-s); - return ret; + new_line(r+1, newline); } @@ -224,7 +224,7 @@ int main(int argc, char* argv[]) { print_line(row); break; case ENTER: - new_line(row+1, split_line(row, col)); + split_line(row, col); print_file(row++); jump_line_end(); break;