[kotlin] Remove extra slash before file name

#KTIJ-27845

GitOrigin-RevId: 429ca0ee9a9b66ff6ed9185826d39c49ffa8b924
This commit is contained in:
Bart van Helvert
2023-12-19 00:12:59 +00:00
committed by intellij-monorepo-bot
parent d70f43e027
commit d193e1d34c
@@ -99,9 +99,9 @@ sealed interface K2MoveTargetModel {
fun updateFileChooser() {
val itemWrapper = (destinationChooser.comboBox.selectedItem as? DirectoryChooser.ItemWrapper) ?: return
val existingPath = itemWrapper.directory?.virtualFile?.path ?: return
val postFix = itemWrapper.postfix?.removePrefix("\\") ?: "" // post fix in case real directory doesn't exist yet
val postFix = itemWrapper.postfix?.removePrefix("\\")?.replace("\\", "/")?.plus("/") ?: "" // post fix in case real directory doesn't exist yet
val fileName = fileChooser.text.substringAfterLast("/")
val fullPath = "$existingPath/$postFix/$fileName"
val fullPath = "$existingPath/$postFix$fileName"
if (fullPath != fileChooser.text) fileChooser.text = fullPath
}
destinationChooser.comboBox.addActionListener {