Skip to content

Commit 297c0df

Browse files
committed
Allow 1-length python expressions
1 parent f7a688c commit 297c0df

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

autoload/sj/python.vim

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ function! sj#python#SplitImport()
103103
let indent = indent('.')
104104
let import_list = sj#GetMotion('vg_')
105105

106-
if stridx(import_list, ',') < 0
107-
return 0
108-
endif
109-
110106
let imports = split(import_list, ',\s*')
111107
let import_style = sj#settings#Read('python_import_style')
112108

@@ -497,7 +493,6 @@ function! sj#python#JoinMultilineString()
497493
return 1
498494
endfunction
499495

500-
501496
function! s:SplitList(regex, opening_char, closing_char)
502497
let [from, to] = sj#LocateBracesAroundCursor(a:opening_char, a:closing_char, ['pythonString'])
503498
if from < 0 && to < 0
@@ -507,7 +502,7 @@ function! s:SplitList(regex, opening_char, closing_char)
507502
call sj#PushCursor()
508503

509504
let items = sj#ParseJsonObjectBody(from + 1, to - 1)
510-
if len(items) <= 1
505+
if len(items) < 1
511506
call sj#PopCursor()
512507
return 0
513508
endif

0 commit comments

Comments
 (0)