-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix :AckHelp command bug with missing *.txt files #182
base: master
Are you sure you want to change the base?
Conversation
If there are no *.txt files in the doc directory, the ack command errors out. Globbing for those files while generating the file list fixes the issue.
This improves the quickfix list filenames in the case when the found files are under the current directory.
Thanks! On the surface this looks great, but in testing it some problems are surfacing for me—I may need to further reduce my config, but let's see if you can corroborate any of this. There are quite possibly extant issues to blame here that I just haven't personally noticed without changing settings from what I normally use, because just looking at this change it shouldn't seem to cause any problem. So please bear with me… The main issue I'm seeing when using this change occurs with By the way, to get it to behave even this nicely with Dispatch, I had to add let g:ackprg = 'ack -s -H --nocolor --nogroup --column --nopager' My personal That's beside the point of this issue of course, just thinking out loud and also mentioning it in case you need to do the same to test with Dispatch… So in summary, the first thing to try to resolve is that any time I have |
Otherwise if a user has something like `--pager=less` as a default in their `~/.ackrc`, Ack may think that it's running interactively if executed in a separate shell e.g. when `g:ack_use_dispatch` is enabled. This will result in broken behavior loading results in Vim. See #182 for some background.
Ugh, well, oddly it seems fine using Dispatch's iTerm support, I'm not experiencing the same pager interruption. I'd like to find some way to sort this out, since using Dispatch with tmux is how I personally run Vim primarily 😄 It is eluding me how the changes in this branch make any difference here 😩 Second, I seem to have problems with the
Can you reproduce this? The second commit that adds |
Testing one runtimepath component when :let p = fnamemodify('/Users/ches/.vim/bundle/dash.vim/' . '/doc/', ':~:.')
:echo p " => ~/.vim/bundle/dash.vim//doc/
:echo isdirectory(p) " => 0
:echo isdirectory(expand(p)) " => 1 |
Huh, I didn't expect this to be an issue. I've pushed a commit that uses |
As for the pager, I don't really know. I don't use dispatch, and I don't have tmux set up, so it's a bit difficult to test it out (and I'm not on a Mac, so iTerm is also out :)). It seems weird that this particular change would affect the pager option. Maybe it's the Adding |
If there are no *.txt files in one of the doc directories, the ack command errors out. Globbing for those files while generating the file list fixes the issue.
I've also added an extra improvement that I can remove if you'd prefer. The
fnamemodify
call shortens the file path as much as possible, so, if I'm running:AckHelp
from within/home/andrew/.vim
, instead of getting paths like/home/andrew/.vim/bundle/ack/...
, I just getbundle/ack/...
. This seems to make a difference to my quickfix window, at least.