Is your feature request related something that is currently hard to do? Please describe.
Per https://groups.google.com/d/msg/vim_dev/aW2buOgZ6qI/fpxkp-V8AQAJ
In https://github.com/leitzler/govim (master branch) Pontus is adding support to govim for signs that correspond to quickfix entries.
This is done by calling sign_place/sign_unplace as required to get the signs for a buffer in the correct state.
If there are lots of errors in a file, then there can be a large number of calls to sign_place/sign_unplace made by govim in rapid succession.
Describe the solution you'd like
A function:
sign_setlist({bfnr}, {list} [, {action}])
that sets the signs for buffer {bufnr} to {list}. {action} is similar to setqflist in that the caller can specify whether to create, replace or add to existing signs.
Describe alternatives you've considered
The only apparent alternative at the moment is to call sign_getplaced and then make the necessary calls to sign_place/sign_unplace; over a channel this becomes expensive.
Additional context
n/a
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
Thinking about this some more, we should modify the existing sign_place() function to always accept a List argument
Just to say, I don't have any strong feelings either way. I'll defer to those with more experience of the Vim API and how changes are made.
—
You are receiving this because you commented.
—
You are receiving this because you commented.
My only comment here would be that sign_setlist as proposed in my original description not only handles setting of signs but also unsetting. That is, it ensures the buffer's sign list reflects the argument. Because in the context of my example I have the list of errors for a buffer (the same list that populates the quickfix window) and I simply want to say "now ensure the signs for this buffer are this list X", just as I call setqflist to update the quickfix window.
So from a selfish perspective I'd prefer not to have to keep track of/derive the delta to be applied, I'd like to just call a function that does all of that for me.
—
You are receiving this because you commented.
—
You are receiving this because you commented.
—
That's just one use case.
Yes, indeed: quite accept that I'm only speaking about my particular use case here.
The reason behind me being attracted to this approach is that it makes it simpler from a channel-based plugin to do everything with a single call (reduces round trips), which also means less flicker for the user. As I understand it, with two calls (clear then set) there is potential (likely?) for flickering.
—
You are receiving this because you commented.
—
You are receiving this because you commented.
The function calls can be in one message, right?
Very true.
—
You are receiving this because you commented.
The function calls can be in one message, right?
Very true.
As a follow up to this point (and hopefully not straying too far off topic on this thread), we now have a first cut of batching calls in govim (which could easily be extended to include the other channel functions if required):
(which was then accompanied by a later bug fix myitcv/govim@2848a08)
The approach works well.
That said, the changes in this will likely still be a benefit I'd assume? Because we move from multiple function calls to two calls with list arguments.
—
You are receiving this because you commented.
—
You are receiving this because you are subscribed to this thread.