preserve dirty
after importing moz-format [v2], fixes #1163
This commit is contained in:
parent
3a3104b30a
commit
c41a5f92c3
|
@ -371,6 +371,7 @@ function SectionsEditor() {
|
||||||
await initSections(sections, {
|
await initSections(sections, {
|
||||||
replace: replaceOldStyle,
|
replace: replaceOldStyle,
|
||||||
focusOn: replaceOldStyle ? 0 : false,
|
focusOn: replaceOldStyle ? 0 : false,
|
||||||
|
keepDirty: true,
|
||||||
});
|
});
|
||||||
helpPopup.close();
|
helpPopup.close();
|
||||||
}
|
}
|
||||||
|
@ -473,6 +474,7 @@ function SectionsEditor() {
|
||||||
async function initSections(src, {
|
async function initSections(src, {
|
||||||
focusOn = 0,
|
focusOn = 0,
|
||||||
replace = false,
|
replace = false,
|
||||||
|
keepDirty = false, // used by import
|
||||||
} = {}) {
|
} = {}) {
|
||||||
if (replace) {
|
if (replace) {
|
||||||
sections.forEach(s => s.remove(true));
|
sections.forEach(s => s.remove(true));
|
||||||
|
@ -505,7 +507,7 @@ function SectionsEditor() {
|
||||||
if (si) forceRefresh = y < si.scrollY2 && (y += si.cms[i].parentHeight) > si.scrollY;
|
if (si) forceRefresh = y < si.scrollY2 && (y += si.cms[i].parentHeight) > si.scrollY;
|
||||||
insertSectionAfter(src[i], null, forceRefresh, si && si.cms[i]);
|
insertSectionAfter(src[i], null, forceRefresh, si && si.cms[i]);
|
||||||
setGlobalProgress(i, src.length);
|
setGlobalProgress(i, src.length);
|
||||||
dirty.clear();
|
if (!keepDirty) dirty.clear();
|
||||||
if (i === focusOn) sections[i].cm.focus();
|
if (i === focusOn) sections[i].cm.focus();
|
||||||
}
|
}
|
||||||
if (!si) requestAnimationFrame(fitToAvailableSpace);
|
if (!si) requestAnimationFrame(fitToAvailableSpace);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user