On 5/31/06, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:
Hi,

On 5/31/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
> How about
>
> set errorformat+=%f,%f:%m,%f:%l:%m
>
> command! -nargs=* Bufgrep silent! bufdo! g/<args>/caddexpr expand("%")
> . ":" . line(".") .  ":" . getline(".")
>
> It does have a problem where it tries to open the first entry
> automatically, but it opens the line contents instead of the buffer
> name, but it does the right thing otherwise.  Hmm, weird.
>

The ":caddexpr" command will not jump to the first entry.

The ":bufdo"  command loads all the buffers and runs the specified
command. When the ":bufdo" command completes, the last buffer will
be displayed in the current window.

When the ":g" command completes the cursor will be positioned on the
last matching pattern.

So when you execute the ":Bufgrep" command, the cursor will be
positioned on the last matching pattern position in the last buffer.

- Yegappan


Unfortunately, what it was doing was not leaving at the last buffer,
but trying to open buffers with the names comprised of the matched
line contents.

However, I've quit that gvim process, and it won't happen in the new
gvim process, so I guess I'll deal with it if it comes back.

Reply via email to