-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve fish#Indent(). #29
base: master
Are you sure you want to change the base?
Conversation
May I ask what your improvement is? There aren't any comments and the code isn't that self documenting. |
- Fix: multiline strings should not be modified. - Fix: "end" is always decreased by one. - Fix: "case" and "else" are always decreased by one. - Fix: continued lines are not treated differently. - Fix: "if", "while", etc followed by "begin" should increment next line by two instead of by one. - Fix: "case" should be one more than "switch". - Fix: multiline strings and continued lines are considered in the calculations for the next line.
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. |
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 |
See also the comments on #20. Does your changes work with endwise? |
@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. |
Could this be merged if @Raimondi rebased on |
This PR addresses some problems with the current fish#indent() function:
by two instead of by one.
calculations for the next line.
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().