cursor focus
This commit is contained in:
@@ -1226,19 +1226,22 @@ export function startNoteEditor(adapter) {
|
||||
}
|
||||
const previewSnapshot = previewEditSnapshot();
|
||||
const previous = editor.value, start = editor.selectionStart, end = editor.selectionEnd, direction = editor.selectionDirection, scrollTop = editor.scrollTop, scrollLeft = editor.scrollLeft;
|
||||
const mapped = mapSelectionThroughEdit(previous, content, start, end);
|
||||
const initialLoad = editHistory.index < 0;
|
||||
const mapped = initialLoad
|
||||
? { start: 0, end: 0 }
|
||||
: mapSelectionThroughEdit(previous, content, start, end);
|
||||
applyingRemote = true;
|
||||
editor.value = content;
|
||||
authorship = adoptCurrentOwnerAliases(parseAuthorship(content, ownerMap), content.length);
|
||||
previousContent = content;
|
||||
editor.setSelectionRange(mapped.start, mapped.end, direction);
|
||||
editor.scrollTop = scrollTop;
|
||||
editor.scrollTop = initialLoad ? 0 : scrollTop;
|
||||
editor.scrollLeft = scrollLeft;
|
||||
applyingRemote = false;
|
||||
if (resetHistory) editHistory.reset();
|
||||
else editHistory.syncCurrent();
|
||||
render();
|
||||
editor.scrollTop = scrollTop;
|
||||
editor.scrollTop = initialLoad ? 0 : scrollTop;
|
||||
editor.scrollLeft = scrollLeft;
|
||||
syncEditorLayers();
|
||||
restorePreviewEdit(previewSnapshot);
|
||||
|
||||
Reference in New Issue
Block a user