diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-10-09 14:31:00 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-10-09 14:31:00 +0200 |
| commit | e1d4215159d39aa941b7846c46103d3690c2abcd (patch) | |
| tree | 789f6882a027ae81c7dbe70b1810f8858895ebd6 /src | |
| parent | c0db3b81bebc270a48a7e85b8eedb3973f611674 (diff) | |
InsertMode insert the whole utf8 representation of a codepoint
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client.cc b/src/client.cc index 3b3c8a4e..6c06f465 100644 --- a/src/client.cc +++ b/src/client.cc @@ -393,6 +393,14 @@ private: int m_current_completion = -1; }; +String codepoint_to_str(utf8::Codepoint cp) +{ + std::string str; + auto it = back_inserter(str); + utf8::dump(it, cp); + return String(str); +} + class Insert : public ClientMode { public: @@ -440,7 +448,7 @@ public: m_inserter.move_cursors({ 1, 0}); break; default: - m_inserter.insert(String() + key.key); + m_inserter.insert(codepoint_to_str(key.key)); if (m_inserter.editor().selections().size() == 1 and is_word(key.key)) { |
