[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: StyledTextContent how convert position and linenumber to offset?

Hi Max,

If I understand correctly, for a given absolute offset you want to compute
the line# and an offset within this line, right?  If so,
getLineAtOffset(int) will give the line#, then offset -
getOffsetAtLine(line#) will give the offset within the line.

If this is not what you were asking then please follow up.

Grant


"Max Areshkau" <mareshkau@xxxxxxxxxx> wrote in message
news:g4dkf5$lid$1@xxxxxxxxxxxxxxxxxxxx
> I am using styled text to processes some text files. When I open some
> file and put cursor to some specific place, i can see in bottom of
> eclipse line and position number, how i can get document offset if i
> know this number, i have founded getOffsetAtLine(int i) method, but I
> can't found how to get offset for some position in line?