Use getActiveEditor() instead of getFocusedEditor() for save command.