|
|
@ -62,9 +62,17 @@ INT_PTR CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto sci_line = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, line);
|
|
|
|
int posToGoto = 0;
|
|
|
|
|
|
|
|
if (line > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// make sure not jumping into the middle of a multibyte character
|
|
|
|
|
|
|
|
// or into the middle of a CR/LF pair for Windows files
|
|
|
|
|
|
|
|
auto before = (*_ppEditView)->execute(SCI_POSITIONBEFORE, line);
|
|
|
|
|
|
|
|
posToGoto = static_cast<int>((*_ppEditView)->execute(SCI_POSITIONAFTER, before));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
auto sci_line = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, posToGoto);
|
|
|
|
(*_ppEditView)->execute(SCI_ENSUREVISIBLE, sci_line);
|
|
|
|
(*_ppEditView)->execute(SCI_ENSUREVISIBLE, sci_line);
|
|
|
|
(*_ppEditView)->execute(SCI_GOTOPOS, line);
|
|
|
|
(*_ppEditView)->execute(SCI_GOTOPOS, posToGoto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|