Skip to content

Commit

Permalink
** 修复 {ext:= } 筛选器对多文件的后续名判断错误
Browse files Browse the repository at this point in the history
  • Loading branch information
linxinhong committed Dec 14, 2019
1 parent 5cb2649 commit 1f16c8f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions lib/class_menuz.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
item.filter := menuz.ReplaceVar(item.filter)
allowAdd := true
if ( StrLen(item.filter) ) {
if (env.isFileMulti and not RegExMatch(item.filter, "i){only:(.*)}")) {
allowAdd := env.JudgeFilterTag("{only:file}")
}
Operator := "AND"
tagPos := 1
Loop {
Expand All @@ -42,12 +45,14 @@
else if (RegExMatch(tagMatch2, "^[\s|]$")) {
Operator := "OR"
}
allowAdd := Operator == "AND" ? allowAdd and tagResult : allowAdd or tagResult
quickz.log({topic: "debug", content: item.name " " tagMatch " " env.JudgeFilterTag(tagMatch1) " " Operator })
allowAdd := (Operator == "AND") ? (allowAdd and tagResult) : (allowAdd or tagResult)
}
else {
break
}
}
quickz.log({topic: "debug", content: item.filter " " allowAdd })
}
if (allowAdd) {
if (IsObject(item.peer)) {
Expand Down Expand Up @@ -583,7 +588,16 @@
return this.RuleTest(match1, onlyType)
}
else if (RegExMatch(tag, "i)^{ext:(.*)}$", match)) {
return this.RuleTest(match1, this.file.ext)
if ( this.isFileMulti ) {
extTest := true
for ext, num in this.fileMulti.extList {
extTest := extTest and this.RuleTest(match1, ext)
}
return extTest
}
else {
return this.RuleTest(match1, this.file.ext)
}
}
else if (RegExMatch(tag, "i)^{filename:(.*)}$", match)) {
return this.RuleTest(match1, this.file.name)
Expand Down Expand Up @@ -717,6 +731,5 @@
,"ymargin" : 3 ;margin for the top and bottom of item boundary
,"textMargin" : 5 } ;pixels amount which will be added after the text to make menu look pretty
}

}
}

0 comments on commit 1f16c8f

Please sign in to comment.