Skip to content

Commit

Permalink
Merge pull request #6 from kidonchu/feature/block-param-component-gf
Browse files Browse the repository at this point in the history
Allow finding block-param type component with opening tag '{{#...'
  • Loading branch information
AndrewRadev authored Aug 21, 2016
2 parents db5ef1f + 39984b7 commit 57da5a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/ember_tools/gf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function! ember_tools#gf#TemplateComponent()
return ''
endif

if !ember_tools#search#UnderCursor('^\s*\%(=\|{{\)\{}\s*\zs\k\+')
if !ember_tools#search#UnderCursor('^\s*\%(=\|{{#\|{{\)\{}\s*\zs\k\+')
return ''
endif

Expand Down
16 changes: 16 additions & 0 deletions spec/plugin/gf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@
expect(current_file).to eq 'app/pods/foo/bar-baz/template.hbs'
end

specify "finding a component with block expression" do
touch_file 'app/components/foo/bar-baz/template.hbs'
edit_file 'app/templates/example.hbs', <<-EOF
<p>
{{#foo/bar-baz param1=something}}
<p>Foo Bar</p>
{{/foo/bar-baz}}
</p>
EOF
vim.search 'foo/bar-baz'

vim.normal 'gf'

expect(current_file).to eq 'app/components/foo/bar-baz/template.hbs'
end

specify "finding a controller action" do
edit_file 'app/controllers/foo.js', <<-EOF
export default Ember.Controller.extend({
Expand Down

0 comments on commit 57da5a9

Please sign in to comment.