tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

Usage of `:Focus` with a given count #506

Closed teoljungberg closed 6 years ago

teoljungberg commented 6 years ago

If I use :.Focus (note .), I expect to focus on the test under the cursor. The output output of the command tells me as much:

:Dispatch -compiler=rails bin/rake spec SPEC=path/to/file_spec.rb:123

But, running :Focus to get the current focused dispatch task returns the default task:

Buffer default is :Dispatch -dir=path/to/project -compiler=rails bin/rake `=rails#buffer(1).default_rake_task(v:lnum)`

Where I would expect :.Focus to set the current :Dispatch command to what the output of the command was.

tpope commented 6 years ago

Using :.Focus shows you the exact command that :.Dispatch would run. It's especially helpful with dynamic backtick expressions, as you can tell by the limited information shown by :Focus. For the behavior you desire, I'm afraid you're stuck with typing out arguments to :Focus by hand.

tpope commented 6 years ago

I suppose you could alter :.Focus! to do what you want, since it doesn't currently have a defined behavior, if you're feeling ambitious.