diff --git a/autoload/sj/cue.vim b/autoload/sj/cue.vim index a2475c5b..dd698415 100644 --- a/autoload/sj/cue.vim +++ b/autoload/sj/cue.vim @@ -1,3 +1,15 @@ +function! sj#cue#SplitImports() + let pattern = '^import\s\+\(\%(\k\+\s\+\)\=\%(".*"\)\)$' + + if getline('.') =~ pattern + call sj#Keeppatterns('s/' . pattern . '/import (\r\1\r)/') + normal! k== + return 1 + else + return 0 + endif +endfunction + function! sj#cue#SplitStructLiteral() let [from, to] = sj#LocateBracesOnLine('{', '}') diff --git a/ftplugin/cue/splitjoin.vim b/ftplugin/cue/splitjoin.vim index 7f0739fc..4084bef2 100644 --- a/ftplugin/cue/splitjoin.vim +++ b/ftplugin/cue/splitjoin.vim @@ -3,7 +3,7 @@ if !exists('b:splitjoin_split_callbacks') \ 'sj#cue#SplitStructLiteral', \ 'sj#cue#SplitArray', \ 'sj#cue#SplitArgs', - \ 'sj#go#SplitImports', + \ 'sj#cue#SplitImports', \ ] endif