On 4/11/07, Yakov Lerner <[EMAIL PROTECTED]> wrote:
I needed this once in of my script. I ended with some rude
simplification/workaround, lackng the direct simple solution.
I don't know your specific case, but you might find simlpistic workaround.

One weird attempt to determine this would be to (I did not do it):
  (1) get getcwd() in the window in quiestion
  (2) create temp new window with :new
  (3)  get getcwd() in the new temp window
  (4) compare cwd from step (3) against cwd from step(1)
  (5) :bw the temp window
This has lots of drawcacks:
- I am not sure this sequence works in the presence of :acd thought.
- I am not sure this sequence works at all, but I can't think of other
method either.
- This sequence won't detect one subtle case: case the :lcd is set, but is set
to directory X where X is same as current directory. (This case behaves
differently that case without  :lcd, but this difference might not
matter to you).

I don't think it works.  When you use :new, you inherit the :lcd, if
it was used.

Maybe vim needs new functions getlcwd(), hetgcwd(), or additional 2nd
param to getcwd() to return global/local dir.

After looking in the :help todo, it appears that others have requested
it.  I've thrown together a quick patch to implement the described
'cdcmd()' (I prefer a more direct 'isdirlocal()'), but that's fine.
I'll try submitting it.

Thank you,

bob

Reply via email to