static bool isWordChar(char_type c)
{
- return isLetterChar(c) || isDigitASCII(c);
+ return isLetterChar(c) || isNumberChar(c);
}
/// Perform a FindAdv operation.
it != it_end; ++it)
md2.push_back(*it);
docstring inp = asString(md2);
- LYXERR0("Got \"" << inp << "\"");
- char_type prev = inp[0];
for (len = 0; (unsigned) len < inp.size() && len + cur.pos() <= cur.lastpos(); len++) {
- char_type c = inp[len];
- if (isLetterChar(c))
- continue;
- if (isDigitASCII(c))
- continue;
- break;
+ if (!isWordChar(inp[len]))
+ break;
}
// len == 0 means previous char was a word separator
// len == 1 search starts with a word separator
return '0' <= c && c <= '9';
}
+bool isNumberChar(char_type c)
+{
+ return ucs4_to_qchar(c).isNumber();
+}
bool isAlnumASCII(char_type c)
{
/// return whether \p c is a digit in the ASCII range
bool isDigitASCII(char_type c);
+/// return whether \p c is a digit (not just 0-9)
+bool isNumberChar(char_type c);
+
/// return whether \p c is alpha or a digit in the ASCII range
bool isAlnumASCII(char_type c);