private void saveOffset(OffsetKey key, int offset, boolean externally) {
    LOG.assertTrue(!myDisposed);
    if (externally && myMap.containsKey(key)) {
      myModified.add(key);
    }

    RangeMarker old = myMap.get(key);
    if (old != null) old.dispose();
    final RangeMarker marker = myDocument.createRangeMarker(offset, offset);
    marker.setGreedyToRight(key.isMovableToRight());
    myMap.put(key, marker);
  }
private void saveOffset(OffsetKey key, int offset, boolean externally)