DBG: do not open virtual unit twice.

git-svn-id: trunk@32723 -
This commit is contained in:
martin 2011-10-06 20:28:32 +00:00
parent 8daf1dbf4a
commit 240ec1a82b
3 changed files with 15 additions and 2 deletions

View File

@ -1258,7 +1258,7 @@ begin
then Editor := SourceEditorManager.SourceEditorIntfWithFilename(NewSource.Filename);
// jump editor to execution line
Flags := [jfAddJumpPoint];
Flags := [jfAddJumpPoint, jfSearchVirtualFullPath];
if (FCurrentBreakPoint = nil) or (FCurrentBreakPoint.AutoContinueTime = 0)
then include(Flags, jfFocusEditor);
i := SrcLine;

View File

@ -64,6 +64,8 @@ uses
LCLProc, LCLMemManager, LCLType, LCLIntf, LConvEncoding, LMessages, ComCtrls,
FileUtil, LResources, StdCtrls, Forms, Buttons, Menus, Controls, GraphType,
HelpIntfs, Graphics, ExtCtrls, Dialogs, InterfaceBase, UTF8Process,
//
LazUTF8,
// codetools
FileProcs, CodeBeautifier, FindDeclarationTool, LinkScanner, BasicCodeTools,
Laz_XMLCfg, CodeToolsStructs, CodeToolManager, CodeCache, DefineTemplates,
@ -14990,6 +14992,7 @@ function TMainIDE.DoJumpToCodePosition(ActiveSrcEdit: TSourceEditorInterface;
var
SrcEdit, NewSrcEdit: TSourceEditor;
AnEditorInfo: TUnitEditorInfo;
s: String;
begin
Result:=mrCancel;
if NewSource=nil then begin
@ -15020,6 +15023,14 @@ begin
then begin
// jump to other file -> open it
ActiveUnitInfo := Project1.UnitInfoWithFilename(NewSource.Filename);
if (ActiveUnitInfo = nil) and (Project1.IsVirtual) and (jfSearchVirtualFullPath in Flags)
then begin
s := AppendPathDelim(GetTestBuildDirectory);
if LazUTF8.UTF8LowerCase(copy(NewSource.Filename, 1, length(s))) = LazUTF8.UTF8LowerCase(s)
then ActiveUnitInfo := Project1.UnitInfoWithFilename(copy(NewSource.Filename, 1 + length(s), length(NewSource.Filename)), [pfsfOnlyVirtualFiles]);
end;
AnEditorInfo := nil;
if ActiveUnitInfo <> nil then
AnEditorInfo := GetAvailableUnitEditorInfo(ActiveUnitInfo, Point(NewX,NewY), NewTopLine);

View File

@ -123,7 +123,9 @@ type
jfFocusEditor,
jfMarkLine,
jfMapLineFromDebug,
jfDoNotExpandFilename);
jfDoNotExpandFilename,
jfSearchVirtualFullPath
);
TJumpToCodePosFlags = set of TJumpToCodePosFlag;
{ TMainIDEInterface }