I created these 2 macros for that purpose.
cdb == cd to current buffer
cdp == cd to project dir
_command void cdb() name_info(',' VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_READ_ONLY|VSARG2_ICON)
{
// @see cd_to_file_dir ()
_str newdir=strip_filename (p_buf_name,'N');
if ( last_char (newdir)==FILESEP ) newdir=substr (newdir,1,length (newdir)-1);
if ( (newdir != '') && (getcwd () != newdir) )
{
cd (newdir, 'm');
// HS2: added to sync with 'Open' tab in project toolbar and process buffer
_cd_tbopen ();
_process_cd (newdir);
}
}
_command void cdp () name_info(',' VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_READ_ONLY|VSARG2_ICON)
{
_str cwd=_ProjectGet_WorkingDir (_ProjectHandle (_project_name));
if ( cwd != '' )
{
cwd=absolute (cwd,strip_filename (_project_name,'n'));
cd (cwd, 'm');
// HS2: added to sync with 'Open' tab in project toolbar and process buffer
_cd_tbopen ();
_process_cd (cwd);
}
}
Hope this is what you need.
HS2