From f74fa353930f75075e36725c8b1c9c98f126a2be Mon Sep 17 00:00:00 2001 From: sschweid Date: Wed, 10 May 2023 14:04:04 +0300 Subject: [PATCH 1/2] fix bubble line --- .../com/bridgecrew/ui/CheckovToolWindowManagerPanel.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/bridgecrew/ui/CheckovToolWindowManagerPanel.kt b/src/main/kotlin/com/bridgecrew/ui/CheckovToolWindowManagerPanel.kt index 9aade7c..0623946 100644 --- a/src/main/kotlin/com/bridgecrew/ui/CheckovToolWindowManagerPanel.kt +++ b/src/main/kotlin/com/bridgecrew/ui/CheckovToolWindowManagerPanel.kt @@ -324,9 +324,10 @@ class CheckovToolWindowManagerPanel(val project: Project) : SimpleToolWindowPane } private fun createIconForLineErrors(firstRow: Int, results: List, markup: MarkupModel, document: Document) { - val rangeHighlighter: RangeHighlighter = markup.addLineHighlighter(firstRow, HighlighterLayer.ERROR, null) - val iconLocation = if(firstRow >= document.lineCount) document.getLineStartOffset(firstRow) else document.getLineStartOffset(firstRow + 1) - val gutterIconRenderer = CheckovGutterErrorIcon(results, iconLocation, markup, firstRow) + val rowInFile = if(firstRow > 0) firstRow - 1 else firstRow + val rangeHighlighter: RangeHighlighter = markup.addLineHighlighter(rowInFile, HighlighterLayer.ERROR, null) + val bubbleLocation = if(rowInFile >= document.lineCount) document.getLineStartOffset(rowInFile) else document.getLineStartOffset(rowInFile + 1) + val gutterIconRenderer = CheckovGutterErrorIcon(results, bubbleLocation, markup, rowInFile) rangeHighlighter.gutterIconRenderer = gutterIconRenderer rangeHighlighter.putUserData(key, true) } From 2a3c26f1bd4286edbc3bbe3e906f5ab007abe21f Mon Sep 17 00:00:00 2001 From: sschweid Date: Wed, 10 May 2023 15:21:34 +0300 Subject: [PATCH 2/2] return to prevent double call --- .../com/bridgecrew/initialization/InitializationService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/com/bridgecrew/initialization/InitializationService.kt b/src/main/kotlin/com/bridgecrew/initialization/InitializationService.kt index 4fa4fa8..3f5a047 100644 --- a/src/main/kotlin/com/bridgecrew/initialization/InitializationService.kt +++ b/src/main/kotlin/com/bridgecrew/initialization/InitializationService.kt @@ -97,6 +97,7 @@ class InitializationService(private val project: Project) { private fun updatePythonBasePath(project: Project, version: String) { if(checkIfCheckovUpdateNeeded(version)){ updateCheckovPip(project) + return } val os = System.getProperty("os.name").lowercase()