Skip to content

Commit

Permalink
Fix(VIM-3569): Pipe-symbol can no longer be used in remaps
Browse files Browse the repository at this point in the history
  • Loading branch information
lippfi committed Jul 30, 2024
1 parent 956e726 commit 5dc860f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,15 @@ class MapCommandTest : VimTestCase() {
assertState("I found it in ${c}a legendary land")
}

@Test
@TestFor(issues = ["VIM-3569"])
fun `test bar in mapping`() {
configureByText("${c}I found it in a legendary land")
typeText(commandToKeys("nmap <leader>\\| dw"))
typeText("<leader>|")
assertState("${c}found it in a legendary land")
}

// VIM-676 |:map|
@TestWithoutNeovim(reason = SkipNeovimReason.VIM_SCRIPT)
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ data class MapCommand(val range: Range, val argument: String, val cmd: String) :
if (specialArgument != null) {
specialArguments.add(specialArgument)
} else {
fromKeys = injector.parser.parseKeys(part)
fromKeys = injector.parser.parseKeys(processBars(part))
}
}
}
Expand All @@ -190,4 +190,8 @@ data class MapCommand(val range: Range, val argument: String, val cmd: String) :
CommandArguments(specialArguments, it, toExpr, toKeysBuilder.toString().trimStart())
}
}

private fun processBars(fromString: String): String {
return fromString.replace("\\|", "|")
}
}

0 comments on commit 5dc860f

Please sign in to comment.