mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-03 11:37:21 +01:00
codetools: ExtractOperand: do not return if cursor in front of expression
git-svn-id: trunk@21984 -
This commit is contained in:
parent
509396835a
commit
1803fc05ff
@ -3509,6 +3509,8 @@ begin
|
||||
Node:=FindDeepestNodeAtPos(CleanPos,true);
|
||||
StartPos:=FindStartOfTerm(CleanPos,NodeTermInType(Node));
|
||||
if StartPos<1 then exit;
|
||||
StartPos:=FindNextNonSpace(Src,StartPos);
|
||||
if StartPos>CleanPos then exit;
|
||||
EndPos:=FindEndOfTerm(CleanPos,false,WithAsOperator);
|
||||
if not WithPostTokens then begin
|
||||
MoveCursorToCleanPos(CleanPos);
|
||||
@ -3517,6 +3519,7 @@ begin
|
||||
EndPos:=CurPos.EndPos;
|
||||
end;
|
||||
if EndPos<1 then exit;
|
||||
DebugLn(['TStandardCodeTool.ExtractOperand "',dbgstr(copy(Src,StartPos,EndPOs-StartPos)),'"']);
|
||||
Operand:=ExtractCode(StartPos,EndPos,[phpCommentsToSpace]);
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
@ -13541,7 +13541,7 @@ begin
|
||||
Expression := SrcEdit.GetText(True)
|
||||
else
|
||||
Expression := SrcEdit.GetOperandFromCaret(CaretPos);
|
||||
//DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource Expression="',Expression,'"']);
|
||||
DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource Expression="',Expression,'"']);
|
||||
if not DebugBoss.Evaluate(Expression, DebugEval) or (DebugEval = '') then
|
||||
DebugEval := '???';
|
||||
SmartHintStr := Expression + ' = ' + DebugEval;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user