void (@NotNull DocumentEvent documentEvent) { Document document = documentEvent.getDocument(); Position startPosition = document.getStartPosition(); try { options.setOption(name, document.getText(startPosition.getOffset(), document.getLength())); } catch (BadLocationException e) { // Ignore } }