-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Add Counts for Replacement Arguments #341
base: master
Are you sure you want to change the base?
Conversation
I think #226 (almost the exact same PR) implements a better count detection (not limited by 0-9)? There is also a bug where if you do a line selection and then a surround with a multiplier you get something like this:
|
@@ -251,6 +256,8 @@ function! s:wrap(string,char,type,removed,special) | |||
let before = '' | |||
let after = '' | |||
endif | |||
let before = repeat(before, scount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix issue with line select something like this can be used:
if before =~ '.*\n\t$'
let before = substitute(before, '\n\t', '', '')
let before = repeat(before, scount)
let before = before."\n\t"
else
let before = repeat(before, scount)
endif
Have to admit I didn’t see that PR. Limiting to 0-9 was actually intentional. It means you can do, for example, |
Oh, I didn't realize that. I also saw not being able to surround with numbers as a problem. Sounds like a little bit of a hack, but I do prefer your solution. |
This PR adds support for repeating replacement arguments by beginning the argument with a count.
Examples:
Repeated delimeters are used by markdown a lot as well as some other languages. Many of the posed use cases of #97 involve repeated delimeters and I think this PR is a more intuitive way to support them.