fix #175 - space or space-and-char ransomly inserted after completion

This commit is contained in:
Basile Burg 2017-08-23 07:49:37 +02:00
parent fa3ce3dfd3
commit cc5661d623
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 11 additions and 10 deletions

View File

@ -2368,17 +2368,18 @@ procedure TCESynMemo.completionCodeCompletion(var value: string;
SourceValue: string; var SourceStart, SourceEnd: TPoint; KeyChar: TUTF8Char;
Shift: TShiftState);
begin
if (KeyChar[1] = ' ') then
if KeyChar <> '' then
begin
value := sourceValue + KeyChar[1];
end
else
begin
fLastCompletion := value;
if KeyChar[1] in fCloseCompletionCharsWithSpace then
value += ' ' + KeyChar[1]
else if KeyChar[1] in fCloseCompletionChars then
value += KeyChar[1];
if KeyChar[1] = ' ' then
value := sourceValue + KeyChar[1]
else
begin
fLastCompletion := value;
if KeyChar[1] in fCloseCompletionCharsWithSpace then
value += ' ' + KeyChar[1]
else if KeyChar[1] in fCloseCompletionChars then
value += KeyChar[1];
end;
end;
end;