diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 2e96e2c6e..6b5847957 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4443,6 +4443,7 @@ int Notepad_plus::switchEditViewTo(int gid) _pEditView = _pNonEditView; _pNonEditView = tempView; + _pEditView->beSwitched(); _pEditView->getFocus(); //set the focus notifyBufferActivated(_pEditView->getCurrentBufferID(), currentView()); diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 5c772376e..7586c8e88 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -128,7 +128,7 @@ void Buffer::setFileName(const char *fn, LangType defaultLang) } updateTimeStamp(); - if (newLang != _lang) { + if (newLang != _lang || _lang == L_USER) { _lang = newLang; doNotify(BufferChangeFilename | BufferChangeLanguage | BufferChangeTimestamp); return; diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 89ac24023..68fb0c9c8 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -133,12 +133,13 @@ public : _format = ndds._format; _unicodeMode = ndds._encoding; + _userLangExt[0] = 0; setFileName(fileName, ndds._lang); updateTimeStamp(); checkFileState(); _currentStatus = type; _isDirty = false; - _userLangExt[0] = 0; + if (type == DOC_UNNAMED) _needLexer = false; //empty document, no styling _canNotify = true; @@ -223,7 +224,7 @@ public : strcpy(_userLangExt, userLangName); } _needLexer = true; //change of lang means lexern eeds updating - doNotify(BufferChangeLanguage); + doNotify(BufferChangeLanguage|BufferChangeLexing); }; UniMode getUnicodeMode() const {