void (InsertionContext context, String option) { Document document = context.getDocument(); if (document.getCharsSequence().toString().contains(option)) return; document.insertString(0, option + (context.getEditor().isOneLineMode() ? " " : "\n")); }