Tuesday, October 24, 2023

Re: Location list entries for unsaved buffer open a new buffer



On Sat, Oct 21, 2023 at 10:08 AM Lifepillar <lifepillar@lifepillar.me> wrote:
On 2023-10-21, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
> On Sat, Oct 21, 2023 at 7:09 AM Lifepillar <lifepillar@lifepillar.me> wrote:
>> How do I generate location list entries that refer to the proper unsaved
>> buffer?
>>
>>
> There is a item in the  todo list for more than 20 years now for this:
>
> -   Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh
> Govindachar)

:-) I have found the following workaround: I pass the buffer number to

I have created the PR https://github.com/vim/vim/pull/13419 to support this.
Can you try out the diff in the PR and let me know if you see any issues?

- Yegappan
 
the callback, then I iterate over each parsed line and manually set the
buffer:

    def Callback(channel: channel, msg: string, bufnr: number, ...)
      [...]
      var what = getqflist({"lines": [msg], "efm": efm})

      for item in what.items
        item["bufnr"] = bufnr
      endfor

      setloclist(winid, what.items, "a")
    enddef

Life.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAW7x7kU69qOtyy_UYWk_iKeH9pEXfAEPAir7Jf0E8FLyb4wFw%40mail.gmail.com.

No comments:

Post a Comment