From c0b834e7762456737352c5b86abc30ede0844e2d Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Fri, 26 May 2017 19:10:05 +0300 Subject: [PATCH] Display at least 3 rows in the reword dialog Otherwise it looks confusing for one-line messages. --- plugins/git4idea/src/git4idea/rebase/GitRewordAction.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/git4idea/src/git4idea/rebase/GitRewordAction.kt b/plugins/git4idea/src/git4idea/rebase/GitRewordAction.kt index 9fea907232a4..404f836c3434 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRewordAction.kt +++ b/plugins/git4idea/src/git4idea/rebase/GitRewordAction.kt @@ -20,6 +20,7 @@ import com.intellij.dvcs.repo.Repository.State.* import com.intellij.notification.NotificationType import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.diagnostic.logger +import com.intellij.openapi.editor.impl.EditorImpl import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.progress.ProgressManager @@ -144,6 +145,13 @@ class GitRewordAction : GitCommitEditingAction() { val editor = CommitMessage.createCommitTextEditor(project) editor.text = commit.fullMessage editor.setCaretPosition(0) + editor.addSettingsProvider { editor -> + // display at least several rows for one-line messages + val MIN_ROWS = 3 + if ((editor as EditorImpl).visibleLineCount < MIN_ROWS) { + verticalStretch = 1.5F + } + } return editor } }