File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ function! sj#python#SplitString()
394394 return 0
395395 endif
396396
397- let string_pattern = ' \(\ %(^\|[^\\]\)\zs\(['' "]\) \).\{-}[^\\]\+\2 '
397+ let string_pattern = ' \%(^\|[^\\]\)\zs\(['' "]\+ \).\{-}[^\\]\1 '
398398 let empty_string_pattern = ' \%('''' \|""\)'
399399
400400 let lineno = line (' .' )
Original file line number Diff line number Diff line change @@ -562,5 +562,29 @@ def example():
562562 """, three)
563563 EOF
564564 end
565+
566+ it "handles multiple strings on one line " do
567+ set_file_contents 'string = "foo" + "bar"'
568+
569+ vim . search '"foo'
570+ split
571+
572+ assert_file_contents <<~EOF
573+ string = """
574+ foo
575+ """ + "bar"
576+ EOF
577+ join
578+
579+ vim . search '"bar'
580+ split
581+
582+ assert_file_contents <<~EOF
583+ string = "foo" + """
584+ bar
585+ """
586+ EOF
587+ join
588+ end
565589 end
566590end
You can’t perform that action at this time.
0 commit comments