Fix a syntax highlighting regression while switching among UDL files

Fix #16154
This commit is contained in:
Don Ho 2025-02-12 14:28:59 +01:00
parent abbe60e74c
commit 53975028b7

View File

@ -2336,7 +2336,9 @@ void ScintillaEditView::activateBuffer(BufferID buffer, bool force)
_currentBufferID = buffer; //the magical switch happens here
_currentBuffer = newBuf;
const bool isSameLangType = (_prevBuffer != nullptr) && (_prevBuffer->getLangType() == _currentBuffer->getLangType());
const bool isSameLangType = (_prevBuffer != nullptr) && (_prevBuffer->getLangType() == _currentBuffer->getLangType()) &&
(_currentBuffer->getLangType() != L_USER || wcscmp(_prevBuffer->getUserDefineLangName(), _currentBuffer->getUserDefineLangName()) == 0);
const int currentLangInt = static_cast<int>(_currentBuffer->getLangType());
const bool isFirstActiveBuffer = (_currentBuffer->getLastLangType() != currentLangInt);