summaryrefslogtreecommitdiff
path: root/buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.cpp')
-rw-r--r--buffer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/buffer.cpp b/buffer.cpp
index 2123de1..f213e2f 100644
--- a/buffer.cpp
+++ b/buffer.cpp
@@ -35,6 +35,12 @@ void Buffer::receive(const Command &cmd){
}
//TODO: optimise this
renewLayout(screen[0].line,screen[0].part,lastWidth,lastHeight);
+ } else if(cmd[0]=="insert_newline"){
+ tb.insert(cursor.line,cursor.x,'\n');
+ cursor.x=0;
+ cursor.line++;
+ //TODO: optimise this
+ renewLayout(screen[0].line,screen[0].part,lastWidth,lastHeight);
} else {
THROW("Unknown command");
}