From ba3b955a451b9e749c41d2431f45c504cf6630f3 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 6 Mar 2025 17:07:05 +0100 Subject: [PATCH] Fix syntax hiliting err while switch lang on untitled doc regression The regression was introduced by commit b2152d983e3b20aed7f687ba1d9e916ae6065b24 Fix #16250, close #16254 --- PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index e56c90cbb..a8abc5eb7 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -1721,7 +1721,7 @@ void ScintillaEditView::setLanguage(LangType langType) { unsigned long MODEVENTMASK_ON = NppParameters::getInstance().getScintillaModEventMask(); - if (_currentBuffer->getLastLangType() > 0) + if (_currentBuffer->getLastLangType() > 0 && !_currentBuffer->isUntitled()) { saveCurrentPos(); Document prev = execute(SCI_GETDOCPOINTER);