Skip to content

Commit 5849cdf

Browse files
authored
Fix ignore invalid blank after {{_header_}} section (#35)
1 parent fc8735f commit 5849cdf

File tree

8 files changed

+22
-6
lines changed

8 files changed

+22
-6
lines changed

CHANGES.rst

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Version 0.1.5
2+
-------------
3+
Released on Nov 18th 2017
4+
5+
- Fix bug
6+
7+
- Invalid space after {{_header_}}
8+
- Document's custom template section was wrong
9+
10+
see https://github.com/heavenshell/vim-pydocstring/issues/34
11+
12+
Thx @themightyoarfish
13+
114
Version 0.1.4
215
-------------
316
Released on Sep 10th 2017

autoload/pydocstring.vim

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Insert Docstring.
22
" Author: Shinya Ohyanagi <[email protected]>
3-
" Version: 0.1.4
3+
" Version: 0.1.5
44
" WebPage: http://github.com/heavenshell/vim-pydocstriong/
55
" Description: Generate Python docstring to your Python script file.
66
" License: BSD, see LICENSE for more details.
@@ -157,7 +157,6 @@ function! s:builddocstring(strs, indent, nested_indent)
157157
if line =~ '{{_header_}}'
158158
let header = substitute(line, '{{_header_}}', prefix, '')
159159
call add(docstrings, a:indent . header)
160-
call add(docstrings, '')
161160
elseif line =~ '{{_args_}}'
162161
if len(args) != 0
163162
for arg in args

doc/pydocstring.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*pydocstring.txt* Generate Python docstring to your Python code.
22

3-
Version: 0.1.4
3+
Version: 0.1.5
44
Author: Shinya Ohynagi <[email protected]>
55
Repository: http://github.com/heavenshell/vim-pydocstring/
66
License: BSD, see LICENSE for more details.
@@ -191,7 +191,7 @@ Numpy style docstring template example.
191191
>
192192
"""{{_header_}}
193193
194-
{{_arg_}} :{{_lf_}}{{_indent_}} {{_arg_}} is
194+
{{_args_}} :{{_lf_}}{{_indent_}} {{_args_}} is
195195
"""
196196
<
197197
Set cursor on `def arg1` line and type following.
@@ -217,7 +217,7 @@ Nested indent example.
217217
"""{{_header_}}
218218
219219
{{_indent_}}Args:
220-
{{_nested_indent_}}{{_arg_}}:
220+
{{_nested_indent_}}{{_args_}}:
221221
"""
222222
<
223223
Set cursor on `def arg1` line and type following.

ftplugin/python/pydocstring.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" File: pydocstring.vim
22
" Author: Shinya Ohyanagi <[email protected]>
3-
" Version: 0.1.4
3+
" Version: 0.1.5
44
" WebPage: http://github.com/heavenshell/vim-pydocstriong/
55
" Description: Generate Python docstring to your Python script file.
66
" License: BSD, see LICENSE for more details.

template/pydocstring/multi.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""{{_header_}}
2+
23
:param {{_args_}}:
34
:rtype: {{_returnType_}}
45
"""
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""{{_header_}}
2+
23
{{_args_}}:{{_lf_}}{{_indent_}} the ...
34
return ({{_returnType_}}):
45
"""

test/templates/issue19/multi.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'''
22
{{_header_}}
3+
34
{{_indent_}}Args:
45
{{_nested_indent_}}{{_args_}}:
56
'''

test/templates/numpy/multi.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""{{_header_}}
2+
23
{{_indent_}}Parameters
34
{{_indent_}}----------
45

0 commit comments

Comments
 (0)