The following code performs substitutions on a space inside single or double quotes of \b or \v respectively. That is how you activate the existing code “end if” means end\vif or ‘end case’ means end\bcase.
only apparently in the following buffers.
// OPERATORS2, FOLDERS_IN_CODE2, FOLDERS_IN_COMMENT, KEYWORDS1-8
void ScintillaEditView::setUserLexer(const TCHAR *userLangName) { int setKeywordsCounter = 0; execute(SCI_SETLEXER, SCLEX_USER); UserLangContainer * userLangContainer = userLangName? NppParameters::getInstance().getULCFromName(userLangName):_userDefineDlg._pCurrentUserLang; if (!userLangContainer) return; UINT codepage = CP_ACP; UniMode unicodeMode = _currentBuffer->getUnicodeMode(); int encoding = _currentBuffer->getEncoding(); if (encoding == -1) { if (unicodeMode == uniUTF8 || unicodeMode == uniCookie) codepage = CP_UTF8; } else { codepage = CP_OEMCP; // system OEM code page might not match user selection for character set, // but this is the best match WideCharToMultiByte offers } execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold"), reinterpret_cast<LPARAM>("1")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.isCaseIgnored"), reinterpret_cast<LPARAM>(userLangContainer->_isCaseIgnored ? "1":"0")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.allowFoldOfComments"), reinterpret_cast<LPARAM>(userLangContainer->_allowFoldOfComments ? "1":"0")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.foldCompact"), reinterpret_cast<LPARAM>(userLangContainer->_foldCompact ? "1":"0")); char name[] = "userDefine.prefixKeywords0"; for (int i=0 ; i<SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i) { itoa(i+1, (name+25), 10); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(name), reinterpret_cast<LPARAM>(userLangContainer->_isPrefix[i] ? "1" : "0")); } for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i) { WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); const char * keyWords_char = wmc.wchar2char(userLangContainer->_keywordLists[i], codepage); if (globalMappper().setLexerMapper.find(i) != globalMappper().setLexerMapper.end()) { execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(globalMappper().setLexerMapper[i].c_str()), reinterpret_cast<LPARAM>(keyWords_char)); } else // OPERATORS2, FOLDERS_IN_CODE2, FOLDERS_IN_COMMENT, KEYWORDS1-8 { char temp[max_char]; bool inDoubleQuote = false; bool inSingleQuote = false; bool nonWSFound = false; int index = 0; for (size_t j=0, len = strlen(keyWords_char); j<len && index < (max_char-1); ++j) { if (!inSingleQuote && keyWords_char[j] == '"') { inDoubleQuote = !inDoubleQuote; continue; } if (!inDoubleQuote && keyWords_char[j] == '\'') { inSingleQuote = !inSingleQuote; continue; } if (keyWords_char[j] == '\\' && (keyWords_char[j+1] == '"' || keyWords_char[j+1] == '\'' || keyWords_char[j+1] == '\\')) { ++j; temp[index++] = keyWords_char[j]; continue; } if (inDoubleQuote || inSingleQuote) { if (keyWords_char[j] > ' ') // copy non-whitespace unconditionally { temp[index++] = keyWords_char[j]; if (nonWSFound == false) nonWSFound = true; } else if (nonWSFound == true && keyWords_char[j-1] != '"' && keyWords_char[j+1] != '"' && keyWords_char[j+1] > ' ') { temp[index++] = inDoubleQuote ? '\v' : '\b'; } else continue; } else { temp[index++] = keyWords_char[j]; } } temp[index++] = 0; execute(SCI_SETKEYWORDS, setKeywordsCounter++, reinterpret_cast<LPARAM>(temp)); } } char intBuffer[32]; sprintf(intBuffer, "%d", userLangContainer->_forcePureLC); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.forcePureLC"), reinterpret_cast<LPARAM>(intBuffer)); sprintf(intBuffer, "%d", userLangContainer->_decimalSeparator); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.decimalSeparator"), reinterpret_cast<LPARAM>(intBuffer)); // at the end (position SCE_USER_KWLIST_TOTAL) send id values sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(userLangContainer->getName())); // use numeric value of TCHAR pointer execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.udlName"), reinterpret_cast<LPARAM>(intBuffer)); sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(_currentBufferID)); // use numeric value of BufferID pointer execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.currentBufferID"), reinterpret_cast<LPARAM>(intBuffer)); for (int i = 0 ; i < SCE_USER_STYLE_TOTAL_STYLES ; ++i) { Style & style = userLangContainer->_styleArray.getStyler(i); if (style._styleID == STYLE_NOT_USED) continue; char nestingBuffer[32]; sprintf(nestingBuffer, "userDefine.nesting.%02d", i ); sprintf(intBuffer, "%d", style._nesting); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(nestingBuffer), reinterpret_cast<LPARAM>(intBuffer)); setStyle(style); } }