void (@NotNull CaretEvent e) { if (!myInitialized) return; myMoveCaret = false; try { int newOffset = e.getEditor().logicalPositionToOffset(e.getNewPosition()); for (Map.Entry<FragmentNode, Couple<TextRange>> entry : myLinesBounds.entrySet()) { TextRange range = mySideGetter.apply(entry.getValue()); if (range.containsOffset(newOffset)) { mySelectNode.accept(entry.getKey()); break; } } } finally { myMoveCaret = true; } }