mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2025-12-05 06:11:52 +00:00
Cleanup
This commit is contained in:
parent
4a5b2f32f6
commit
07ab7b2f05
@ -49,7 +49,6 @@ internal fun <T> SearchBarWithAutoCompletion(
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
snapshotFlow { textFieldState.text.toString() }
|
||||
.onEach { println("Text changed: $it") }
|
||||
.distinctUntilChanged()
|
||||
.collect { searchTerm -> popupController.onQueryChanged(searchTerm) }
|
||||
}
|
||||
@ -173,15 +172,11 @@ private class CompletionPopupController<T : Searchable>(
|
||||
|
||||
fun onQueryChanged(searchTerm: String) {
|
||||
if (skipPopupShowing) {
|
||||
println("Skipping opening the dropdown, because item was just autocompleted.")
|
||||
|
||||
skipPopupShowing = false
|
||||
return
|
||||
}
|
||||
|
||||
if (searchTerm.isEmpty()) {
|
||||
println("Hiding popup, because query is empty.")
|
||||
|
||||
hidePopup()
|
||||
|
||||
return
|
||||
@ -191,10 +186,8 @@ private class CompletionPopupController<T : Searchable>(
|
||||
moveSelectionToFirstItem()
|
||||
|
||||
if (filteredItems.isNotEmpty()) {
|
||||
println("Showing popup, because there are items matching the query.")
|
||||
showPopup()
|
||||
} else {
|
||||
println("Hiding popup, because there are no items matching the query.")
|
||||
hidePopup()
|
||||
}
|
||||
}
|
||||
@ -254,8 +247,6 @@ private fun <T : Searchable> Modifier.handlePopupCompletionKeyEvents(
|
||||
return onPreviewKeyEvent { keyEvent ->
|
||||
if (keyEvent.type != KeyEventType.KeyDown) return@onPreviewKeyEvent false
|
||||
|
||||
println("${keyEvent.key} key is pressed")
|
||||
|
||||
return@onPreviewKeyEvent when (keyEvent.key) {
|
||||
Key.Tab, Key.Enter, Key.NumPadEnter -> {
|
||||
onItemAutocompleteConfirmed(popupController.onItemAutocompleteConfirmed())
|
||||
|
||||
@ -17,7 +17,7 @@ import javax.xml.transform.stream.StreamResult
|
||||
import javax.xml.xpath.XPathConstants
|
||||
import javax.xml.xpath.XPathFactory
|
||||
|
||||
object EmbeddedToInlineCssSvgTransformerHint : PainterSvgPatchHint {
|
||||
internal object EmbeddedToInlineCssSvgTransformerHint : PainterSvgPatchHint {
|
||||
private val CSS_STYLEABLE_TAGS = listOf(
|
||||
"linearGradient", "radialGradient", "pattern",
|
||||
"filter", "clipPath", "mask", "symbol",
|
||||
@ -25,9 +25,7 @@ object EmbeddedToInlineCssSvgTransformerHint : PainterSvgPatchHint {
|
||||
)
|
||||
|
||||
override fun PainterProviderScope.patch(element: Element) {
|
||||
val processedElement = element.inlineEmbeddedStylesCSS()
|
||||
|
||||
println(PrintableElement(processedElement).writeToString())
|
||||
element.inlineEmbeddedStylesCSS()
|
||||
}
|
||||
|
||||
private fun Element.inlineEmbeddedStylesCSS(): Element {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user