mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 13:18:24 +02:00
synedit: syncompletion: calling old OnKeyDown events, bug #9020
git-svn-id: trunk@14276 -
This commit is contained in:
parent
4e31f256a5
commit
de71745a05
@ -1413,7 +1413,25 @@ begin
|
|||||||
Key:=VK_UNKNOWN;
|
Key:=VK_UNKNOWN;
|
||||||
//debugln('TSynCompletion.EditorKeyDown B ',dbgs(Key));
|
//debugln('TSynCompletion.EditorKeyDown B ',dbgs(Key));
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
|
||||||
|
i := fEditors.IndexOf(Sender);
|
||||||
|
if i <> -1 then begin
|
||||||
|
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
||||||
|
if (Shift = ShortCutShift) and (Key = ShortCutKey) then
|
||||||
|
with sender as TCustomSynEdit do begin
|
||||||
|
if not ReadOnly and (Shift = ShortCutShift) and (Key = ShortCutKey) then begin
|
||||||
|
p := ClientToScreen(Point(CaretXPix, CaretYPix + LineHeight));
|
||||||
|
Form.CurrentEditor := Sender as TCustomSynEdit;
|
||||||
|
Execute(GetPreviousToken(Sender as TCustomSynEdit), p.x, p.y);
|
||||||
|
// eat it
|
||||||
|
Key := VK_UNKNOWN;
|
||||||
|
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).NoNextKey := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Assigned(TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).kd) then
|
||||||
|
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).kd(sender, key, shift);
|
||||||
|
end;
|
||||||
|
{$ELSE}
|
||||||
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
||||||
if (Shift <> ShortCutShift) or (Key <> ShortCutKey) then exit;
|
if (Shift <> ShortCutShift) or (Key <> ShortCutKey) then exit;
|
||||||
|
|
||||||
@ -1424,15 +1442,13 @@ begin
|
|||||||
p := ClientToScreen(Point(CaretXPix, CaretYPix + LineHeight));
|
p := ClientToScreen(Point(CaretXPix, CaretYPix + LineHeight));
|
||||||
Form.CurrentEditor := Sender as TCustomSynEdit;
|
Form.CurrentEditor := Sender as TCustomSynEdit;
|
||||||
Execute(GetPreviousToken(Sender as TCustomSynEdit), p.x, p.y);
|
Execute(GetPreviousToken(Sender as TCustomSynEdit), p.x, p.y);
|
||||||
{$IFDEF SYN_LAZARUS}
|
|
||||||
// eat it
|
|
||||||
{$ENDIF}
|
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).NoNextKey := true;
|
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).NoNextKey := true;
|
||||||
end;
|
end;
|
||||||
if assigned(TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).kd) then
|
if assigned(TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).kd) then
|
||||||
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).kd(sender, key, shift);
|
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).kd(sender, key, shift);
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynCompletion.GetPreviousToken(FEditor: TCustomSynEdit): string;
|
function TSynCompletion.GetPreviousToken(FEditor: TCustomSynEdit): string;
|
||||||
|
Loading…
Reference in New Issue
Block a user