diff --git a/src-mdviewer/src/bridge.js b/src-mdviewer/src/bridge.js
index ee35477ca..dfd25b292 100644
--- a/src-mdviewer/src/bridge.js
+++ b/src-mdviewer/src/bridge.js
@@ -537,6 +537,15 @@ export function initBridge() {
// Cursor sync toggle
on("toggle:cursorSync", ({ enabled }) => {
+ // Clear any existing highlights when cursor sync is disabled
+ if (!enabled) {
+ const viewer = document.getElementById("viewer-content");
+ if (viewer) {
+ _removeCursorHighlight(viewer);
+ }
+ _lastHighlightSourceLine = null;
+ _lastHighlightTargetLine = null;
+ }
sendToParent("mdviewrCursorSyncToggle", { enabled });
});
diff --git a/src-mdviewer/src/components/editor.js b/src-mdviewer/src/components/editor.js
index ea7cb2260..e07f73b85 100644
--- a/src-mdviewer/src/components/editor.js
+++ b/src-mdviewer/src/components/editor.js
@@ -1566,7 +1566,7 @@ export function convertToMarkdown(contentEl) {
// Debounced content change emitter for bridge
let contentChangeTimer = null;
-const CONTENT_CHANGE_DEBOUNCE = 300;
+const CONTENT_CHANGE_DEBOUNCE = 50;
/**
* Re-compute data-source-line attributes on top-level block elements
diff --git a/src-mdviewer/src/components/embedded-toolbar.js b/src-mdviewer/src/components/embedded-toolbar.js
index 214dbfb99..aa3f01699 100644
--- a/src-mdviewer/src/components/embedded-toolbar.js
+++ b/src-mdviewer/src/components/embedded-toolbar.js
@@ -50,6 +50,12 @@ const THRESHOLD_BLOCKS = 640; // collapse block elements + image first
const THRESHOLD_LISTS = 590; // then lists
const THRESHOLD_TEXT = 590; // finally text formatting (all dropdowns collapsed)
+// window.print() from inside an iframe is a no-op in WKWebView (Safari on macOS),
+// which is what Tauri uses for the Mac desktop build. Hide the button there.
+const _isMacWebKit = /Mac/.test(navigator.platform)
+ && /AppleWebKit/.test(navigator.userAgent)
+ && !/Chrome|CriOS|Edg|Firefox|FxiOS/.test(navigator.userAgent);
+
const allIcons = { Bold, Italic, Strikethrough, Underline, Code, Link, List, ListOrdered,
ListChecks, Quote, Minus, Table, FileCode, ChevronDown, Type, MoreHorizontal, Pencil, BookOpen, Link2, Link2Off, Printer, Image: ImageIcon, Upload, Sun, Moon };
@@ -89,9 +95,9 @@ function renderReadMode() {
- `}
@@ -206,9 +212,9 @@ function renderEditMode(level) {
-
+ ${_isMacWebKit ? "" : `
-
+ `}
diff --git a/src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js b/src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js
index 78f90080b..e3fd3f808 100644
--- a/src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js
+++ b/src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js
@@ -55,7 +55,7 @@ define(function (require, exports, module) {
let _cursorUndoStack = [];
let _cursorRedoStack = [];
- const DEBOUNCE_TO_IFRAME_MS = 150;
+ const DEBOUNCE_TO_IFRAME_MS = 50;
const SCROLL_SYNC_DEBOUNCE_MS = 16;
const SELECTION_SYNC_DEBOUNCE_MS = 200;
@@ -131,6 +131,14 @@ define(function (require, exports, module) {
break;
case "mdviewrCursorSyncToggle":
_cursorSyncEnabled = !!data.enabled;
+ // Clear CM line highlight when cursor sync is disabled
+ if (!_cursorSyncEnabled) {
+ const cm = _getCM();
+ if (cm && _highlightLineHandle) {
+ cm.removeLineClass(_highlightLineHandle, "background", "cm-cursor-sync-highlight");
+ _highlightLineHandle = null;
+ }
+ }
break;
case "mdviewrThemeToggle":
sendThemeOverride(data.theme);
diff --git a/src/view/PanelView.js b/src/view/PanelView.js
index aeedd540e..f862e1a57 100644
--- a/src/view/PanelView.js
+++ b/src/view/PanelView.js
@@ -842,9 +842,10 @@ define(function (require, exports, module) {
_toggleMaximize();
});
- // Double-click on tab bar toggles maximize (exclude action buttons and add button)
+ // Double-click on empty tab bar area toggles maximize.
+ // Exclude tabs themselves, action buttons, and the add button.
_$tabBar.on("dblclick", function (e) {
- if ($(e.target).closest(".bottom-panel-tab-close-btn, .bottom-panel-hide-btn, .bottom-panel-maximize-btn, .bottom-panel-add-btn").length) {
+ if ($(e.target).closest(".bottom-panel-tab, .bottom-panel-tab-close-btn, .bottom-panel-hide-btn, .bottom-panel-maximize-btn, .bottom-panel-add-btn").length) {
return;
}
_toggleMaximize();