On 4/11/07, Bob Hiestand <[EMAIL PROTECTED]> wrote:
  Is there any way to determine whether a particular window has its
path set with :lcd?

I think vi has no direct simple way to determine this.

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).
- Overly complicated.

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

Yakov

Reply via email to