Release v0.4.0: dev -> main #251

Merged
fen merged 138 commits from dev into main 2026-09-17 15:35:21 +00:00
Showing only changes of commit 6c1bfaf15e - Show all commits
+10 -8
View File
@@ -280,11 +280,12 @@ async function showFileInEditor(file) {
if (!TEXT_EXTS.has(extOf(file.name))) return; // unknown binary: leave editor alone
try {
const text = await file.text();
if (!content.value.trim()) {
content.value = text;
updateGutter();
guessLang();
}
// #184: the file replaces the main editing area, so the text always
// loads over whatever was in the editor (same rule as images, which
// hide the editor entirely).
content.value = text;
updateGutter();
guessLang();
} catch (e) {}
}
@@ -306,9 +307,10 @@ function setAttachedFile(file) {
attachedFile = file;
renderFileChip();
setHidden('file-text-note', false);
// #171: title auto-fill — images take the file name; text files use the
// language-placeholder convention (e.g. Python.py, fallback Text.txt).
// Only when the title is still blank; never overwrite a typed title.
// #171/#184: title auto-fill — images take the file name; text files
// use the language-placeholder convention (e.g. Python.py, fallback
// Text.txt). Only when the title is still blank; never overwrite a
// typed title.
if (!$('title').value.trim()) {
if (IMAGE_RE.test(file.type)) {
$('title').value = file.name;