we must check getLine() at first, because getOffset() can cause dramatic side effects
cleanup
we must create lazy range marker delegate on document changed, otherwise invalid delegate will be created