ITextViewer viewer = EclipseEmmetHelper.getTextViewer(editor);
LinkedModeModel model = new LinkedModeModel();
int exitPos = -1;
for (int i = 0; i < tabGroups.length; i++) {
TabStopGroup tabGroup = tabStops.getTabStopGroup(tabGroups[i]);
LinkedPositionGroup group = null;
if (tabGroups[i].equals("carets") || tabGroups[i].equals("0")) {
int caretCount = tabGroup.getTabStopList().size();
for (int j = 0; j < caretCount; j++) {
TabStop ts = tabGroup.getTabStopList().get(j);
group = new LinkedPositionGroup();
group.addPosition(new LinkedPosition(doc, start + ts.getStart(), ts.getLength()));
model.addGroup(group);
if (j == caretCount - 1) {
exitPos = start + ts.getStart();
}
}
} else {
group = new LinkedPositionGroup();
for (int j = 0; j < tabGroup.getTabStopList().size(); j++) {
TabStop ts = tabGroup.getTabStopList().get(j);
group.addPosition(new LinkedPosition(doc, start + ts.getStart(), ts.getLength()));
}
model.addGroup(group);
}