Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jojo2357 committed May 4, 2024
1 parent 04d73ad commit ace3c25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ open class RequiredFileArgument(name: String?, open val isAbsolutePathSupported:
regex.append("(")
for (extension in extensions) {
regex.append("\\.")
val extensionLower = extension.lowercase(Locale.getDefault())
regex.append(extensionLower)
supportedExtensions.add(extensionLower)
regex.append(extension)
supportedExtensions.add(extension)
if (extension != extensions[extensions.size - 1]) {
regex.append("|")
}
Expand Down
4 changes: 2 additions & 2 deletions src/nl/hannahsten/texifyidea/util/Strings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ fun String.getIndent(): String {
fun String.appendExtension(extensionWithoutDot: String): String {
if (extensionWithoutDot == "") return this

val dottedExtension = ".${extensionWithoutDot.lowercase(Locale.getDefault())}"
val dottedExtension = ".${extensionWithoutDot}"
val thisLower = lowercase(Locale.getDefault())

return when {
thisLower.endsWith(dottedExtension) -> this
thisLower.endsWith(dottedExtension.lowercase(Locale.getDefault())) -> this
endsWith('.') -> this + extensionWithoutDot
else -> this + dottedExtension
}
Expand Down

0 comments on commit ace3c25

Please sign in to comment.