How to highlight a specific line in source editor using OpenToolsAPI

一世执手 提交于 2019-12-04 07:44:00

If it's OK to just go to a certain line in the topmost editor then try this:

procedure GotoLine(LineNumber: Integer);
var
  EditorServices: IOTAEditorServices;
  Buffer: IOTAEditBuffer;
  Position: IOTAEditPosition;
begin
  if not Supports(BorlandIDEServices, IOTAEditorServices, EditorServices) then
    Exit;
  Buffer := EditorServices.TopBuffer;
  if not Assigned(Buffer) then
    Exit;
  Position := Buffer.EditPosition;
  if not Assigned(Position) then
    Exit;
  Position.GotoLine(LineNumber);
  Buffer.TopView.Paint;
end;
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!