@@ -539,7 +539,7 @@ class SettingsBase: NSObject {
539
539
}
540
540
541
541
// Extra arguments for _highlight_.
542
- if let args = settings [ SettingsBase . Key. extraArguments] as? String {
542
+ if let args = settings [ SettingsBase . Key. extraArguments] as? String , !args . trimmingCharacters ( in : . whitespaces ) . isEmpty {
543
543
self . arguments = args
544
544
self . isArgumentsDefined = true
545
545
}
@@ -895,7 +895,7 @@ class SettingsFormat: SettingsBase, SettingsFormatProtocol, SettingsLSP {
895
895
896
896
super. override ( fromDictionary: dict)
897
897
898
- if let args = settings [ SettingsBase . Key. appendedExtraArguments] as? String {
898
+ if let args = settings [ SettingsBase . Key. appendedExtraArguments] as? String , !args . trimmingCharacters ( in : . whitespaces ) . isEmpty {
899
899
self . appendArguments = args
900
900
self . isAppendArgumentsDefined = true
901
901
}
@@ -919,7 +919,7 @@ class SettingsFormat: SettingsBase, SettingsFormatProtocol, SettingsLSP {
919
919
if let v = specials [ SettingsBase . Key. syntax] {
920
920
self . specialSyntax = v
921
921
}
922
- if let v = specials [ SettingsBase . Key. appendedExtraArguments] {
922
+ if let v = specials [ SettingsBase . Key. appendedExtraArguments] , !v . trimmingCharacters ( in : . whitespaces ) . isEmpty {
923
923
self . specialAppendArguments = v
924
924
}
925
925
}
@@ -948,7 +948,7 @@ class SettingsFormat: SettingsBase, SettingsFormatProtocol, SettingsLSP {
948
948
if let syntax = self . specialSyntax {
949
949
special [ SettingsBase . Key. syntax] = syntax
950
950
}
951
- if let appendArguments = self . specialAppendArguments {
951
+ if let appendArguments = self . specialAppendArguments, !appendArguments . trimmingCharacters ( in : . whitespaces ) . isEmpty {
952
952
special [ SettingsBase . Key. appendedExtraArguments] = appendArguments
953
953
}
954
954
if !special. isEmpty {
@@ -1403,10 +1403,10 @@ class Settings: SettingsBase {
1403
1403
}
1404
1404
}
1405
1405
1406
- func searchPlainSettings( for url: URL ) -> PlainSettings ? {
1406
+ func searchPlainSettings( for url: URL , mimeType : String ? ) -> PlainSettings ? {
1407
1407
let name = url. lastPathComponent
1408
1408
for s in self . plainSettings {
1409
- if s. test ( filename: name) {
1409
+ if s. test ( filename: name, mimeType : mimeType ) {
1410
1410
return s
1411
1411
}
1412
1412
}
@@ -1728,7 +1728,7 @@ class SettingsRendering: Settings, SettingsFormatProtocol, SettingsLSP {
1728
1728
self . isError = v
1729
1729
}
1730
1730
1731
- if let args = settings [ SettingsBase . Key. appendedExtraArguments] as? String {
1731
+ if let args = settings [ SettingsBase . Key. appendedExtraArguments] as? String , !args . trimmingCharacters ( in : . whitespaces ) . isEmpty {
1732
1732
self . appendArguments = args
1733
1733
self . isAppendArgumentsDefined = true
1734
1734
}
0 commit comments