- enhancement: disable "code completion" will disable enhanced syntax highlight

This commit is contained in:
Roy Qu 2022-03-13 18:31:05 +08:00
parent 0286043cd7
commit dd5ce57608
3 changed files with 9 additions and 2 deletions

View File

@ -13,6 +13,7 @@ Red Panda C++ Version 1.0.0
- fix: wrong selection when drag & dropped in editor
- enhancement: toggle block comment
- fix: syntax color of #include header filenames not correct
- enhancement: disable "code completion" will disable enhanced syntax highlight
Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong

View File

@ -886,7 +886,7 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
if (token.isEmpty())
return;
if (mParser && highlighter() && (attr == highlighter()->identifierAttribute())
if (mParser && mParser->enabled() && highlighter() && (attr == highlighter()->identifierAttribute())
&& !mParser->isIncludeLine(lines()->getString(line-1)) ) {
BufferCoord p{aChar,line};
@ -2439,7 +2439,9 @@ void Editor::initParser()
&EditorList::getContentFromOpenedEditor,pMainWindow->editorList(),
std::placeholders::_1, std::placeholders::_2));
resetCppParser(mParser);
mParser->setEnabled((highlighter() && highlighter()->getClass() == SynHighlighterClass::CppHighlighter));
mParser->setEnabled(
pSettings->codeCompletion().enabled() &&
(highlighter() && highlighter()->getClass() == SynHighlighterClass::CppHighlighter));
}
Editor::QuoteStatus Editor::getQuoteStatus()
@ -2570,6 +2572,8 @@ void Editor::reparse()
if (highlighter()->language() != SynHighlighterLanguage::Cpp
&& highlighter()->language() != SynHighlighterLanguage::GLSL)
return;
if (mParser)
mParser->setEnabled(pSettings->codeCompletion().enabled());
parseFile(mParser,mFilename,mInProject);
}

View File

@ -5698,6 +5698,8 @@ void SynEdit::ExecuteCommand(SynEditorCommand Command, QChar AChar, void *pData)
case SynEditorCommand::ecScrollDown:
verticalScrollBar()->setValue(verticalScrollBar()->value()+mMouseWheelScrollSpeed);
break;
case SynEditorCommand::ecMatchBracket:
break;
default:
break;
}