Browse Source

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
pull/343/head^2
harrybharry 17 years ago
parent
commit
ba6a9c260b
  1. 1
      PowerEditor/src/Notepad_plus.cpp
  2. 2
      PowerEditor/src/ScitillaComponent/Buffer.cpp
  3. 5
      PowerEditor/src/ScitillaComponent/Buffer.h

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

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

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

Loading…
Cancel
Save