fix: channel mention display
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
1415a7744e
commit
5a794115f4
|
|
@ -89,6 +89,7 @@ import dev.snipme.highlights.model.ColorHighlight
|
||||||
import dev.snipme.highlights.model.SyntaxLanguage
|
import dev.snipme.highlights.model.SyntaxLanguage
|
||||||
import dev.snipme.highlights.model.SyntaxThemes
|
import dev.snipme.highlights.model.SyntaxThemes
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import logcat.logcat
|
||||||
import org.intellij.markdown.MarkdownElementTypes
|
import org.intellij.markdown.MarkdownElementTypes
|
||||||
import org.intellij.markdown.MarkdownTokenTypes
|
import org.intellij.markdown.MarkdownTokenTypes
|
||||||
import org.intellij.markdown.ast.ASTNode
|
import org.intellij.markdown.ast.ASTNode
|
||||||
|
|
@ -241,10 +242,15 @@ private fun annotateText(
|
||||||
background = state.colors.clickableBackground
|
background = state.colors.clickableBackground
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val channel = RevoltAPI.channelCache[channelId]
|
val channel = RevoltAPI.channelCache[channelId]
|
||||||
val mentionDisplay = channel?.name?.let { name -> "#$name" }
|
val mentionDisplay = channel?.name?.let { name -> "#$name" }
|
||||||
?: "<#$channelId>"
|
?: "<#$channelId>"
|
||||||
|
|
||||||
|
appendInlineContent(JBMAnnotations.JBMBackgroundRoundingStart.tag)
|
||||||
append(mentionDisplay)
|
append(mentionDisplay)
|
||||||
|
appendInlineContent(JBMAnnotations.JBMBackgroundRoundingEnd.tag)
|
||||||
|
|
||||||
pop()
|
pop()
|
||||||
pop()
|
pop()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class ChannelMentionParser : SequentialParser {
|
||||||
result.withNode(
|
result.withNode(
|
||||||
SequentialParser.Node(
|
SequentialParser.Node(
|
||||||
start..iterator.index + 1,
|
start..iterator.index + 1,
|
||||||
RSMElementTypes.USER_MENTION
|
RSMElementTypes.CHANNEL_MENTION
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue