diff --git a/src/u_synmemo.pas b/src/u_synmemo.pas index caf502cc..d4db5b5c 100644 --- a/src/u_synmemo.pas +++ b/src/u_synmemo.pas @@ -2573,7 +2573,7 @@ begin if right then c := s[p.x] else - c := s[p.x-1]; + c := s[min(p.x-1, s.length)]; if not right then begin if c in w then