#include "insets/InsetText.h"
#include "mathed/MathData.h"
+#include "mathed/InsetMathNest.h"
#include "frontends/alert.h"
#include "frontends/Application.h"
}
+ case LFUN_UNICODE_INSERT: {
+ if (cmd.argument().empty())
+ break;
+
+ FuncCode code = cur.inset().currentMode() == Inset::MATH_MODE ?
+ LFUN_MATH_INSERT : LFUN_SELF_INSERT;
+ int i = 0;
+ while (true) {
+ docstring const arg = from_utf8(cmd.getArg(i));
+ if (arg.empty())
+ break;
+ if (!isHex(arg)) {
+ LYXERR0("Not a hexstring: " << arg);
+ ++i;
+ continue;
+ }
+ char_type c = hexToInt(arg);
+ if (c >= 32 && c < 0x10ffff) {
+ LYXERR(Debug::KEY, "Inserting c: " << c);
+ lyx::dispatch(FuncRequest(code, docstring(1, c)));
+ }
+ ++i;
+ }
+ break;
+ }
+
+
// This would be in Buffer class if only Cursor did not
// require a bufferview
case LFUN_INSET_FORALL: {
/*!
* \var lyx::FuncCode lyx::LFUN_UNICODE_INSERT
* \li Action: Inserts a single unicode character.
- * \li Syntax: unicode-insert <CHAR>
- * \li Params: <CHAR>: The character to insert, given as its code
+ * \li Syntax: unicode-insert <CHAR1> <CHAR2> ...
+ * \li Params: <CHARn>: The character to insert, given as its code
point, in hexadecimal.
- * \li Sample: unicode-insert 0x0100
+ * \li Sample: unicode-insert 0x0100 0x0259
* \li Origin: Lgb, 22 Oct 2006
* \endvar
*/
bv->buffer().errors("Paste");
break;
- case LFUN_UNICODE_INSERT: {
- if (cmd.argument().empty())
- break;
- docstring hexstring = cmd.argument();
- if (isHex(hexstring)) {
- char_type c = 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);
cur.recordUndo();
break;
}
- case LFUN_UNICODE_INSERT: {
- if (cmd.argument().empty())
- break;
- docstring hexstring = cmd.argument();
- if (isHex(hexstring)) {
- char_type c = hexToInt(hexstring);
- if (c >= 32 && c < 0x10ffff) {
- docstring s = docstring(1, c);
- FuncCode code = currentMode() == MATH_MODE ?
- LFUN_MATH_INSERT : LFUN_SELF_INSERT;
- lyx::dispatch(FuncRequest(code, s));
- }
- }
- break;
- }
-
case LFUN_DIALOG_SHOW_NEW_INSET: {
docstring const & name = cmd.argument();
string data;
/// If \p keepempty is true, empty strings will be pushed to the vector as well
/// If \p trimit is true, leading and trailing whitespace will be trimmed from
/// all values. Note that this can affect what counts as "empty".
+/// NOTE: If you want to split a string on whitespace, then do:
+/// getVectorFromString(str, " ", false, true);
std::vector<std::string> const getVectorFromString(std::string const & str,
std::string const & delim = std::string(","),
bool keepempty = false, bool trimit = true);
- Allow for spaces in bibliography keys (bug 9847).
+- Allow LFUN_UNICODE_INSERT to take multiple arguments (bug 11084).
+
* INTERNALS