mm--/ace-mc

`ace-mc-add-multiple-cursors` errors with infinite loop if there is just one candidate

Closed this issue · 2 comments

Steps to reproduce -

  1. Open a blank buffer and enter the text za
  2. Run the command ace-mc-add-multiple-cursors
  3. Enter the letter z

Expected result -
A cursor is added at z

Actual result -
The command fails with

progn: Variable binding depth exceeds max-specpdl-size

It seems the infinite loop happens because ace-mc-add-char calls function pointed by ace-mc-ace-mode-function (which is bound to ace-jump-word-mode), ace-jump-word-mode in turn calls ace-jump-do which runs the ace-jump-mode-end-hook. In case of ace-mc, the function ace-mc-maybe-jump-end is executed as a part of the hook which calls ace-mc-add-char again leading to the infinite loop.

mm-- commented

Great catch.
I just committed a change (a7dbff6) which hopefully fixes it.
Reopen this if it doesn't work.
Thanks!

Thanks for the quick fix!