!55 修复 BUG 重复重命名文件失败

Merge pull request !55 from 格物方能致知/fix-I7XAU0
This commit is contained in:
songdragon 2023-08-30 14:52:27 +00:00 committed by Gitee
commit 6fa60fe02e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -45,6 +45,8 @@ public class RenameFile implements EventHandler<ActionEvent> {
File newFile = fileChooser.showSaveDialog(UiUtil.getAppWindow());
if (newFile != null) {
boolean rename = file.renameTo(newFile);
// 设置文件数据
jnotepadtab.setUserData(newFile);
if (rename) {
jnotepadtab.setText(newFile.getName());
logger.info("文件重命名成功");