Merged revision(s) 42854 #f4e5628407, 42856 #4c52e89cc2, 42859 #0e785800e1, 42865-42866 #c0dac09b7f-#c0dac09b7f, 42868 #7d402a8415 from trunk:

LCL: added TPairSplitter.Constraints, bug #25046
........
Debugger: Disable logging of stackdump during unit lookup
........
codetools: fixed removing first unit from second line
........
IDE: fixed complete block, bug #24935
........
IDE: fixed complete block on char, fixed codebrowser check if something changed
........
codetools: fixed checking if resolving edged bracket open is allowed, bug #25045
........

git-svn-id: branches/fixes_1_2@42908 -
This commit is contained in:
martin 2013-09-21 10:00:50 +00:00
parent 92307b7a51
commit d254b622a0
7 changed files with 33 additions and 19 deletions

View File

@ -46,6 +46,7 @@ begin
writeln('Usage:');
writeln(' ',ParamStr(0));
writeln(' ',ParamStr(0),' <filename> <X> <Y>');
exit;
end;
CodeToolBoss.SimpleInit(ConfigFilename);

View File

@ -7565,8 +7565,6 @@ var
end;
if (not (NextAtomType in [vatSpace,vatPoint,vatAs,vatUp,vatRoundBracketClose,
vatRoundBracketOpen,vatEdgedBracketClose,vatEdgedBracketOpen]))
or ((ExprType.Context.Node=nil)
and (not (ExprType.Desc in EdgedBracketContexts)))
then begin
MoveCursorToCleanPos(NextAtom.StartPos);
ReadNextAtom;
@ -7584,6 +7582,11 @@ var
ExprType.Context.Node:=nil;
exit;
end;
if ExprType.Context.Node=nil then begin
MoveCursorToCleanPos(NextAtom.StartPos);
ReadNextAtom;
RaiseIllegalQualifierFound;
end;
{$IFDEF ShowExprEval}
DebugLn([' FindExpressionTypeOfTerm ResolveEdgedBracketOpen ExprType=',ExprTypeToString(ExprType)]);

View File

@ -1106,21 +1106,32 @@ begin
if AtomIsChar(';') then begin
// last unit in uses section -> delete whole uses section
StartPos:=FindLineEndOrCodeInFrontOfPosition(UsesNode.StartPos,true,true);
if not SourceChangeCache.Replace(gtNone,gtNone,
StartPos,UsesNode.EndPos,'') then exit;
EndPos:=UsesNode.EndPos;
end else begin
// not last unit -> delete with comma behind
EndPos:=FindLineEndOrCodeAfterPosition(CurPos.EndPos);
if (EndPos>SrcLen) or (Src[EndPos] in [#10,#13]) then
StartPos:=FindLineEndOrCodeInFrontOfPosition(StartPos);// delete space in front or even the empty line
if not SourceChangeCache.Replace(gtNone,gtNone,
StartPos,EndPos,'') then exit;
end;
end else begin
// not first unit in uses section -> delete with comma in front
if not SourceChangeCache.Replace(gtNone,gtNone,
EndPos,CurPos.StartPos,'') then exit;
// not first unit in uses section
if AtomIsChar(';') then begin
// last unit -> delete with comma in front
StartPos:=EndPos;
EndPos:=CurPos.StartPos;
end else if PositionsInSameLine(Src,EndPos,StartPos) then begin
// not first unit in line -> delete with comma in front
StartPos:=EndPos;
EndPos:=CurPos.StartPos;
end else begin
// first unit in line -> delete with comma behind
EndPos:=FindLineEndOrCodeAfterPosition(CurPos.EndPos);
if (EndPos>SrcLen) or (Src[EndPos] in [#10,#13]) then
StartPos:=FindLineEndOrCodeInFrontOfPosition(StartPos);// delete space in front or even the empty line
end;
end;
if not SourceChangeCache.Replace(gtNone,gtNone,StartPos,EndPos,'') then
exit;
if not SourceChangeCache.Apply then exit;
Result:=true;
exit;
@ -6080,7 +6091,9 @@ begin
Beauty:=SourceChangeCache.BeautifyCodeOptions;
InitStack(Stack);
try
//DebugLn(['TStandardCodeTool.CompleteBlock ',StartNode.DescAsString]);
{$IFDEF VerboseCompleteBlock}
DebugLn(['TStandardCodeTool.CompleteBlock ',StartNode.DescAsString]);
{$ENDIF}
if StartNode.Desc in AllPascalStatements then begin
while (StartNode.Parent<>nil)

View File

@ -1046,11 +1046,7 @@ begin
end;
// get nice unit name
if not LazarusIDE.SaveSourceEditorChangesToCodeCache(nil) then begin
DebugLn(['TCodeBrowserView.UseUnitInSrcEditor LazarusIDE.'
+'SaveSourceEditorChangesToCodeCache failed']);
exit;
end;
LazarusIDE.SaveSourceEditorChangesToCodeCache(nil);
SelectedCode:=CodeToolBoss.LoadFile(SelectedUnitFilename, true, false);
if SelectedCode=nil then begin
debugln(['TCodeBrowserView.UseUnitInSrcEditor failed to load SelectedUnitFilename=',SelectedUnitFilename]);

View File

@ -602,7 +602,7 @@ function TDebugManager.GetFullFilename(const AUnitinfo: TDebuggerUnitInfo;
exit;
debugln(['TDebugManager.GetFullFilename found ',CodePos.Code.Filename,' Line=',CodePos.Y,' Col=',CodePos.X]);
AUnitinfo.LocationFullFile := CodePos.Code.Filename;
DumpStack;
//DumpStack;
Result:=true;
end;

View File

@ -3321,7 +3321,7 @@ begin
begin
AddChar:=true;
if AutoCompleteChar(aChar,AddChar,acoLineBreak) then ;
//DebugLn(['TSourceEditor.ProcessCommand ecLineBreak AddChar=',AddChar]);
//DebugLn(['TSourceEditor.ProcessCommand ecLineBreak AddChar=',AddChar,' EditorOpts.AutoBlockCompletion=',EditorOpts.AutoBlockCompletion]);
if not AddChar then Command:=ecNone;
if EditorOpts.AutoBlockCompletion then
AutoCompleteBlock;
@ -4397,7 +4397,7 @@ begin
then begin
debugln(['TSourceEditor.AutoBlockCompleteChar ']);
// user typed 'begin'
if not LazarusIDE.SaveSourceEditorChangesToCodeCache(self) then exit;
LazarusIDE.SaveSourceEditorChangesToCodeCache(self);
FEditor.BeginUndoBlock{$IFDEF SynUndoDebugBeginEnd}('TSourceEditor.AutoBlockCompleteChar (2)'){$ENDIF};
FEditor.BeginUpdate;
try
@ -4415,7 +4415,7 @@ var
NewCode: TCodeBuffer;
NewX, NewY, NewTopLine: integer;
begin
if not LazarusIDE.SaveSourceEditorChangesToCodeCache(self) then exit;
LazarusIDE.SaveSourceEditorChangesToCodeCache(Self);
XY:=FEditor.LogicalCaretXY;
FEditor.BeginUndoBlock{$IFDEF SynUndoDebugBeginEnd}('TSourceEditor.AutoCompleteBlock'){$ENDIF};
FEditor.BeginUpdate;

View File

@ -122,6 +122,7 @@ type
property Align;
property Anchors;
property BorderSpacing;
property Constraints;
property Cursor;
property Enabled;
property OnMouseDown;