Skip to content

Commit

Permalink
fix: rename an opened file and edit the file, the file name in tab wi…
Browse files Browse the repository at this point in the history
…ll be recovered to the original.
  • Loading branch information
mindolph committed Apr 5, 2023
1 parent 055400d commit e903a51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public String getFileRelativePath() {

public void setFile(File file) {
this.file = file;
this.name = file.getName();
}

public NodeType getNodeType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public void updateOpenedTabAndEditor(NodeData origNodeData, File newFile) {
openedFileMap.put(origNodeData, tab);
// update the editor's context for saving content to new file(path)
Editable editable = tabEditorMap.get(tab);
editable.getEditorContext().setFileData(origNodeData);
editable.getEditorContext().getFileData().setFile(newFile);
tab.setText((editable.isChanged() ? "*" : StringUtils.EMPTY) + newFile.getName());
tab.setTooltip(new Tooltip(newFile.getPath()));
}
Expand Down

0 comments on commit e903a51

Please sign in to comment.