Skip to content

Commit

Permalink
Only define commands in the right buffer types
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRadev committed Aug 23, 2016
1 parent 709db67 commit bedd843
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions autoload/ember_tools.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ function! ember_tools#Init()
endif

setlocal includeexpr=ember_tools#Includeexpr()
command! -count=0 -nargs=1 -buffer Extract call ember_tools#extract#Run(<line1>, <line2>, <f-args>)

command! -buffer Unpack call ember_tools#unpack#Run()
command! -buffer Inline call ember_tools#unpack#Reverse()
if ember_tools#IsTemplateFiletype()
command! -count=0 -nargs=1 -buffer Extract call ember_tools#extract#Run(<line1>, <line2>, <f-args>)
endif

if &filetype is 'javascript'
command! -buffer Unpack call ember_tools#unpack#Run()
command! -buffer Inline call ember_tools#unpack#Reverse()
end
endfunction

function! ember_tools#Includeexpr()
Expand Down

0 comments on commit bedd843

Please sign in to comment.