Skip to content

Commit

Permalink
Empty status bar message after each test
Browse files Browse the repository at this point in the history
  • Loading branch information
lippfi committed Feb 18, 2024
1 parent 9c804cc commit 9855865
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package org.jetbrains.plugins.ideavim.extension.highlightedyank

import com.intellij.openapi.editor.markup.RangeHighlighter
import com.maddyhome.idea.vim.extension.highlightedyank.DEFAULT_HIGHLIGHT_DURATION
import com.maddyhome.idea.vim.newapi.vim
import com.maddyhome.idea.vim.state.mode.Mode
import org.jetbrains.plugins.ideavim.VimTestCase
import org.jetbrains.plugins.ideavim.assertHappened
Expand All @@ -31,7 +30,6 @@ class VimHighlightedYankTest : VimTestCase() {

assertAllHighlightersCount(1)
assertHighlighterRange(1, 40, getFirstHighlighter())
clearMessage()
}

@Test
Expand All @@ -40,15 +38,13 @@ class VimHighlightedYankTest : VimTestCase() {

assertAllHighlightersCount(1)
assertHighlighterRange(5, 8, getFirstHighlighter())
clearMessage()
}

@Test
fun `test removing previous highlight when entering insert mode`() {
doTest("yyi", code, code, Mode.INSERT)

assertAllHighlightersCount(0)
clearMessage()
}

@Test
Expand All @@ -65,7 +61,6 @@ class VimHighlightedYankTest : VimTestCase() {
assertHighlighterRange(12, 15, highlighters[1])
assertHighlighterRange(20, 23, highlighters[0])
assertHighlighterRange(28, 31, highlighters[2])
clearMessage()
}

@Test
Expand All @@ -78,7 +73,6 @@ Mode.INSERT,
)

assertAllHighlightersCount(0)
clearMessage()
}

@Test
Expand All @@ -88,11 +82,6 @@ Mode.INSERT,
assertHappened(DEFAULT_HIGHLIGHT_DURATION.toInt(), 200) {
getAllHighlightersCount() == 0
}
clearMessage()
}

private fun clearMessage() {
injector.messages.showStatusBarMessage(fixture.editor.vim, "")
}

private val code = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ abstract class VimTestCase {
bookmarksManager?.bookmarks?.forEach { bookmark ->
bookmarksManager.remove(bookmark)
}
fixture.editor?.let { injector.messages.showStatusBarMessage(it.vim, "") }
SelectionVimListenerSuppressor.lock().use { fixture.tearDown() }
ExEntryPanel.getInstance().deactivate(false)
VimPlugin.getVariableService().clear()
Expand Down

0 comments on commit 9855865

Please sign in to comment.