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

cw with count not work correctly #57

Closed
yioneko opened this issue Sep 12, 2021 · 1 comment
Closed

cw with count not work correctly #57

yioneko opened this issue Sep 12, 2021 · 1 comment

Comments

@yioneko
Copy link

yioneko commented Sep 12, 2021

It seems that the count work as expected only when the cursor is placed at the end of the word:
2

I suspect that here

while l:count > 0
if l:count == 1 && l:cw
let l:flags .= 'c'
endif
call search('\m'.l:pattern, l:flags.'W')
let l:count -= 1
endwhile

shouble be

 if l:count == 1 && l:cw 
	let l:flags .= 'c' 
 endif 
 while l:count > 0 
 	call search('\m'.l:pattern, l:flags.'W') 
 	let l:count -= 1 
 endwhile 

And I've tested it and it works as expected after the modification, but I'm not sure whether it will break other stuff.

chaoren added a commit that referenced this issue Sep 12, 2021
It was only working without count or when the cursor was at the end of
the word.
chaoren added a commit that referenced this issue Sep 12, 2021
It was only working without count or when the cursor was at the end of
the word.
@chaoren
Copy link
Owner

chaoren commented Sep 12, 2021

Thanks for the report. Looks like the existing tests only covered cw with count for single character words. Whoops.

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

No branches or pull requests

2 participants