Spell-replace not working

Hi, I’m having trouble with with the spell-replace command not showing possible selections. The *debug* buffer usually shows the error:

sed: 1: "/^&/ { s/^[^:]*: //; s/ ...": extra characters at the end of p command

That error seems to be from this line. Beyond that I can’t work it out. I have diffed it and my version of spell.kak is exactly the same as that original. aspell is installed and working at least from the command line.
Thanks in advance, Ben

What version of sed are you running? If you’re on Linux or Cygwin you’re probably using GNU sed; if you’re on one of the BSDs or macOS you’re probably using BSD sed, unless you’re using Homebrew on macOS in which case it might be GNU sed after all; If you’re on a really minimalist Linux distro like Alpine you might be using BusyBox sed; there’s probably a bunch of other implementations I can’t think of off the top of my head but I’m sure you’d know if you were using one.

Does adding a ; after p on that line fix the problem?

Thanks, it is BSD sed (FreeBSD). The extra semicolon seems to stop the error in the *debug* buffer, but the command still doesn’t work.
I forgot to say that it did once work with the same setup, at least nothing that I can think of was changed. Also it’s clearly get through to aspell because the spell command does correctly highlight mis-spelt words.

Got it partly working with the finial semi-colon and reverting this change. Now just got to work out what problem that commit solved. Thanks for the help.