From 8805785e17dc9d046fd5e5e6c9c0197455be9107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=87=E7=A8=8B?= <1498425439@qq.com> Date: Fri, 26 Jan 2024 19:43:51 +0800 Subject: [PATCH] fix(DocFilter): line count project and global should effective both --- .../linwancen/plugin/show/lang/base/DocFilter.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/linwancen/plugin/show/lang/base/DocFilter.java b/src/main/java/io/github/linwancen/plugin/show/lang/base/DocFilter.java index 8748353..eafdf11 100644 --- a/src/main/java/io/github/linwancen/plugin/show/lang/base/DocFilter.java +++ b/src/main/java/io/github/linwancen/plugin/show/lang/base/DocFilter.java @@ -56,14 +56,11 @@ public class DocFilter { public static boolean lineCountOrLenOver(@NotNull T info, @NotNull StringBuilder sb, int lineCount) { - // can not effective both - if (info.projectSettings.projectFilterEffective) { - return lineCountOrLenOverInfo(info.projectSettings, sb, lineCount); - } else if (info.projectSettings.globalFilterEffective) { - return lineCountOrLenOverInfo(info.globalSettings, sb, lineCount); - } else { - return false; - } + boolean overProject = info.projectSettings.projectFilterEffective + && lineCountOrLenOverInfo(info.projectSettings, sb, lineCount); + boolean overGlobal = info.projectSettings.globalFilterEffective + && lineCountOrLenOverInfo(info.globalSettings, sb, lineCount); + return overGlobal || overProject; } private static boolean lineCountOrLenOverInfo(@NotNull AbstractSettingsState appSettings,