Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sschweid committed Jul 25, 2023
1 parent 143c94d commit c0699e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/bridgecrew/ui/actions/SuppressAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c0699e5

Please sign in to comment.