To reproduce it:
- Copy and paste the following into the scratch buffer, change the major mode to C++:
void g(int);
void g(int*);
void g(int,
int*);
void g(int&,
int);
void g(int,
int*,
int&);
void f(int one) {
g(one);
g(&one);
g(one,
&one);
if (one>0
&&(one+5)
==(one*2)) {
g(one
,one);
if (one<0)
g(one,
&one,
one);
}
template <typename T> class C;
void g(C<int> arg);
- Move cursor to the first line, run swiper, then type
\_<one\_> as the input.
- In the first screenshot below, see how there are 14 lines (from line 10 to line 23) highlighted in the scratch buffer while there are only 7 candidates listed in the minibuffer.
- Press C-n and C-p, swiper only visits the 7 lines in scratch buffer that are candidates. The other 7 highlighted lines are skipped over.
- Change the input to
\_<int\_>.
- In the second screenshot below, see how there are 11 lines (line 1 to line 10, and line 26) highlighted in the scratch buffer while there are only 5 candidates listed in the minibuffer.
- Press M-q to start replacing the matches. Type in anything other than "int" as the replacement, followed by RET.
- Now watch
swiper visiting all the 11 highlighted occurrences in buffer and replacing them as expected.
It appears that, for the pattern \_<K\_>, if an occurrence K in buffer adjoins some punctuation characters such as +, *, &, < and > (there might be more) on either or both sides, swiper can find and highlight the occurrence in buffer but somehow cannot add the match to candidate list. In comparison, isearch-forward-regexp is able to highlight and visit all of them as expected. And occurrences adjoining characters such as (, ), , (there might be more) are found and listed correctly.
There is more.
- Move the cursor to line 6 which
swiper does find and add to candidate list.
- Run
swiper and give input \_<int\_>.
- Watch the cursor jumping to the line 1 instead of staying at line 6.
It works as expected when the input pattern is \bK\b, \<K\>, or just K.


To reproduce it:
\_<one\_>as the input.\_<int\_>.swipervisiting all the 11 highlighted occurrences in buffer and replacing them as expected.It appears that, for the pattern
\_<K\_>, if an occurrenceKin buffer adjoins some punctuation characters such as+,*,&,<and>(there might be more) on either or both sides,swipercan find and highlight the occurrence in buffer but somehow cannot add the match to candidate list. In comparison,isearch-forward-regexpis able to highlight and visit all of them as expected. And occurrences adjoining characters such as(,),,(there might be more) are found and listed correctly.There is more.
swiperdoes find and add to candidate list.swiperand give input\_<int\_>.It works as expected when the input pattern is
\bK\b,\<K\>, or justK.