mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix a syntax highlighting regression while switching among UDL files
Fix #16154, close #16181
This commit is contained in:
parent
abbe60e74c
commit
5dfc9709c9
@ -1719,7 +1719,7 @@ void ScintillaEditView::setLanguage(LangType langType)
|
|||||||
{
|
{
|
||||||
unsigned long MODEVENTMASK_ON = NppParameters::getInstance().getScintillaModEventMask();
|
unsigned long MODEVENTMASK_ON = NppParameters::getInstance().getScintillaModEventMask();
|
||||||
|
|
||||||
if (_currentBuffer->getLastLangType() != -1)
|
if (_currentBuffer->getLastLangType() > 0)
|
||||||
{
|
{
|
||||||
saveCurrentPos();
|
saveCurrentPos();
|
||||||
Document prev = execute(SCI_GETDOCPOINTER);
|
Document prev = execute(SCI_GETDOCPOINTER);
|
||||||
@ -2336,7 +2336,9 @@ void ScintillaEditView::activateBuffer(BufferID buffer, bool force)
|
|||||||
_currentBufferID = buffer; //the magical switch happens here
|
_currentBufferID = buffer; //the magical switch happens here
|
||||||
_currentBuffer = newBuf;
|
_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 int currentLangInt = static_cast<int>(_currentBuffer->getLangType());
|
||||||
const bool isFirstActiveBuffer = (_currentBuffer->getLastLangType() != currentLangInt);
|
const bool isFirstActiveBuffer = (_currentBuffer->getLastLangType() != currentLangInt);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user