mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 16:24:27 +02:00
[BUG_FIXED] Fix x64 system files problems :
1. not included in recent file history list while closing a file. 2. not remembered in the next session problem. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@712 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
079353cd4c
commit
9a6e4fceba
@ -3814,25 +3814,46 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session)
|
|||||||
{
|
{
|
||||||
BufferID bufID = _mainDocTab.getBufferByIndex(i);
|
BufferID bufID = _mainDocTab.getBufferByIndex(i);
|
||||||
Buffer * buf = MainFileManager->getBufferByID(bufID);
|
Buffer * buf = MainFileManager->getBufferByID(bufID);
|
||||||
if (!buf->isUntitled() && PathFileExists(buf->getFullPathName()))
|
|
||||||
|
if (!buf->isUntitled())
|
||||||
{
|
{
|
||||||
generic_string languageName = getLangFromMenu(buf);
|
// if the file doesn't exist, it could be redirected
|
||||||
const TCHAR *langName = languageName.c_str();
|
// So we turn Wow64 off
|
||||||
|
bool isWow64Off = false;
|
||||||
sessionFileInfo sfi(buf->getFullPathName(), langName, buf->getEncoding(), buf->getPosition(&_mainEditView));
|
NppParameters *pNppParam = NppParameters::getInstance();
|
||||||
|
if (!PathFileExists(buf->getFullPathName()))
|
||||||
//_mainEditView.activateBuffer(buf->getID());
|
|
||||||
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, buf->getDocument());
|
|
||||||
int maxLine = _invisibleEditView.execute(SCI_GETLINECOUNT);
|
|
||||||
|
|
||||||
for (int j = 0 ; j < maxLine ; j++)
|
|
||||||
{
|
{
|
||||||
if ((_invisibleEditView.execute(SCI_MARKERGET, j)&(1 << MARK_BOOKMARK)) != 0)
|
pNppParam->safeWow64EnableWow64FsRedirection(FALSE);
|
||||||
{
|
isWow64Off = true;
|
||||||
sfi.marks.push_back(j);
|
}
|
||||||
}
|
|
||||||
|
if (PathFileExists(buf->getFullPathName()))
|
||||||
|
{
|
||||||
|
generic_string languageName = getLangFromMenu(buf);
|
||||||
|
const TCHAR *langName = languageName.c_str();
|
||||||
|
|
||||||
|
sessionFileInfo sfi(buf->getFullPathName(), langName, buf->getEncoding(), buf->getPosition(&_mainEditView));
|
||||||
|
|
||||||
|
//_mainEditView.activateBuffer(buf->getID());
|
||||||
|
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, buf->getDocument());
|
||||||
|
int maxLine = _invisibleEditView.execute(SCI_GETLINECOUNT);
|
||||||
|
|
||||||
|
for (int j = 0 ; j < maxLine ; j++)
|
||||||
|
{
|
||||||
|
if ((_invisibleEditView.execute(SCI_MARKERGET, j)&(1 << MARK_BOOKMARK)) != 0)
|
||||||
|
{
|
||||||
|
sfi.marks.push_back(j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
session._mainViewFiles.push_back(sfi);
|
||||||
|
}
|
||||||
|
|
||||||
|
// We enable Wow64 system, if it was disabled
|
||||||
|
if (isWow64Off)
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
|
isWow64Off = false;
|
||||||
}
|
}
|
||||||
session._mainViewFiles.push_back(sfi);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,11 +278,31 @@ void Notepad_plus::doClose(BufferID id, int whichOne) {
|
|||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
//add to recent files if its an existing file
|
//add to recent files if its an existing file
|
||||||
if (!buf->isUntitled() && PathFileExists(buf->getFullPathName()))
|
if (!buf->isUntitled())
|
||||||
{
|
{
|
||||||
_lastRecentFileList.add(buf->getFullPathName());
|
// if the file doesn't exist, it could be redirected
|
||||||
|
// So we turn Wow64 off
|
||||||
|
bool isWow64Off = false;
|
||||||
|
NppParameters *pNppParam = NppParameters::getInstance();
|
||||||
|
if (!PathFileExists(buf->getFullPathName()))
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(FALSE);
|
||||||
|
isWow64Off = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PathFileExists(buf->getFullPathName()))
|
||||||
|
_lastRecentFileList.add(buf->getFullPathName());
|
||||||
|
|
||||||
|
// We enable Wow64 system, if it was disabled
|
||||||
|
if (isWow64Off)
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
|
isWow64Off = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int nrDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem());
|
int nrDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem());
|
||||||
|
|
||||||
//Do all the works
|
//Do all the works
|
||||||
@ -873,6 +893,7 @@ bool Notepad_plus::isFileSession(const TCHAR * filename) {
|
|||||||
// return false if one or more sessions files fail to load (and session is modify to remove invalid files)
|
// return false if one or more sessions files fail to load (and session is modify to remove invalid files)
|
||||||
bool Notepad_plus::loadSession(Session & session)
|
bool Notepad_plus::loadSession(Session & session)
|
||||||
{
|
{
|
||||||
|
NppParameters *pNppParam = NppParameters::getInstance();
|
||||||
bool allSessionFilesLoaded = true;
|
bool allSessionFilesLoaded = true;
|
||||||
BufferID lastOpened = BUFFER_INVALID;
|
BufferID lastOpened = BUFFER_INVALID;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
@ -881,16 +902,33 @@ bool Notepad_plus::loadSession(Session & session)
|
|||||||
for ( ; i < session.nbMainFiles() ; )
|
for ( ; i < session.nbMainFiles() ; )
|
||||||
{
|
{
|
||||||
const TCHAR *pFn = session._mainViewFiles[i]._fileName.c_str();
|
const TCHAR *pFn = session._mainViewFiles[i]._fileName.c_str();
|
||||||
if (isFileSession(pFn)) {
|
if (isFileSession(pFn))
|
||||||
|
{
|
||||||
vector<sessionFileInfo>::iterator posIt = session._mainViewFiles.begin() + i;
|
vector<sessionFileInfo>::iterator posIt = session._mainViewFiles.begin() + i;
|
||||||
session._mainViewFiles.erase(posIt);
|
session._mainViewFiles.erase(posIt);
|
||||||
continue; //skip session files, not supporting recursive sessions
|
continue; //skip session files, not supporting recursive sessions
|
||||||
}
|
}
|
||||||
if (PathFileExists(pFn)) {
|
|
||||||
|
bool isWow64Off = false;
|
||||||
|
if (!PathFileExists(pFn))
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(FALSE);
|
||||||
|
isWow64Off = true;
|
||||||
|
}
|
||||||
|
if (PathFileExists(pFn))
|
||||||
|
{
|
||||||
lastOpened = doOpen(pFn, false, session._mainViewFiles[i]._encoding);
|
lastOpened = doOpen(pFn, false, session._mainViewFiles[i]._encoding);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
lastOpened = BUFFER_INVALID;
|
lastOpened = BUFFER_INVALID;
|
||||||
}
|
}
|
||||||
|
if (isWow64Off)
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
|
isWow64Off = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (lastOpened != BUFFER_INVALID)
|
if (lastOpened != BUFFER_INVALID)
|
||||||
{
|
{
|
||||||
showView(MAIN_VIEW);
|
showView(MAIN_VIEW);
|
||||||
@ -938,15 +976,31 @@ bool Notepad_plus::loadSession(Session & session)
|
|||||||
session._subViewFiles.erase(posIt);
|
session._subViewFiles.erase(posIt);
|
||||||
continue; //skip session files, not supporting recursive sessions
|
continue; //skip session files, not supporting recursive sessions
|
||||||
}
|
}
|
||||||
if (PathFileExists(pFn)) {
|
|
||||||
|
bool isWow64Off = false;
|
||||||
|
if (!PathFileExists(pFn))
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(FALSE);
|
||||||
|
isWow64Off = true;
|
||||||
|
}
|
||||||
|
if (PathFileExists(pFn))
|
||||||
|
{
|
||||||
lastOpened = doOpen(pFn, false, session._subViewFiles[k]._encoding);
|
lastOpened = doOpen(pFn, false, session._subViewFiles[k]._encoding);
|
||||||
//check if already open in main. If so, clone
|
//check if already open in main. If so, clone
|
||||||
if (_mainDocTab.getIndexByBuffer(lastOpened) != -1) {
|
if (_mainDocTab.getIndexByBuffer(lastOpened) != -1) {
|
||||||
loadBufferIntoView(lastOpened, SUB_VIEW);
|
loadBufferIntoView(lastOpened, SUB_VIEW);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
lastOpened = BUFFER_INVALID;
|
lastOpened = BUFFER_INVALID;
|
||||||
}
|
}
|
||||||
|
if (isWow64Off)
|
||||||
|
{
|
||||||
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
|
isWow64Off = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (lastOpened != BUFFER_INVALID)
|
if (lastOpened != BUFFER_INVALID)
|
||||||
{
|
{
|
||||||
showView(SUB_VIEW);
|
showView(SUB_VIEW);
|
||||||
|
@ -2103,7 +2103,6 @@ void FindReplaceDlg::doDialog(DIALOG_TYPE whichType, bool isRTL, bool toShow)
|
|||||||
enableReplaceFunc(whichType == REPLACE_DLG);
|
enableReplaceFunc(whichType == REPLACE_DLG);
|
||||||
|
|
||||||
::SetFocus(::GetDlgItem(_hSelf, IDFINDWHAT));
|
::SetFocus(::GetDlgItem(_hSelf, IDFINDWHAT));
|
||||||
//display();
|
|
||||||
display(toShow);
|
display(toShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user