Merge pull request #7273 from eed3si9n/wip/new_bug

Fix sbt init menu
This commit is contained in:
eugene yokota 2023-06-01 23:26:44 -04:00 committed by GitHub
commit 38afd6f2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -183,7 +183,7 @@ private[sbt] object TemplateCommandUtil {
else
ITerminal.withStreams(true, false) {
val mappingList = templates.zipWithIndex.map {
case (v, idx) => nonMoveLetters(idx).toString -> v
case (v, idx) => toLetter(idx) -> v
}
val out = term.printStream
out.println("")
@ -194,10 +194,13 @@ private[sbt] object TemplateCommandUtil {
mappings.get(ans).map(_._1).toList
}
private def toLetter(idx: Int): String =
nonMoveLetters(idx).toString
private def askTemplate(mappingList: List[(String, (String, String))], focus: Int): String = {
val msg = "Select a template"
displayMappings(mappingList, focus)
val focusValue = ('a' + focus).toChar.toString
val focusValue = toLetter(focus)
if (!isAnsiSupported) ask(msg, focusValue)
else {
val out = term.printStream