From 39984b7cb70d3cc1ca0975445bc13ea818d31e83 Mon Sep 17 00:00:00 2001 From: Kidon Chu Date: Sun, 21 Aug 2016 01:15:32 -0500 Subject: [PATCH] Remove extra pipe in regex and add test --- autoload/ember_tools/gf.vim | 2 +- spec/plugin/gf_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/autoload/ember_tools/gf.vim b/autoload/ember_tools/gf.vim index 46a3564..679551b 100644 --- a/autoload/ember_tools/gf.vim +++ b/autoload/ember_tools/gf.vim @@ -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 diff --git a/spec/plugin/gf_spec.rb b/spec/plugin/gf_spec.rb index e4123b2..db9e60f 100644 --- a/spec/plugin/gf_spec.rb +++ b/spec/plugin/gf_spec.rb @@ -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 +

+ {{#foo/bar-baz param1=something}} +

Foo Bar

+ {{/foo/bar-baz}} +

+ 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({