Skip to content
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

de-indent correctly after typing 'fi' #16

Closed
wants to merge 1 commit into from

Conversation

aswild
Copy link
Contributor

@aswild aswild commented Apr 27, 2019

Regression from ef2e050 "Better indenting for nested if sections" which
changed to using searchpair() instead of search().

When typing "fi", the cursor is after the start of the <fi> match, so
vim un-indents back to the next outer if/fi block rather than the
expected block.

The help for searchpair() suggests "When searching backwards and {end} is
more than one character, it may be useful to put "\zs" at the end of the
pattern, so that when the cursor is inside a match with the end it finds
the matching start." Follow this suggestion to restore the expected
behavior.

Fixes: #15

Regression from ef2e050 "Better indenting for nested if sections" which
changed to using searchpair() instead of search().

When typing "fi", the cursor is after the start of the \<fi\> match, so
vim un-indents back to the next outer if/fi block rather than the
expected block.

The help for searchpair() suggests "When searching backwards and {end} is
more than one character, it may be useful to put "\zs" at the end of the
pattern, so that when the cursor is inside a match with the end it finds
the matching start." Follow this suggestion to restore the expected
behavior.

Fixes: chrisbra#15
chrisbra added a commit that referenced this pull request Apr 28, 2019
Currently fails, will be activated, once PR #16 is included
@chrisbra chrisbra closed this in d93b4c3 Apr 28, 2019
@chrisbra
Copy link
Owner

Thanks, I have included your patch and amended it a bit to include a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autoindent during typing un-indents "fi" too far
2 participants