Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
change Go to Line method.
(1/1)
ollydbg:
Is it possible to change the function like this
--- Code: ---void cbEditor::GotoLine(int line, bool centerOnScreen)
{
cbStyledTextCtrl* control = GetControl();
// Make sure the line is not folded. This is done before moving to that
// line because folding may change the lines layout.
control->EnsureVisible(line);
// If the line or the following is a fold point it will be unfolded, in this way
// when the line is a function declaration (or only contains the opening brace of it [yes, that happens sometimes] )
// the body is shown.
DoFoldLine(line,0);
DoFoldLine(line+1,0);
if (centerOnScreen)
{
int onScreen = control->LinesOnScreen() >> 1;
int firstVisibleLine = control->GetFirstVisibleLine();
if(line<firstVisibleLine||line>(firstVisibleLine+2*onScreen))
{
control->GotoLine(line - onScreen);
control->GotoLine(line + onScreen);
}
}
control->GotoLine(line);
}
--- End code ---
I think this can avoid some screen flash(for me, it is annoying), which means when we just do a small jump, we don't need to center the cursor. :D
Any comments?!? :D
Navigation
[0] Message Index
Go to full version