dag / vim-fish

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

Improve fish#Indent(). #29

Open Raimondi opened 9 years ago

Raimondi commented 9 years ago

This PR addresses some problems with the current fish#indent() function:

In this gist you can compare the results of using gg=G in a really bad indented fish file with the current and the proposed fish#indent().

ElijahLynn commented 9 years ago

May I ask what your improvement is? There aren't any comments and the code isn't that self documenting.

Raimondi commented 9 years ago

My bad, I was too tired when I finished it and created the PR. I have added comments to the code, a more explicit commit message and some text to the PR comment.

dag commented 6 years ago

I'm trying to work through the PR queue but this is a bit much for me to review at the moment (not having touched vim scripting for years and not having vim, git, fish or vim-fish currently set up).

However, if I remember correctly the idea was you use gq to format larger blocks of code, which will use the native fish_indent program that should probably handle every case correctly. fish#Indent() is meant to handle manual line-by-line input efficiently; is that working for you?

dag commented 6 years ago

See also the comments on #20. Does your changes work with endwise?

amiller27 commented 6 years ago

@dag Is there any way this could get merged? I tested with endwise and it seems to work. The indent functionality on master is broken for me and this fixes it.

MindTooth commented 5 years ago

Could this be merged if @Raimondi rebased on master? Having the end living its own life is a bit annoying.