1- In scratch buffer enter the following line:
Some_type v = Some_func();
2- Place the cursor on the second 'S' - one that following the '='.
3- Run swiper, press C-w to yank the word "Some" (or type in the word "Some").
4- Watch the point jumping to the first occurrence of "Some".
5- It is now unable to yank the word "_func".
With case folded, this can happen even more often in C and C++ code.
There is a workaround: at the prompt type "_f", instead of pressing C-w again in step 5. It is less convenient though.
The text was updated successfully, but these errors were encountered:
Well, the change does fix the issue for M-j (or whatever key that ivy-yank-word is mapped to) .
But the point still jumps to the first match when either the pattern "Some" is entered manually on prompt or swiper is called with a non-nil initial input such as M-:(swiper "Some"). Subsequently, ivy-yank-word is made unable to pick up the wanted word.
* swiper.el (swiper--current-line):
(swiper--current-match-start): New defvar.
(swiper--update-input-ivy): Don't move to line NUM if
`swiper--current-line' is equal to NUM. Later, store NUM in
`swiper--current-line' to avoid calling `line-number-at-pos'.
Additionally store `swiper--current-match-start' - it's necessary to
move there before searching for the regexp, since the point currently is
after the old regexp.