Skip to content

Commit

Permalink
fix color npe
Browse files Browse the repository at this point in the history
  • Loading branch information
onriv committed Oct 22, 2024
1 parent 24c7de3 commit 3cd7918
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,25 @@ class InfoviewMouseMotionListener(
return
}

// TODO maybe make this singleton?
val attr = object : TextAttributes() {
override fun getBackgroundColor(): Color {
// TODO document this
// TODO should scheme be cache?
val scheme = EditorColorsManager.getInstance().globalScheme
// TODO customize attr? or would backgroundColor null?
// indeed here it can be null, don't know why Kotlin does not mark it as error
// TODO there is cases here the background of identifier under current caret is null?
// TODO there is cases here the background of identifier under current caret is null
// TODO do this better in a way
var color = scheme.getAttributes(EditorColors.IDENTIFIER_UNDER_CARET_ATTRIBUTES).backgroundColor
if (color != null) {
return color
}
color = scheme.getColor(EditorColors.CARET_COLOR)
return color
if (color != null) {
return color
}
return scheme.defaultBackground
}
}
createPopup(c, attr)
Expand Down

0 comments on commit 3cd7918

Please sign in to comment.