cursor focus
This commit is contained in:
Generated
+1
-1
@@ -2581,7 +2581,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustpad"
|
||||
version = "0.2.44"
|
||||
version = "0.2.45"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"aws-config",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rustpad"
|
||||
version = "0.2.44"
|
||||
version = "0.2.45"
|
||||
edition = "2024"
|
||||
rust-version = "1.94"
|
||||
description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL"
|
||||
|
||||
@@ -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