@@ -308,18 +308,20 @@ function! s:build_docstring(strs, indent, nested_indent)
308308 call add (docstrings, a: indent . template)
309309 endfor
310310 endif
311- elseif line = ~ ' {{_indent_}}'
312- let arg = substitute (line , ' {{_indent_}}' , a: indent , ' g' )
313- call add (docstrings, arg)
314- elseif line = ~ ' {{_returnType_}}\|{{_return_type_}}'
311+ elseif match (line , ' {{_returnType_}}\|{{_return_type_}}' ) != -1
315312 if strlen (return_type) != 0
313+ let line = substitute (line , ' {{_indent_}}' , a: indent , ' g' )
314+ let line = substitute (line , ' {{_nested_indent_}}' , a: nested_indent , ' g' )
316315 let rt = substitute (line , ' {{_returnType_}}\|{{_return_type_}}' , return_type, ' ' )
317316 call add (docstrings, a: indent . rt)
318317 else
319318 if docstrings[-1 ] == ' '
320319 call remove (docstrings, -1 )
321320 endif
322321 endif
322+ elseif line = ~ ' {{_indent_}}'
323+ let arg = substitute (line , ' {{_indent_}}' , a: indent , ' g' )
324+ call add (docstrings, arg)
323325 elseif line == ' """' || line == " '''"
324326 call add (docstrings, a: indent . line )
325327 else
0 commit comments