patch 8.2.4978: no error if engine selection atom is not at the start
Problem: No error if engine selection atom is not at the start.
Solution: Give an error. (Christian Brabandt, closes #10439)
diff --git a/src/regexp_bt.c b/src/regexp_bt.c
index 18bad80..698ff04 100644
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -1503,6 +1503,14 @@
break;
case '#':
+ if (regparse[0] == '=' && regparse[1] >= 48
+ && regparse[1] <= 50)
+ {
+ // misplaced \%#=1
+ semsg(_(e_atom_engine_must_be_at_start_of_pattern),
+ regparse[1]);
+ return FAIL;
+ }
ret = regnode(CURSOR);
break;