Currently I see this is possible as per documentation:

const markers = [
  {
        startRow: 3,
        startCol: 10,
        endRow: 3,
        endCol: 15,
        type: 'text',
        className: 'test-marker',
      },
      {
        startRow: 6,
        startCol: 13,
        endRow: 6,
        endCol: 19,
        type: 'text',
        className: 'test-marker',
      },
];

const wrapper = <AceEditor markers={markers} />;

Is it possible to use the absolute indices (start and end) of a substring to highlight using markers instead of {row, col} for start and end positions?

1

There are 1 answers

0
a user On

You can use editor.session.doc.indexToPosition(100) to convert an offset in the string to a position object with row and column.