wellle / tmux-complete.vim

Vim plugin for insert mode completion of words in adjacent tmux panes
MIT License
515 stars 21 forks source link

Minor fixes to the sh script #51

Closed blueyed closed 9 years ago

wellle commented 9 years ago

Good stuff!

But --no-run-if-empty is not available for BSD xargs (like on Mac OS). Do you see a more portable way?

blueyed commented 9 years ago

But it has the short -r option for comparability? (http://www.freebsd.org/cgi/man.cgi?query=xargs)

wellle commented 9 years ago

Sounds good, lets use -r then.

blueyed commented 9 years ago

Amended the commit.

wellle commented 9 years ago

Actually no, unfortunately it still doesn't work.

1__root_storage-1____sh__and_add_click_time_ _8ad181c_ _adjust_android_sdk_and_graphite_browser

For reference, here's man xargs on my Mac, it doesn't have the -r either: https://gist.github.com/wellle/719a7fea9d3243bcce92

Sorry for all the back and fourth.

blueyed commented 9 years ago

Does it behave like with -r though? What does echo | xargs echo 1 say for you?

wellle commented 9 years ago

Yes that screenshot was with the -r version. It looked similar with --no-run-if-empty.

It prints nothing:

~: echo | xargs echo 1
~:
blueyed commented 9 years ago

Ok. A workaround might be to use -r conditionally then, or test for the list before calling capturepane (what I've done now).

wellle commented 9 years ago

Yeah I think checking the list is the cleanest approach. Now you can remove the -r again.

blueyed commented 9 years ago

Yes, amended the commit(s).

wellle commented 9 years ago

Beautiful, thank you :+1: