Skip to content

Commit

Permalink
Stick to watching global variables or the top of the stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 28, 2007
1 parent 1ad1ec5 commit 0acc4ea
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/toby_wxwidgets.cpp
Expand Up @@ -1420,6 +1420,17 @@ void TobyIDEFrame::pauseReached(int line, int fullstop,

int frames = 0;
const TobyDebugInfo *cs = TOBY_getCallstack(&frames);

// if you're on the (global variables) selection, stick there,
// otherwise always view the top stackframe by default.
int viewing = this->callstackCtrl->GetSelection();
if (viewing == wxNOT_FOUND)
viewing = 0;
else if (((unsigned int) viewing) == this->callstackCtrl->GetCount()-1)
viewing = frames;
else
viewing = 0;

if ((frames <= 0) || (cs == NULL))
this->callstackCtrl->Clear();
else
Expand All @@ -1436,8 +1447,8 @@ void TobyIDEFrame::pauseReached(int line, int fullstop,
} // else

this->callstackCtrl->Append(wxT("(global variables)"));
this->callstackCtrl->Select(0);
this->updateVariablesCtrl(0);
this->callstackCtrl->Select(viewing);
this->updateVariablesCtrl(viewing);
} // if
} // TobyIDEFrame::pauseReached

Expand Down

0 comments on commit 0acc4ea

Please sign in to comment.