diff options
-rw-r--r-- | buffer.cpp | 6 | ||||
-rw-r--r-- | config.cpp | 3 |
2 files changed, 8 insertions, 1 deletions
@@ -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"); } @@ -7,7 +7,8 @@ using namespace std; Keybindings global_keybindings={ - {KEY_CTRL+'Q',{"quit_app"}} + {KEY_CTRL+'Q',{"quit_app"}}, + {'\n',{"insert_newline"}}, }; class Init{public: Init(){ |