Exit Editor (in Text Editor)

File | Exit Editor

This closes the currently open file. If the file was modified, but the modifications have not been saved, MEGA will ask whether to discard the changes. Note that this command exits the Text Editor only, not MEGA.