feat(files): add a plain text editor to the file manager (#2980)

* feat(files): add a plain text editor to the file manager

* fix(files): address CodeRabbit review on the text editor

- compose the editor instead of the toolbar so EXIT can't bypass the
  unsaved-changes guard
- read through a capped stream, keep undecodable files read-only, and
  preserve POSIX permissions via staging-file rename with no direct-write
  fallback
- serialize saves, keep dirty consistent across concurrent edits, reset
  match index on text change, fix empty-state counter and read-only
  replace buttons
- scroll match into view horizontally; ignore cursor-only edits for dirty
- add tests for literal U+FFFD files and the capped reader

* fix(files): treat rename failure as save error and follow symbolic links

* test(files): assert the resolved save target without canonicalizing it

---------

Co-authored-by: Dantalian <Dantalian-dev@users.noreply.github.com>
This commit is contained in:
DantalianandDantalian authored and GitHub committed 2026-11-23 10:16:39 -05:00
1 parent 3e558ab33e
commit a305a91c66
6 files changed
+918 -1

No files matched your search

+17
View File
@@ -2216,6 +2216,23 @@
<string name="fm_favorite_removed">Removed \"%1$s\" from Favorites</string>
<string name="fm_empty_directory">Empty directory</string>
<string name="fm_up_one_level">Up one level</string>
<string name="fm_edit_open">Open</string>
<string name="fm_edit_save">Save</string>
<string name="fm_edit_read_only">Read only</string>
<string name="fm_edit_binary">Binary</string>
<string name="fm_edit_modified">Modified</string>
<string name="fm_edit_position">Ln %1$d, Col %2$d</string>
<string name="fm_edit_find">Find</string>
<string name="fm_edit_find_previous">Find previous</string>
<string name="fm_edit_find_next">Find next</string>
<string name="fm_edit_replace">Replace</string>
<string name="fm_edit_replace_all">All</string>
<string name="fm_edit_discard_title">Discard changes?</string>
<string name="fm_edit_discard_text">Changes to \"%1$s\" will be lost.</string>
<string name="fm_edit_discard">Discard</string>
<string name="fm_edit_save_failed">Couldn\'t save \"%1$s\"</string>
<string name="fm_edit_open_failed">Couldn\'t open \"%1$s\"</string>
<string name="fm_edit_too_large">Too large to open (%1$s)</string>
<string name="fm_choose_folder">Choose a folder</string>
<string name="fm_choose_file">Choose a file</string>
<string name="ctrl_tint_steam_blue">Steam blue</string>