Document modification between two lines of code
已回答
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?
请先登录再写评论。
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.
oh, crap. my bad, again :) Thanks.