Fix correct userdefined lang not selected when opening file.

Fix view not updating if userdefine is changed (only for active view)

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@238 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
harrybharry 2008-06-16 13:16:36 +00:00
parent 53f60b4a7a
commit ba6a9c260b
3 changed files with 5 additions and 3 deletions

View File

@ -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());

View File

@ -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;

View File

@ -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 {