From 4f882c4485c0d428888bf56af6b68d35d22d150e Mon Sep 17 00:00:00 2001 From: Mikhail Sokolov Date: Mon, 17 Jan 2022 20:56:16 +0300 Subject: [PATCH] IDEA-285414 VCS widget: exception for long branch name GitOrigin-RevId: dfbef0c5bf97d5664ec6a8c2f118d3f039bf635a --- plugins/git4idea/src/git4idea/ui/toolbar/GitToolbarWidget.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/ui/toolbar/GitToolbarWidget.kt b/plugins/git4idea/src/git4idea/ui/toolbar/GitToolbarWidget.kt index eba4f2be6854..2f173d9373f5 100644 --- a/plugins/git4idea/src/git4idea/ui/toolbar/GitToolbarWidget.kt +++ b/plugins/git4idea/src/git4idea/ui/toolbar/GitToolbarWidget.kt @@ -102,8 +102,8 @@ private const val SHORTENED_END_PART = 8 private fun cutText(value: String?): String? { if (value == null || value.length <= MAX_TEXT_LENGTH) return value - val beginRange = IntRange(0, SHORTENED_BEGIN_PART) - val endRange = IntRange(value.length - SHORTENED_END_PART, value.length) + val beginRange = IntRange(0, SHORTENED_BEGIN_PART - 1) + val endRange = IntRange(value.length - SHORTENED_END_PART, value.length - 1) return value.substring(beginRange) + "..." + value.substring(endRange) }