Author Topic: def-switchbuf-cd - How do I turn it off?  (Read 5652 times)

Steve Black

  • Community Member
  • Posts: 57
  • Hero Points: 4
def-switchbuf-cd - How do I turn it off?
« on: August 10, 2007, 09:21:59 PM »
I turned this setting on and it works just fine.  But now I've decided I don't like it so much and I want to turn it off.  Logic dictates that I should set it to 0, the same way I set it to 1.  Unfortunately, while the value does seem to get changed, it has no effect on the behavior.  How do I get out of here???

(Actually, what I'd really like is for the cwd to change with buffer switching as it pertains to open/save dialgogs, but for Tools->OS Shell to open up in the project working directory.  Is there a way to acheive that?)

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: def-switchbuf-cd - How do I turn it off?
« Reply #1 on: August 10, 2007, 09:28:36 PM »
Here we go:
Code: [Select]
_command void pdos ()
{
   _str cwd=_ProjectGet_WorkingDir (_ProjectHandle (_project_name));

   if ( cwd != '' )
   {
      cwd=absolute (cwd,strip_filename (_project_name,'N'));

      // say ( "cdp (): Change directory '" getcwd () " -> '" cwd "'" );
      // '-p': don't change dir in build window
      cd ('-p 'cwd);
   }
   dos();
}

Have fun,
HS2

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: def-switchbuf-cd - How do I turn it off?
« Reply #2 on: August 10, 2007, 09:33:12 PM »
In case the 'cd' interferes w/ sth. else you could enclose the code above in:

Code: [Select]
   cur_dir := getcwd ();

   // code

   cd ( '-p 'cur_dir );

HS2

Steve Black

  • Community Member
  • Posts: 57
  • Hero Points: 4
Re: def-switchbuf-cd - How do I turn it off?
« Reply #3 on: August 14, 2007, 06:36:39 PM »
Thanks, that's great.  It even forced me to figure out how to use vusrmacs.e.!