void (@NotNull InsertionContext context, @NotNull LookupElement item) { final Editor editor = context.getEditor(); final Document document = editor.getDocument(); int offset = context.getStartOffset(); if (offset == 0 || !"%".equals(document.getText(TextRange.from(offset - 1, 1)))) { document.insertString(offset, "%"); } }