Permalink
Browse files

Extend javascript function splitting to named functions

  • Loading branch information...
1 parent d0aaa6a commit 29ef34f7717dbeb1d962db103ef790fb51172e87 @AndrewRadev committed Sep 24, 2011
Showing with 3 additions and 4 deletions.
  1. +1 −1 autoload/sj/js.vim
  2. +2 −3 examples/test.js
View
@@ -19,7 +19,7 @@ function! sj#js#SplitObjectLiteral()
endfunction
function! sj#js#SplitFunction()
- if expand('<cword>') == 'function' && getline('.') =~ 'function\s*(.*)\s*{.*}'
+ if expand('<cword>') == 'function' && getline('.') =~ '\<function\>.*(.*)\s*{.*}'
normal! f{
return sj#js#SplitObjectLiteral()
else
View
@@ -7,6 +7,5 @@ var two = {
var three = { one: [two, three], four: "five, six", 'seven': /8, 9/ };
-var callback = function (something, other) {
- something_else;
-};
+var callback = function (something, other) { something_else; };
+function example(something, other) { something_else; }

0 comments on commit 29ef34f

Please sign in to comment.