heavenshell / vim-pydocstring

Generate Python docstring to your Python source code.
BSD 3-Clause "New" or "Revised" License
337 stars 53 forks source link

Extra lines #19

Closed brainscience closed 7 years ago

brainscience commented 7 years ago

In my multi.txt I have: {{indent}}''' {{header}} {{indent}}Args: {{_nestedindent}}{{args}}: {{indent}}'''

1) If I don't put the leading and trailing {{indent}} the ''' are not indented. 2) After the final arg vim-pydocstring inserts an extra newline before the closing '''. Is there a way automatically remove the final newline?

heavenshell commented 7 years ago

Can you show me what is actual output and expected output?

2017-03-25 2 26 21
heavenshell commented 7 years ago

@brainscience ah, investigated.

Try https://github.com/heavenshell/vim-pydocstring/tree/fix/issue_19 branch Change template like followings.

'''
{{_header_}}
{{_indent_}}Args:
{{_nested_indent_}}{{_args_}}:
'''
brainscience commented 7 years ago

Here is the result: def func(arg1, arg2): ''' func

Args:
    arg1:
    arg2:

''' Notice the quotes are not indented.

I actually need to put an {{indent} in front of the triple quotes to make it work. This is Mac OS X and I have softtabstop=4 as indicated.

The template works fine on Windows 10.

On Fri, Mar 24, 2017 at 9:23 PM, Shinya Ohyanagi notifications@github.com wrote:

@brainscience https://github.com/brainscience ah, investigated.

Try https://github.com/heavenshell/vim-pydocstring/tree/fix/issue_19 branch Change template like followings.

''' {{header}} {{indent}}Args: {{_nestedindent}}{{args}}: '''

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heavenshell/vim-pydocstring/issues/19#issuecomment-289182054, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQHlz9M9BdHecCZdC_CuPIpTK8KA1lLks5rpHqtgaJpZM4MnQZA .

heavenshell commented 7 years ago

Did you try issue19 branch?

Notice the quotes are not indented.

Yeah, ''' did not indented. so i fixed.

Here is tests. https://github.com/heavenshell/vim-pydocstring/blob/fix/issue_19/test/issue19.vader#L24-L40

And seems fine. https://travis-ci.org/heavenshell/vim-pydocstring/builds/214875566#L1899-L1909

brainscience commented 7 years ago

Tried issue19 and had exactly the same behavior. The quotes still do not indent.

On Fri, Mar 24, 2017 at 10:10 PM, Shinya Ohyanagi notifications@github.com wrote:

Did you try issue19 branch?

Notice the quotes are not indented.

Yeah, ''' did not indented. so i fixed.

Here is tests. https://github.com/heavenshell/vim-pydocstring/blob/fix/issue_19/test/ issue19.vader#L24-L40

And seems fine. https://travis-ci.org/heavenshell/vim-pydocstring/ builds/214875566#L1899-L1909

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heavenshell/vim-pydocstring/issues/19#issuecomment-289184674, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQHl-EO8qFszrnGBZep9FL0klWDb-xVks5rpIWrgaJpZM4MnQZA .

heavenshell commented 7 years ago

Thx Very strange. https://github.com/heavenshell/vim-pydocstring/blob/fix/issue_19/autoload/pydocstring.vim#L214 This line would solve quote problem... How about dobule quote. Is it ok?

Can you show me mult.txt? Adn is there any setting about pydocstring at your vimrc?

your https://github.com/heavenshell/vim-pydocstring/issues/19#issue-216547169 was broken(_ converts to markdown).

heavenshell commented 7 years ago

Works fine for me...

2017-03-25 12 49 27
brainscience commented 7 years ago

Sure. See attached:

On Fri, Mar 24, 2017 at 10:50 PM, Shinya Ohyanagi notifications@github.com wrote:

Works fine for me... [image: 2017-03-25 12 49 27] https://cloud.githubusercontent.com/assets/56591/24319254/84f4182a-1159-11e7-9da1-2c6e278d13bd.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heavenshell/vim-pydocstring/issues/19#issuecomment-289186459, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQHlwzU_4Hs8BorB8b-ZSw1-9jH33Epks5rpI7qgaJpZM4MnQZA .

''' {{header}} {{indent}}Args: {{_nestedindent}}{{args}}: '''

heavenshell commented 7 years ago

can you show me your tabsettings?

autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
brainscience commented 7 years ago

My tabsettings are exactly as you have them written. I went back to

{{indent}}''' {{header}} {{indent}}Args: {{_nestedindent}}{{args}}: {{indent}}'''

which works fine. This seems to be something specific to VIM on the Mac. My Linux and Windows machines work according to your documentation.

On Sat, Mar 25, 2017 at 12:30 AM, Shinya Ohyanagi notifications@github.com wrote:

can you show me your tabsettings?

autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heavenshell/vim-pydocstring/issues/19#issuecomment-289190474, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQHl13qYqNzAmYhUR-_-XHrMyXbdOQyks5rpKaKgaJpZM4MnQZA .

heavenshell commented 7 years ago

Thx Ok, I'll merge it to master.

This seems to be something specific to VIM on the Mac.

I use MacVim and works fine.

Anyway thx for reporting this issue!