diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index 8bb074dc..ec255624 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -394,6 +394,7 @@ bool RclConfig::updateMainConfig() setKeyDir(cstr_null); + // Texsplit customization bool bvalue = false; if (getConfParam("nocjk", &bvalue) && bvalue == true) { TextSplit::cjkProcessing(false); @@ -405,16 +406,18 @@ bool RclConfig::updateMainConfig() TextSplit::cjkProcessing(true); } } - bvalue = false; if (getConfParam("nonumbers", &bvalue) && bvalue == true) { TextSplit::noNumbers(); } - bvalue = false; if (getConfParam("dehyphenate", &bvalue)) { TextSplit::deHyphenate(bvalue); } + bvalue = false; + if (getConfParam("backslashasletter", &bvalue)) { + TextSplit::backslashAsLetter(bvalue); + } bvalue = true; if (getConfParam("skippedPathsFnmPathname", &bvalue) && bvalue == false) { diff --git a/src/common/textsplit.cpp b/src/common/textsplit.cpp index bd80f049..f4fee2db 100644 --- a/src/common/textsplit.cpp +++ b/src/common/textsplit.cpp @@ -137,6 +137,14 @@ public: }; static const CharClassInit charClassInitInstance; +void TextSplit::backslashAsLetter(bool on) { + if (on) { + charclasses[int('\\')] = A_LLETTER; + } else { + charclasses[int('\\')] = SPACE; + } +} + static inline int whatcc(unsigned int c) { if (c <= 127) { diff --git a/src/common/textsplit.h b/src/common/textsplit.h index 9f66d13c..5bc7964a 100644 --- a/src/common/textsplit.h +++ b/src/common/textsplit.h @@ -59,6 +59,11 @@ public: o_deHyphenate = on; } + // Process backslashes as letters? Default is off, but it may be + // useful for searching for tex commands. Config variable: + // backslashasletter + static void backslashAsLetter(bool on); + enum Flags { // Default: will return spans and words (a_b, a, b) TXTS_NONE = 0,