Fix current directory not applied bug after changing current directory option
Refresh the working directory when changing Follow current document preference. Fix #10396, close #10426
This commit is contained in:
parent
cd8e479ffa
commit
d41b4e1645
|
@ -2671,6 +2671,15 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPPM_INTERNAL_REFRESHWORKDIR:
|
||||||
|
{
|
||||||
|
const Buffer* buf = _pEditView->getCurrentBuffer();
|
||||||
|
generic_string path = buf ? buf->getFullPathName() : _T("");
|
||||||
|
PathRemoveFileSpec(path);
|
||||||
|
setWorkingDir(path.c_str());
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (message == WDN_NOTIFY)
|
if (message == WDN_NOTIFY)
|
||||||
|
|
|
@ -2148,6 +2148,7 @@ INT_PTR CALLBACK DefaultDirectorySubDlg::run_dlgProc(UINT message, WPARAM wParam
|
||||||
{
|
{
|
||||||
case IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO:
|
case IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO:
|
||||||
nppGUI._openSaveDir = dir_followCurrent;
|
nppGUI._openSaveDir = dir_followCurrent;
|
||||||
|
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_REFRESHWORKDIR, 0, 0);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), false);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), false);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), false);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), false);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -2158,6 +2159,7 @@ INT_PTR CALLBACK DefaultDirectorySubDlg::run_dlgProc(UINT message, WPARAM wParam
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case IDC_OPENSAVEDIR_ALWAYSON_RADIO:
|
case IDC_OPENSAVEDIR_ALWAYSON_RADIO:
|
||||||
nppGUI._openSaveDir = dir_userDef;
|
nppGUI._openSaveDir = dir_userDef;
|
||||||
|
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_REFRESHWORKDIR, 0, 0);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), true);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), true);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), true);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), true);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -632,6 +632,7 @@
|
||||||
#define NPPM_INTERNAL_UPDATETEXTZONEPADDING (NOTEPADPLUS_USER_INTERNAL + 58)
|
#define NPPM_INTERNAL_UPDATETEXTZONEPADDING (NOTEPADPLUS_USER_INTERNAL + 58)
|
||||||
#define NPPM_INTERNAL_REFRESHDARKMODE (NOTEPADPLUS_USER_INTERNAL + 59)
|
#define NPPM_INTERNAL_REFRESHDARKMODE (NOTEPADPLUS_USER_INTERNAL + 59)
|
||||||
#define NPPM_INTERNAL_SCINTILLAFINDERCOPYPATHS (NOTEPADPLUS_USER_INTERNAL + 60)
|
#define NPPM_INTERNAL_SCINTILLAFINDERCOPYPATHS (NOTEPADPLUS_USER_INTERNAL + 60)
|
||||||
|
#define NPPM_INTERNAL_REFRESHWORKDIR (NOTEPADPLUS_USER_INTERNAL + 61)
|
||||||
|
|
||||||
// See Notepad_plus_msgs.h
|
// See Notepad_plus_msgs.h
|
||||||
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
||||||
|
|
Loading…
Reference in New Issue