PsiDirectory.copyFileFrom -> Redo recreate file without content

Answered

I use PsiDirectory.copyFileFrom to copy file. It works fine. Undo works fine too, but redo create empty file.

Version: CE 163.12024

0
6 comments

Same issue with Undo. I use command inside dialog, then close it and use Undo. Can command lose file content after closing dialog? Also Ctrl+Z don't available in dialog, it unlocks after closing dialog only.

Command looks like: 

CommandProcessor.getInstance().executeCommand(project, futureTask, actionLabel, null);
0

Arsen, there is a known issue with Undo that doesn't support binary files IDEA-99788. Do you have the same problem?

0

Yes, but i'm working with .json / .java / .etc  text files, not binary. Is it possible to make something like "create empty file + Editor command insert full text", should it work with Undo?

0

Should be possible via VirtualDirectory.createChildData/VfsUtil#saveText

0

Please sign in to leave a comment.