dag / vim-fish

Vim support for editing fish scripts
MIT License
432 stars 59 forks source link

Comments are replaced by empty lines #26

Closed tusj closed 9 years ago

tusj commented 9 years ago

When editing a function with funced, the commented lines are replaced by empty lines.

This happens only if I use vim with this plugin and using the funced program. Removing this plugin, or not sourcing any files by setting the -u flag for vim, I don't have this problem. Simply calling vim test_function.fish will not trigger it either.

I don't see why it happens with funced, and maybe I did not properly probe the error. But it certainly is vim-fish which is causing the issue.

lilyball commented 9 years ago

I'm not seeing this. In fact, vim-fish doesn't even detect funced functions, because it doesn't have a filename or shebang.

What I am seeing is if the first line of a function is a comment, then the comment gets erased, but fish appears to be doing that on its end, when the function is created (either on the commandline or as a file stored in ~/.config/fish/functions/). Every comment after the very first line of the function is left intact, and survives being edited by vim.

Did you do something to make funced functions actually enable the fish filetype?

tusj commented 9 years ago

I retested on my machine with setting the nano as EDITOR, and I can confirm that it is the same problem. So that excludes vim-fish as the source. So false alarm, sorry for that.

I had a look at the funced definition, and from what I can see it does not seem to do that much.

lilyball commented 9 years ago

It's not funced, the actual function definition loses the comment. I'll file an issue on the fish project to track it. In the meantime, you should probably close this vim-fish issue.

lilyball commented 9 years ago

I've filed it as fish-shell/fish-shell#1710. Please comment there if I did not accurately capture what you're seeing.

tusj commented 9 years ago

Thanks. The report is what I experienced. Closing.