From dd3878df3065c8691b592c5811298a6721614433 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 9 Jul 2010 01:37:34 +0000 Subject: [PATCH] SourceEditor/SynCompletion: Don't steal focus after completion drop-down, if user moved to different form git-svn-id: trunk@26543 - --- ide/sourceeditor.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 14636c31d4..e192c33352 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -1501,8 +1501,6 @@ begin //debugln(GetStackTrace(true)); {$ENDIF} Manager.DeactivateCompletionForm; - if Manager.ActiveEditor<>nil then - Manager.ActiveEditor.FocusEditor; end; procedure TSourceEditCompletion.ccComplete(var Value: string; @@ -7863,6 +7861,8 @@ begin end; procedure TSourceEditorManagerBase.DeactivateCompletionForm; +var + PluginFocused: Boolean; begin if ActiveCompletionPlugin<>nil then begin ActiveCompletionPlugin.Cancel; @@ -7874,13 +7874,16 @@ begin then exit; + // Do not move focus, if it was moved by user + PluginFocused := FDefaultCompletionForm.TheForm.Focused; + // clear the IdentifierList (otherwise it would try to update everytime // the codetools are used) CodeToolBoss.IdentifierList.Clear; FDefaultCompletionForm.CurrentCompletionType:=ctNone; FDefaultCompletionForm.Deactivate; - if ActiveEditor<>nil then begin + if PluginFocused and (ActiveEditor<>nil) then begin //LCLIntf.ShowCaret(ActSE.EditorComponent.Handle); TSourceEditor(ActiveEditor).EditorComponent.SetFocus; end;