summaryrefslogtreecommitdiff
path: root/manager.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-09 13:52:11 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-09 13:55:58 +0100
commit5b91fe424ee7358367f998af8c1903362f9e2abd (patch)
treee6941715a3fbd4b82a6420f978edacf7e862d88a /manager.cpp
parent4addb711c6a1a282b0a59bf03e850a86ba2ead69 (diff)
Bugfixing
Diffstat (limited to 'manager.cpp')
-rw-r--r--manager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/manager.cpp b/manager.cpp
index 01c9e01..7f9fa89 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -15,9 +15,7 @@ void Manager::receive(const Command &cmd){
if(cmd[0]=="open_file"){
buffers.emplace_back(this);
buffers.back().receive(cmd);
- } else if(cmd[0]=="insert_char"){
- if(activeIdx==-1)bel();
- else buffers[activeIdx].receive(cmd);
+ if(activeIdx==-1)activeIdx=buffers.size()-1;
} else if(cmd[0]=="error"){
pushcursor();
Size termsize=gettermsize();
@@ -29,7 +27,8 @@ void Manager::receive(const Command &cmd){
} else if(cmd[0]=="quit_app"){
should_quit=true;
} else {
- THROW("Unknown command");
+ if(activeIdx==-1)bel();
+ else buffers[activeIdx].receive(cmd);
}
}