Skip to content

Fix duplicate augroup END on CR#162

Open
mmrwoods wants to merge 1 commit into
cohama:masterfrom
mmrwoods:fix-duplicate-augroup-end
Open

Fix duplicate augroup END on CR#162
mmrwoods wants to merge 1 commit into
cohama:masterfrom
mmrwoods:fix-duplicate-augroup-end

Conversation

@mmrwoods

@mmrwoods mmrwoods commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hi @cohama,

When editing vimscript files if you enter <CR> after augroup END a duplicate augroup END is added.

I've updated the pattern to address this, by adding a negative lookahead to not match augroup END.

Hope this is useful :-)

@mmrwoods mmrwoods force-pushed the fix-duplicate-augroup-end branch from 9e59ee9 to e265948 Compare June 9, 2026 06:45
@mmrwoods

mmrwoods commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @cohama, just wondering if you have any thoughts on this (and the other two PRs I submitted a while ago).

I can wrap them all into one PR if you would prefer.

If you have any questions please let me know.

Thanks

@cohama

cohama commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Thank you for your pull requests. I prefer several small pull requests to one large pull request.

I have a question about this PR.

What do you mean by “duplicate”? Did you encounter any issues with the augroup?

I tried to reproduce the issue, but I could not.

@mmrwoods

mmrwoods commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

At the end of a line containing augroup END, if you hit <CR> another augroup END is added.

I realise it is an edge case, but I have occasionally found myself hitting <CR> after augroup END.

EDIT: see screen recording showing issue

Screen.Recording.2026-07-11.at.08.49.39.mov

Add negative lookahead to pattern and avoid matching augroup END
@mmrwoods mmrwoods force-pushed the fix-duplicate-augroup-end branch from e265948 to 270c613 Compare July 11, 2026 08:22
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.

2 participants