Hi,
On 4/28/07, Navdeep Parhar <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
> > > >
> > > > Currently :cscope has a variant :lcscope that allows the use of
> > > > the location list instead of the quickfix list. However, :scscope
> > > > has no equivalent that uses the location list. Please note that
> > > > :scs splits only if cscope returns some results, so :scs is not
> > > > the same as ":split cs". Due to this reason ":split lcscope" can
> > > > not be used to get the same behaviour as the proposed :lscscope.
> > > >
> >
> > I'm confused. I tried exercising this patch and I'm not getting the
> > results I expect, but I don't know if it's the patch, the behavior
> > of location lists, or me.
> >
>
> This problem is caused by the patch for the ":lscs" command.
>
> When the ":lcs" command is executed, a new location list is
> created for the current window and then the cursor is moved to the
> first entry in the location list.
>
> The ":lscs" command splits the window after the location list is
> created. This results in the problem.
>
> In your case, when you executed the ":lscs" command in the
> first window, the new location list is added to the first window
> and then the window is split.
>
> When you invoked the second "lscs" command, a new location
> list is added to the second window and then the window is split.
>
This is correct. The problem both times is that the split takes
place after the error list has been constructed.
I have reworked the patch a bit. Now it splits the window
before constructing the error list. I'd like to point out
that with this modification the behaviour if qf_init fails
will be different from what it is today. The split will
have taken place by the time qf_init gets called.
This may not be desirable. This will break backwards
compatibility. When the ":lscscope" command fails, the
current window should not be split and also the location
list for the current window should not be modified.
- Yegappan
Other than this everything should mostly work as advertised.
New patch is attached to this email.
Regards,
Navdeep
> Also, when jumping to the match from the location list, the
> location list for the window before the split is used. This results
> in the second problem you saw after closing the windows.
>
> When the location list support was added to Vim7, as the ":lscscope"
> command was not supported, this condition was not taken into
> account.
>
> - Yegappan
>