diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-10-11 00:41:48 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-10-11 00:41:48 +0200 |
| commit | 0ce6bd9bf54332d9eed8c7462ab4dfe08f8fac95 (patch) | |
| tree | 662591856f7227e3fb8592d582edaf2766a3f3e6 /src/keys.cc | |
| parent | 571861bc7bbe10bf831b861f7e6e0a2aa0a40839 (diff) | |
use ByteCount instead of CharCount when we are really counting bytes
(that is most of the time when we are not concerned with displaying)
Diffstat (limited to 'src/keys.cc')
| -rw-r--r-- | src/keys.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keys.cc b/src/keys.cc index 18b31d77..6b2479ff 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -25,11 +25,11 @@ static std::unordered_map<String, Codepoint> keynamemap = { KeyList parse_keys(const String& str) { KeyList result; - for (CharCount pos = 0; pos < str.length(); ++pos) + for (ByteCount pos = 0; pos < str.length(); ++pos) { if (str[pos] == '<') { - CharCount end_pos = pos; + ByteCount end_pos = pos; while (end_pos < str.length() and str[end_pos] != '>') ++end_pos; @@ -43,12 +43,12 @@ KeyList parse_keys(const String& str) if (tolower(keyname[0]) == 'c' and keyname[1] == '-') { modifier = Key::Modifiers::Control; - keyname = keyname.substr(2); + keyname = keyname.substr(2_byte); } if (tolower(keyname[0]) == 'a' and keyname[1] == '-') { modifier = Key::Modifiers::Alt; - keyname = keyname.substr(2); + keyname = keyname.substr(2_byte); } } if (keyname.length() == 1) |
