Renaming a component and hitting Ctrl+W closes the file without saving

Is this an expected behavior? I expect a message: 'The file is modified. Do you want to save the file before closing it?