command-t icon indicating copy to clipboard operation
command-t copied to clipboard

Avoid having to `: CommandTFlush` when using watchman

Open trotzig opened this issue 9 years ago • 2 comments

Since watchman will give you events whenever files are added/deleted, why do I have to flush the cache manually when using it?

trotzig avatar Aug 22 '16 15:08 trotzig

Because Vim is single threaded, we can't have a "listener thread" that would allow us to subscribe to these update events. (In current Vim master branch, we can spawn a long-running daemon process and communicate with it over a channel, so when I finish up the daemon process work currently on the next branch we will totally be able to do that.)

In the meantime, it wouldn't be too hard to implement this in an alternative way. We could issue a "since" query to see if anything has changed since the last query, and if so, do a full re-index (an incremental index update would probably be more complexity than it was worth).

I'd want to make this optional, though, defaulting to "on" (would make sense for most people). I can imagine crazy scenarios (very large repos in corporate environments where there may be a lot of background processing going on) where you wouldn't want this, because the cache would end up being invalidated all the time, so you'd end up rescanning all the time, and that might not be fast enough depending on the size of the repo.

wincent avatar Aug 23 '16 06:08 wincent

+1

mitermayer avatar Dec 06 '16 19:12 mitermayer

Given the big rewrite for v6.0.x, I'm closing all older issues as there is unlikely to be anything significant happening on the 5-x-devel branch from here on[^patches]. Feedback issue for 6.0.x is here:

  • https://github.com/wincent/command-t/issues/393

[^patches]: Patches and PRs would be welcome, but my personal efforts are going to be directed towards main.

wincent avatar Aug 26 '22 21:08 wincent