Skip to content

Commit cf178b0

Browse files
committed
copy go's function because it may diverge
1 parent 43e42ee commit cf178b0

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

autoload/sj/cue.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
function! sj#cue#SplitImports()
2+
let pattern = '^import\s\+\(\%(\k\+\s\+\)\=\%(".*"\)\)$'
3+
4+
if getline('.') =~ pattern
5+
call sj#Keeppatterns('s/' . pattern . '/import (\r\1\r)/')
6+
normal! k==
7+
return 1
8+
else
9+
return 0
10+
endif
11+
endfunction
12+
113
function! sj#cue#SplitStructLiteral()
214
let [from, to] = sj#LocateBracesOnLine('{', '}')
315

ftplugin/cue/splitjoin.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if !exists('b:splitjoin_split_callbacks')
33
\ 'sj#cue#SplitStructLiteral',
44
\ 'sj#cue#SplitArray',
55
\ 'sj#cue#SplitArgs',
6-
\ 'sj#go#SplitImports',
6+
\ 'sj#cue#SplitImports',
77
\ ]
88
endif
99

0 commit comments

Comments
 (0)