- Fix built-in editor Ctrl+S stale closure bug that caused saving the
initial content instead of the current content
- Use a ref to always capture the latest handleSave function
- Improve file watcher to handle both 'change' and 'rename' events
(some editors use atomic writes which trigger 'rename' instead)
Co-authored-by: binaricat <16399091+binaricat@users.noreply.github.com>