[ANN] New awesome vim plug-in using Ruby bindings
felipe.contreras at gmail.com
Fri May 4 04:55:15 PDT 2012
On Wed, May 2, 2012 at 10:41 PM, Anton Khirnov <anton at khirnov.net> wrote:
> On Mon, 23 Apr 2012 04:12:32 +0300, Felipe Contreras <felipe.contreras at gmail.com> wrote:
>> * Gradual searches; you don't have to wait for the whole search to finish,
>> sort of like the 'less' command
> How did you do that? When I tried to do this in my version, I got hit by
> vim not being threadsafe.
I first started with Ruby fibers, but stumbled upon a bug, and then I
realized I didn't actually need them; in Ruby there is an Enumerable
class, which the Notmuch::Threads class includes, and one of the
methods allows to get only a certain number of items, so regardless of
what happens in the back, I only get a certain number of items at a
time. This is particularly easy thanks to Ruby blocks, but I guess you
can achieve the same in Python somehow.
Each time the cursor changes I check if a certain threshold of items
has been passed, and if so, get one more chunk.
More information about the notmuch