@fresh-editor/fresh-editor 0.1.21 → 0.1.24

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.
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "GPL-2.0",
25
25
  "name": "@fresh-editor/fresh-editor",
26
- "version": "0.1.21"
26
+ "version": "0.1.24"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -896,5 +896,5 @@
896
896
  }
897
897
  },
898
898
  "requires": true,
899
- "version": "0.1.21"
899
+ "version": "0.1.24"
900
900
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/sinelaw/fresh/releases/download/v0.1.21",
2
+ "artifactDownloadUrl": "https://github.com/sinelaw/fresh/releases/download/v0.1.24",
3
3
  "author": "Noam Lewis",
4
4
  "bin": {
5
5
  "fresh": "run-fresh.js"
@@ -93,7 +93,7 @@
93
93
  "zipExt": ".tar.xz"
94
94
  }
95
95
  },
96
- "version": "0.1.21",
96
+ "version": "0.1.24",
97
97
  "volta": {
98
98
  "node": "18.14.1",
99
99
  "npm": "9.5.0"
@@ -1448,24 +1448,21 @@ globalThis.open_config_editor = async function(): Promise<void> {
1448
1448
  const entries = buildDisplayEntries();
1449
1449
  state.cachedContent = entries.map(e => e.text).join("");
1450
1450
 
1451
- // Create virtual buffer
1452
- const result = await editor.createVirtualBufferInSplit({
1451
+ // Create virtual buffer in the current split as a new tab
1452
+ const bufferId = await editor.createVirtualBuffer({
1453
1453
  name: "*Config Editor*",
1454
1454
  mode: "config-editor",
1455
1455
  read_only: true,
1456
1456
  entries: entries,
1457
- ratio: 0.6,
1458
- direction: "vertical",
1459
- panel_id: "config-editor",
1460
1457
  show_line_numbers: false,
1461
1458
  show_cursors: true,
1462
1459
  editing_disabled: true,
1463
1460
  });
1464
1461
 
1465
- if (result.buffer_id !== null) {
1462
+ if (bufferId !== null) {
1466
1463
  state.isOpen = true;
1467
- state.bufferId = result.buffer_id;
1468
- state.splitId = result.split_id ?? null;
1464
+ state.bufferId = bufferId;
1465
+ state.splitId = state.sourceSplitId; // We're using the same split
1469
1466
 
1470
1467
  // Activate the config-editor context to enable context-specific commands
1471
1468
  editor.setContext("config-editor", true);
@@ -1492,14 +1489,9 @@ globalThis.config_editor_close = function(): void {
1492
1489
  // Deactivate the config-editor context to hide context-specific commands
1493
1490
  editor.setContext("config-editor", false);
1494
1491
 
1495
- // Close split
1496
- if (state.splitId !== null) {
1497
- editor.closeSplit(state.splitId);
1498
- }
1499
-
1500
- // Focus source
1501
- if (state.sourceSplitId !== null) {
1502
- editor.focusSplit(state.sourceSplitId);
1492
+ // Close the config editor buffer (will auto-switch to previous buffer in split)
1493
+ if (state.bufferId !== null) {
1494
+ editor.closeBuffer(state.bufferId);
1503
1495
  }
1504
1496
 
1505
1497
  // Reset state