@bobfrankston/rmfmail 1.2.256 → 1.2.257

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3327,17 +3327,15 @@ async function createTinyMceEditor(container2, opts = {}) {
3327
3327
  function openSourceDialog(editor2) {
3328
3328
  const SENTINEL = "\uE000";
3329
3329
  let offset = -1;
3330
- let savedRng = null;
3330
+ let bookmark = null;
3331
3331
  try {
3332
3332
  const sel = editor2.selection;
3333
+ bookmark = sel.getBookmark(2, true);
3333
3334
  const rng = sel.getRng();
3334
- if (rng) {
3335
- savedRng = rng.cloneRange();
3336
- if (!rng.collapsed) {
3337
- const collapsed = rng.cloneRange();
3338
- collapsed.collapse(true);
3339
- sel.setRng(collapsed);
3340
- }
3335
+ if (rng && !rng.collapsed) {
3336
+ const collapsed = rng.cloneRange();
3337
+ collapsed.collapse(true);
3338
+ sel.setRng(collapsed);
3341
3339
  }
3342
3340
  const insert = () => editor2.selection.setContent(SENTINEL);
3343
3341
  if (typeof editor2.undoManager?.ignore === "function")
@@ -3359,9 +3357,9 @@ function openSourceDialog(editor2) {
3359
3357
  }
3360
3358
  } catch {
3361
3359
  }
3362
- if (savedRng) {
3360
+ if (bookmark) {
3363
3361
  try {
3364
- editor2.selection.setRng(savedRng);
3362
+ editor2.selection.moveToBookmark(bookmark);
3365
3363
  } catch {
3366
3364
  }
3367
3365
  }