Skip to content

Commit a21352d

Browse files
authored
Merge pull request #184 from royqh1979/develop
* fix: show value of the variable under cursor when debugging
2 parents bdd5b31 + 96c686e commit a21352d

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

Source/DataFrm.pas

+3
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ function TdmMain.GetHighlighter(const FileName: AnsiString): TSynCustomHighlight
429429
else if (CompareText(ext, '.html') = 0)
430430
or (CompareText(ext, '.htm') = 0)then
431431
result := HTMLSyn
432+
else if (CompareText(ext, '.s') = 0)
433+
or (CompareText(ext, '.asm') = 0)then
434+
result := AsmSyn
432435
else if (CompareText(ext, '.js') = 0) then
433436
result := JSSyn
434437
else if CompareText(ext, '.css') = 0 then

Source/Editor.pas

+7-3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ TEditor = class(TObject)
100100
fActiveLine: integer;
101101
fDebugGutter: TDebugGutter;
102102
fCurrentWord: AnsiString;
103+
fCurrentHintReason : THandPointReason;
103104
fCurrentEvalWord: AnsiString;
104105
fIgnoreCaretChange: boolean;
105106
fPreviousEditors: TList;
@@ -373,6 +374,7 @@ constructor TEditor.Create(const Filename: AnsiString; Encoding:TFileEncodingTyp
373374
fUpdateLock := 0;
374375
fSelChanged:=False;
375376
fLineCount:=-1;
377+
fCurrentHintReason := hprNone;
376378
fLastMatchingBeginLine:=-1;
377379
fLastMatchingEndLine:=-1;
378380
fLastIdCharPressed := 0;
@@ -2993,7 +2995,7 @@ procedure TEditor.EditorMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Int
29932995
begin
29942996
kind := fParser.FindKindOfStatementOf(fFileName, s, p.Line);
29952997

2996-
if kind in [skVariable, skParameter] then begin //only show debug info of variables;
2998+
if kind in [skVariable, skGlobalVariable, skLocalVariable, skParameter] then begin //only show debug info of variables;
29972999
if MainForm.Debugger.Reader.CommandRunning then
29983000
Exit;
29993001

@@ -3017,6 +3019,7 @@ procedure TEditor.EditorMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Int
30173019
// disable editor hint
30183020
Application.CancelHint;
30193021
fCurrentWord := '';
3022+
fCurrentHintReason := Reason;
30203023
fText.Hint := '';
30213024

30223025
// disable page control hint
@@ -3071,12 +3074,13 @@ procedure TEditor.EditorMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Int
30713074
// Don't rescan the same stuff over and over again (that's slow)
30723075
// if (s = fCurrentWord) and (fText.Hint<>'') then
30733076
s:=trim(s);
3074-
if (s = fCurrentWord) then
3077+
if ((s = fCurrentWord) and (fCurrentHintReason = Reason)) then
30753078
Exit; // do NOT remove hint when subject stays the same
30763079

30773080
// Remove hint
30783081
CancelHint;
30793082
fCurrentWord := s;
3083+
fCurrentHintReason := Reason;
30803084

30813085
// We are allowed to change the cursor
30823086
if (ssCtrl in Shift) then
@@ -3422,7 +3426,7 @@ function TEditor.HandpointAllowed(var MousePos: TBufferCoord; ShiftState: TShift
34223426

34233427
// Only allow in the text area...
34243428
if fText.GetPositionOfMouse(mousepos) then begin
3425-
if Assigned(GetErrorAtPosition(mousepos)) then begin
3429+
if not MainForm.Debugger.Executing and Assigned(GetErrorAtPosition(mousepos)) then begin
34263430
Result := hprError;
34273431
Exit;
34283432
end;

Source/Utils.pas

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface
3737
utresSrc, // resource source (.rc)
3838
utPrj, // project file (.dev)
3939
utMakefile, // makefile (.win)
40+
utasmSrc, // asm source file
4041
utOther // any others
4142
);
4243

@@ -943,6 +944,8 @@ function GetFileTyp(const FileName: AnsiString): TExUnitType;
943944
result := utresSrc
944945
else if AnsiMatchText(ext, ['.rh']) then
945946
result := utresHead
947+
else if AnsiMatchText(ext, ['.asm','.s']) then
948+
result := utasmSrc
946949
else
947950
result := utOther;
948951
end;

Source/Version.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface
3232

3333
// exe properties
3434
DEVCPP = 'Red Panda Dev-C++';
35-
DEVCPP_VERSION = '6.7.1';
35+
DEVCPP_VERSION = '6.7.2';
3636

3737
// delimiters
3838
DEV_INTERNAL_OPEN = '$__DEV_INTERNAL_OPEN';

0 commit comments

Comments
 (0)