Document modification between two lines of code

Answered

Got a problem and not sure how to handle it:

int elementLastLine = document.getLineNumber(elementEndOffset);
int lineEndOffset = document.getLineEndOffset(elementLastLine);

First line woks fine. And the second one causes: http://camelcade.myjetbrains.com/youtrack/issue/CAMELCADE-235

Pretty rare situation, but i've got one myself. Pressed key and selected fragment of the text disappeared and i've got same seption.

Any suggestions?

 

2 comments
Comment actions Permalink

The exception seems to be in getLineNumber, so in the first line. It indicates that the document is empty, and your offset is >0. It seems that the indexing is happening on an uncommitted document, and it's a normal situation, so you shouldn't rely on the document text at all during indexing.

0
Comment actions Permalink

oh, crap. my bad, again :) Thanks.

0

Please sign in to leave a comment.