]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
LFUN_UNICODE_INSERT - unicode-insert
[lyx.git] / src / text3.C
index 221b297d9a9ca563199614e57b15435f28d3290f..015a83f03fe2e8b394c6ac0988907a5493768b19 100644 (file)
@@ -893,6 +893,21 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                break;
        }
 
+       case LFUN_UNICODE_INSERT: {
+               if (cmd.argument().empty())
+                       break;
+               docstring hexstring = cmd.argument();
+               if (lyx::support::isHex(hexstring)) {
+                       char_type c = lyx::support::hexToInt(hexstring);
+                       if (c > 32 && c < 0x10ffff) {
+                               lyxerr << "Inserting c: " << c << endl;
+                               docstring s = docstring(1, c);
+                               lyx::dispatch(FuncRequest(LFUN_SELF_INSERT, s));
+                       }
+               }
+               break;
+       }
+               
        case LFUN_QUOTE_INSERT: {
                cap::replaceSelection(cur);
                Paragraph & par = cur.paragraph();
@@ -1794,6 +1809,7 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
        case LFUN_BUFFER_BEGIN:
        case LFUN_BUFFER_BEGIN_SELECT:
        case LFUN_BUFFER_END_SELECT:
+       case LFUN_UNICODE_INSERT:
                // these are handled in our dispatch()
                enable = true;
                break;