aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-03 14:45:59 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-03 14:45:59 +0000
commitca485ca6709f99bee0cc0f696ebbab442c2bbe0a (patch)
treea995a7230c1957a8a23e28c1b83b6a5835ab2ffe
parent7b42e9bfb7f1fbbe1cde2bdcdbcdb2538060404e (diff)
downloadtermo-ca485ca6709f99bee0cc0f696ebbab442c2bbe0a.tar.gz
termo-ca485ca6709f99bee0cc0f696ebbab442c2bbe0a.tar.xz
termo-ca485ca6709f99bee0cc0f696ebbab442c2bbe0a.zip
Bugfix to recursive 'meta-' getkey code - handle buffcount too
-rw-r--r--termkey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/termkey.c b/termkey.c
index 8f55dd3..b969e83 100644
--- a/termkey.c
+++ b/termkey.c
@@ -372,21 +372,23 @@ static termkey_result getkey_simple(termkey_t *tk, termkey_key *key, int force)
// Try another key there
tk->buffstart++;
+ tk->buffcount--;
// Run the full driver
termkey_result metakey_result = (*tk->driver.getkey)(tk, key, force);
+ tk->buffstart--;
+ tk->buffcount++;
+
switch(metakey_result) {
case TERMKEY_RES_KEY:
key->modifiers |= TERMKEY_KEYMOD_ALT;
- tk->buffstart--;
(*tk->method.eat_bytes)(tk, 1);
break;
case TERMKEY_RES_NONE:
case TERMKEY_RES_EOF:
case TERMKEY_RES_AGAIN:
- tk->buffstart--;
break;
}