Merge pull request #5835 from eatkins/progress-truncated-command

Increase length of truncated command
This commit is contained in:
eugene yokota 2020-09-11 05:44:14 -04:00 committed by GitHub
commit 34da6cfc0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -139,8 +139,8 @@ private[sbt] final class ProgressState(
}
private[sbt] object ProgressState {
private val MIN_COMMAND_WIDTH = 10
private val SERVER_IS_RUNNING = "sbt server is running "
// the + 2 is for the quotation marks
private val SERVER_IS_RUNNING_LENGTH = SERVER_IS_RUNNING.length + 2
/**
@ -179,7 +179,7 @@ private[sbt] object ProgressState {
val width = terminal.getWidth
val sanitized = if ((cmd.length + SERVER_IS_RUNNING_LENGTH) > width) {
if (SERVER_IS_RUNNING_LENGTH + cmd.length < width) cmd
else cmd.take(MIN_COMMAND_WIDTH) + "..."
else cmd.take(cmd.length - 3 - SERVER_IS_RUNNING_LENGTH) + "..."
} else cmd
val tail = if (isWatch) Nil else "enter 'cancel' to stop evaluation" :: Nil
s"$SERVER_IS_RUNNING '$sanitized'" :: tail