void (@NotNull CaretEvent e) { CaretImpl caretImpl = (CaretImpl)e.getCaret(); if (caretImpl != null) { caretImpl.updateVisualPosition(); if (caretImpl.hasSelection()) { repaint(caretImpl.getSelectionStart(), caretImpl.getSelectionEnd(), false); } } }