Skip to content

Commit

Permalink
Remove extra pipe in regex and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kchu-activecampaign committed Aug 21, 2016
1 parent 0adbce3 commit 39984b7
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 39984b7

Please sign in to comment.