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

Invalid matching #8

Open
adamczykm opened this issue May 31, 2016 · 15 comments
Open

Invalid matching #8

adamczykm opened this issue May 31, 2016 · 15 comments

Comments

@adamczykm
Copy link

There's something wrong with matching functions: instead of matching current word and then next, it matches first and then only a whitespace after another word.
I'm using config provided in the readme.

@hlissner
Copy link
Owner

hlissner commented May 31, 2016

I'll investigate, but in the meantime could you offer exact steps to reproduce the problem, including what function names you're trying to match and where the point is?

@adamczykm
Copy link
Author

Sure. I'm using match-and-next function. In the code below > will mean beginning of matched region and < the end, and | will denote the current position.
Let's say we have the following text:

|import sth1
import sth2
import sth3

After using the function just once I got a valid result, which is:

>|import< sth1
import sth2
import sth3

But after using it 2 more times:

>|import< sth1
import> <sth2
import> <sth3

Weird.

@hlissner
Copy link
Owner

Very strange. What major mode does this occur in?

@adamczykm
Copy link
Author

I'm using spacemacs. It occurs in all of the major modes.

@dp12
Copy link

dp12 commented Jun 3, 2016

Hmm, I'm getting exactly the same problem too (Spacemacs user as well). After pressing M-d four times on "Interrupt", it looks like:

multiedit

@hlissner
Copy link
Owner

hlissner commented Jun 3, 2016

How frustrating! I can't reproduce it in vanilla emacs, so something in the spacemacs stack must be interfering. I'll install spacemacs over the weekend and see if I can figure it out.

@JJPandari
Copy link
Contributor

JJPandari commented Oct 10, 2016

@adamczykm @dp12 @hlissner I've just updated to the recent-released spacemacs 0.200.0, and found out this issue has magically disappeared. Cheers! 😆
edit: Wait, there's still a minor problem: if I want to match a word or symbol, either starting at normal-state or visual-state, everything works fine. However, if I want to match a region that's not a word or symbol, match-next and match-next-symbol says no more matches(but match-all correctly matches all ocurrences, so does it in prior versions of spacemacs when match-next malfunctions). But compared to before I updated spacemacs, evil-multiedit is working almost perfectly, so I can live with the current situation.

@hlissner
Copy link
Owner

hlissner commented Oct 10, 2016

I believe this is because evil-multiedit-scope defaults to visible, meaning it doesn't look past the visible buffer to find matches. match-all ignores this variable

I have changed its default to nil, which should fix the issue!

@JJPandari
Copy link
Contributor

JJPandari commented Oct 10, 2016

When I tried to match arbitrary regions, I had multiple matches on my screen, but match-next said "no more matches".
Also, I'm not sure if the change on default value you just made will cause confusion to heavy evil-multiedit users 🤔
Don't bother to fix it if the solution is not really obvious, the current situation seems good enough...

@hlissner
Copy link
Owner

It was effectively nil before I introduced evil-multiedit-scope in the first place, so it seemed better that it stay nil. However, I have a better solution in the pipeline (to have the cursor jump to each new match), which will make this new default make more sense.

@hlissner
Copy link
Owner

Bam, big update posted. This rewrite has turned out to be more reliable -- it may need some testing, but it should fix your problem. Let me know if it does!

@JJPandari
Copy link
Contributor

JJPandari commented Oct 11, 2016

Amazing! It's now working just perfectly.
Though I saw 2 errors when downloading and compiling from github:

  1. "evil-multiedit.el:67:1:Error: Cannot open load file: no such file or directory, evil. Compiling no file at Tue Oct 11 15:46:22 2016"(so evil-multiedit.elc is not present)
  2. "gnutls.c: 0 fatal error: The TLS connection was non-properly terminated."(I'm new to emacs and have no idea what this error means)

@hlissner
Copy link
Owner

Odd, these seem to be a package.el issue. Are you sure evil is installed? Perhaps try to uninstall evil-multiedit completely, then reinstall it?

@JJPandari
Copy link
Contributor

Tried again on my home computer(was on work when I wrote last message), same errors ocurr. Reinstalled, still the same. Evil is installed.
I recompiled all elcs with a spacemacs function, evil-surround(requiring evil 1.2.12) compiles fine, evil-multiedit(requiring evil 1.2.8) still failed.

@dp12
Copy link

dp12 commented May 26, 2017

I also encountered syl20bnr/spacemacs#8885 in spacemacs when the c-c++ layer was enabled, which broke evil-multiedit and iedit.

Doing (setq ggtags-highlight-tag nil) fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants