From c0699e54288416a7a60689cd06d5d58828c6e68b Mon Sep 17 00:00:00 2001 From: sschweid Date: Tue, 25 Jul 2023 08:49:24 +0300 Subject: [PATCH] fix --- src/main/kotlin/com/bridgecrew/ui/actions/SuppressAction.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/bridgecrew/ui/actions/SuppressAction.kt b/src/main/kotlin/com/bridgecrew/ui/actions/SuppressAction.kt index 51207d4..e03d0a8 100644 --- a/src/main/kotlin/com/bridgecrew/ui/actions/SuppressAction.kt +++ b/src/main/kotlin/com/bridgecrew/ui/actions/SuppressAction.kt @@ -114,8 +114,8 @@ class SuppressAction(private val project: Project, private val buttonInstance: J val matchSpacesBeforeComment = Regex("^[\\s\\t]+").find(textLine) val addSpacesBeforeComment = if(matchSpacesBeforeComment?.value !== null) matchSpacesBeforeComment.value else "" - WriteCommandAction.runWriteCommandAction(null) { - val editor = EditorFactory.getInstance().createEditor(document, null) + WriteCommandAction.runWriteCommandAction(project) { + val editor = EditorFactory.getInstance().createEditor(document, project) val newLineText = "${addSpacesBeforeComment}${suppressionComment}\n" document.insertString(insertionOffset, newLineText) editor.caretModel.moveToOffset(insertionOffset + newLineText.length)