if (model.isGlobal()) {
if (model.isFromCursor()) {
offset = editor.getCaretModel().getOffset();
}
else {
<BUG>if (model.isForward()) {
offset = 0;
}
else {
offset = editor.getDocument().getTextLength();

}</BUG>
}

if (model.isGlobal()) {
if (model.isFromCursor()) {
offset = editor.getCaretModel().getOffset();
