fix autoCallCompletion problem and annoyance

- dont trigger the feature when using accelerators
- allow in non-D sources if textCompletions are active
This commit is contained in:
Basile Burg 2022-06-06 20:53:50 +02:00
parent 04138ddd63
commit f90d246933
2 changed files with 10 additions and 4 deletions

View File

@ -7,6 +7,11 @@
- Completion, while menu opened, <key>Backspace</key> had for effect to also delete next char. - Completion, while menu opened, <key>Backspace</key> had for effect to also delete next char.
This was an old workaround that has no reason to be maintained anymore. This was an old workaround that has no reason to be maintained anymore.
## Bugs fixed
- Completion, option `autoCallCompletion` did not work when using `textCompletion` in non-D sources.
- Completion, does not allow `autoCallCompletion` when key modifiers are used, e.g <key>CTRL</key>+<key>Z</key>.
# v3.9.18 # v3.9.18
## Enhancements ## Enhancements

View File

@ -3704,11 +3704,12 @@ begin
VK_OEM_PERIOD, VK_DECIMAL: fCanAutoDot := (fLastUp <> VK_OEM_PERIOD) and (fLastUp <> VK_DECIMAL); VK_OEM_PERIOD, VK_DECIMAL: fCanAutoDot := (fLastUp <> VK_OEM_PERIOD) and (fLastUp <> VK_DECIMAL);
end; end;
inherited; inherited;
if fAutoCallCompletion and fIsDSource and (not fCompletion.IsActive) and if fAutoCallCompletion and (fIsDSource or textCompletion or alwaysAdvancedFeatures) and
(Key < $80) and (char(Key) in ['a'..'z', 'A'..'Z', '_']) then (not fCompletion.IsActive) and (Key < $80) and (char(Key) in ['a'..'z', 'A'..'Z', '_']) then
begin begin
fCompletion.Execute(GetWordAtRowCol(LogicalCaretXY), if Shift = [] then
ClientToScreen(point(CaretXPix, CaretYPix + LineHeight))); fCompletion.Execute(GetWordAtRowCol(LogicalCaretXY),
ClientToScreen(point(CaretXPix, CaretYPix + LineHeight)));
end; end;
if (Key = VK_BACK) and fCallTipWin.Visible then if (Key = VK_BACK) and fCallTipWin.Visible then
showCallTips(true); showCallTips(true);