From f3db219e83042ff030f1462b18949a4371926794 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 20 Jan 2019 08:29:39 +0100 Subject: [PATCH] fix #400 - inconsistencies in automcompletion, after backspace --- src/u_synmemo.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/u_synmemo.pas b/src/u_synmemo.pas index 15797a0c..0c8f6988 100644 --- a/src/u_synmemo.pas +++ b/src/u_synmemo.pas @@ -2783,9 +2783,16 @@ procedure TDexedMemo.completionDeleteKey(sender: TObject); begin if CaretX > 0 then begin - caretX := CaretX - 1; + + // these "stinky" lines are necessary because + // the proc is called before deletion is effective + // i.e the deleted char is still there... + // related issues #400 and #398 + caretX := caretX - 1; + ExecuteCommand(ecDeleteChar, #0, nil); + caretX := caretX + 1; + getCompletionList(); - caretX := CaretX + 1; if fCompletion.TheForm.ItemList.Count = 0 then begin fCompletion.TheForm.Close;