Expand description
Saving a text (.txt) item edited in the app’s text viewer.
Eagle’s text editor writes the new text to a temporary file beside the
original (<name>.txt.<ms>) and moves it over the original, so a
half-written file is never left in place. It refuses to save empty
text. It leaves the item’s metadata.json alone, so size and
mtime go stale; falcon refreshes them (and lastModified, as every
item edit does) so the inspector and size filters stay right. btime
and modificationTime keep their values.
A text item also carries the start of its text in the item record, under
the text key, as Eagle’s text importer writes it: the grid draws the
card from it instead of a thumbnail (there is no _thumbnail.png), and
search reads it. preview makes that value.
Constants§
- PREVIEW_
UNITS - How much text the record keeps: 32 Ki UTF-16 code units, as Eagle’s importer cuts it.
- RECORD_
KEYS - The keys of a text item’s
metadata.jsonin the order Eagle writes them: nowidth,heightorpalettes, andtextjust beforelastModified. - TEXT_
KEY - The item key holding the start of a text item’s text.
Functions§
- cut
- The start of
textthat fits inPREVIEW_UNITSUTF-16 code units, never splitting a character. - preview
- The value of
TEXT_KEYfor the text file atpath: its start, read as UTF-8 with invalid bytes replaced, as Eagle reads it.