-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dispatch is a great hack. It mostly works without problems if you just want to, well, dispatch any programs. But it has different adapters that all act a bit different, uses a blacklist for certain escape sequences and it's not very configurable, which makes it hard to include in other plugins. Also because of Vim's textlock, you can't close the quickfix window that dispatch opens, even if there are no matches at all. Consider this: function! s:foo() cclose endfunction autocmd FileType qf call s:foo() let &makeprg = 'grep -Rn qu'.'ux .' let &errorformat = '%f:%l:%m' Make This will close the quickfix window, but also jump to the first line of the buffer and there's no way to avoid this. If you need real async search without resorting to complicated hacks, use Neovim instead.
- Loading branch information
Showing
3 changed files
with
14 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c345137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch - this hurts. I really like the async search capability, but I'm not ready to switch to nvim yet since homebrew python and nvim doesn't seem to work.
c345137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a tough call, but I don't like implementing something that only works for mainstream use cases and breaks for everything else. Also I could simplify the code quite a bit now, since I don't have to work around dispatch all the time anymore.
On another note, maybe we'll get a proper job control in Vim, too! See
:helpgrep startjob
, if you have a very recent version. As of some days ago, we even have functions for (un)marshalling JSON viajsonencode()
/jsondecode()
, so Bram is apparently serious about implementing some more modern features now. (Maybe because of Neovim?)c345137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood - well, because of your change, I bit the bullet and installed neovim. There was some python related pain, but I seem to be past that and it works so far. Perhaps this will serve me well going forward. Thanks!
c345137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to keep pestering on this commit. Does the new-ish async functionality in vim offer any decent option here? I realize it's not fun supporting multiple async APIs, but I guess this is the reality for the short-term.
c345137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was away the last 2 months, but will have a look at the new API. Sounds promising at least. Please see #48 for further developments.