diff --git a/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintActionOnSave.kt b/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintActionOnSave.kt index 2245413..bbdff47 100644 --- a/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintActionOnSave.kt +++ b/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintActionOnSave.kt @@ -50,11 +50,15 @@ class KtlintActionOnSave : ActionOnSave() { PsiManager .getInstance(project) .findFile(virtualFile) - ?.let { psiFile -> ktlintFormat(psiFile, "KtlintActionOnSave") } + ?.let { psiFile -> + ktlintFormat(psiFile, ktlintFormatRange = KtlintFileFormatRange, triggeredBy = "KtlintActionOnSave") + } } } else { // Only format files which were modified - psiFiles.forEach { psiFile -> ktlintFormat(psiFile, "KtlintActionOnSave") } + psiFiles.forEach { psiFile -> + ktlintFormat(psiFile, ktlintFormatRange = KtlintFileFormatRange, triggeredBy = "KtlintActionOnSave") + } } } } diff --git a/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintConfigForm.form b/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintConfigForm.form index 782aa86..a4d0af1 100644 --- a/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintConfigForm.form +++ b/plugin/src/main/kotlin/com/nbadal/ktlint/KtlintConfigForm.form @@ -1,6 +1,6 @@