@fresh-editor/fresh-editor 0.2.11 → 0.2.12
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.
- package/CHANGELOG.md +29 -0
- package/package.json +1 -1
- package/plugins/config-schema.json +30 -0
- package/plugins/lib/fresh.d.ts +2 -2
- package/plugins/markdown_source.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## 0.2.12
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **Auto-Close Config**: Separate `auto_close` toggle (default: true) to independently control bracket/quote auto-close, skip-over, and pair deletion — previously coupled to `auto_indent`. Per-language overrides via `languages.<lang>.auto_close` (#1144).
|
|
8
|
+
|
|
9
|
+
* **Surround Selection**: Typing an opening delimiter with a selection wraps it instead of replacing it (e.g. selecting `hello` and typing `(` produces `(hello)`). Controlled by `auto_surround` config with per-language overrides.
|
|
10
|
+
|
|
11
|
+
* **Smart Quote Suppression**: Quotes typed inside an existing string no longer auto-close, preventing unwanted doubled quotes (#1142).
|
|
12
|
+
|
|
13
|
+
* **Read-Only Mode**: Files without write permission and library/toolchain paths (rustup, /usr/include, /nix/store, Homebrew Cellar, .nuget, Xcode SDKs) automatically open as read-only. New "Toggle Read Only" command to override. Status bar shows `[RO]` indicator.
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **Multi-Cursor Enter**: Fixed Enter key in markdown mode only inserting a newline at the last cursor, ignoring secondary cursors. Falls back to built-in insert_newline when multiple cursors are active (#1140).
|
|
18
|
+
|
|
19
|
+
* **Multi-Cursor Position Drift**: Fixed cursors with no events during bulk edits (e.g. Delete at end of buffer) drifting to stale positions. Uses saturating arithmetic to prevent overflow with overlapping selections (#1140).
|
|
20
|
+
|
|
21
|
+
### Improvements
|
|
22
|
+
|
|
23
|
+
* **Log Noise Reduction**: Disabled span close events (~90% of log volume) by default and moved 12 high-frequency log sites to trace level. Typical log size reduced from ~266MB to ~5-10MB. Set `FRESH_LOG_SPANS=1` to re-enable (#1154).
|
|
24
|
+
|
|
25
|
+
### Internal
|
|
26
|
+
|
|
27
|
+
* Added multi-cursor shadow model property-based tests with random operation sequences across 2-3 cursors.
|
|
28
|
+
* Added e2e regression tests for multi-cursor Enter with auto_indent, Ctrl+D selection, tree-sitter, and markdown grammar.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
3
32
|
## 0.2.11
|
|
4
33
|
|
|
5
34
|
### Features
|
package/package.json
CHANGED
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
"whitespace_tabs_trailing": true,
|
|
51
51
|
"tab_size": 4,
|
|
52
52
|
"auto_indent": true,
|
|
53
|
+
"auto_close": true,
|
|
54
|
+
"auto_surround": true,
|
|
53
55
|
"scroll_offset": 3,
|
|
54
56
|
"default_line_ending": "lf",
|
|
55
57
|
"trim_trailing_whitespace_on_save": false,
|
|
@@ -342,6 +344,18 @@
|
|
|
342
344
|
"default": true,
|
|
343
345
|
"x-section": "Editing"
|
|
344
346
|
},
|
|
347
|
+
"auto_close": {
|
|
348
|
+
"description": "Automatically close brackets, parentheses, and quotes when typing.\nWhen enabled, typing an opening delimiter like `(`, `[`, `{`, `\"`, `'`, or `` ` ``\nwill automatically insert the matching closing delimiter.\nAlso enables skip-over (moving past existing closing delimiters) and\npair deletion (deleting both delimiters when backspacing between them).\nDefault: true",
|
|
349
|
+
"type": "boolean",
|
|
350
|
+
"default": true,
|
|
351
|
+
"x-section": "Editing"
|
|
352
|
+
},
|
|
353
|
+
"auto_surround": {
|
|
354
|
+
"description": "Automatically surround selected text with matching pairs when typing\nan opening delimiter. When enabled and text is selected, typing `(`, `[`,\n`{`, `\"`, `'`, or `` ` `` wraps the selection instead of replacing it.\nDefault: true",
|
|
355
|
+
"type": "boolean",
|
|
356
|
+
"default": true,
|
|
357
|
+
"x-section": "Editing"
|
|
358
|
+
},
|
|
345
359
|
"scroll_offset": {
|
|
346
360
|
"description": "Minimum lines to keep visible above/below cursor when scrolling",
|
|
347
361
|
"type": "integer",
|
|
@@ -802,6 +816,22 @@
|
|
|
802
816
|
"type": "boolean",
|
|
803
817
|
"default": true
|
|
804
818
|
},
|
|
819
|
+
"auto_close": {
|
|
820
|
+
"description": "Whether to auto-close brackets, parentheses, and quotes for this language.\nIf not specified (`null`), falls back to the global `editor.auto_close` setting.",
|
|
821
|
+
"type": [
|
|
822
|
+
"boolean",
|
|
823
|
+
"null"
|
|
824
|
+
],
|
|
825
|
+
"default": null
|
|
826
|
+
},
|
|
827
|
+
"auto_surround": {
|
|
828
|
+
"description": "Whether to auto-surround selected text with matching pairs for this language.\nIf not specified (`null`), falls back to the global `editor.auto_surround` setting.",
|
|
829
|
+
"type": [
|
|
830
|
+
"boolean",
|
|
831
|
+
"null"
|
|
832
|
+
],
|
|
833
|
+
"default": null
|
|
834
|
+
},
|
|
805
835
|
"highlighter": {
|
|
806
836
|
"description": "Preferred highlighter backend (auto, tree-sitter, or textmate)",
|
|
807
837
|
"$ref": "#/$defs/HighlighterPreference",
|
package/plugins/lib/fresh.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ type ViewportInfo = {
|
|
|
138
138
|
*/
|
|
139
139
|
topByte: number;
|
|
140
140
|
/**
|
|
141
|
-
* Line number of the first visible line (
|
|
141
|
+
* Line number of the first visible line (None when line index unavailable, e.g. large file before scan)
|
|
142
142
|
*/
|
|
143
143
|
topLine: number | null;
|
|
144
144
|
/**
|
|
@@ -1167,7 +1167,7 @@ interface EditorAPI {
|
|
|
1167
1167
|
*/
|
|
1168
1168
|
setLineIndicator(bufferId: number, line: number, namespace: string, symbol: string, r: number, g: number, b: number, priority: number): boolean;
|
|
1169
1169
|
/**
|
|
1170
|
-
* Batch set line indicators in the gutter
|
|
1170
|
+
* Batch set line indicators in the gutter
|
|
1171
1171
|
*/
|
|
1172
1172
|
setLineIndicators(bufferId: number, lines: number[], namespace: string, symbol: string, r: number, g: number, b: number, priority: number): boolean;
|
|
1173
1173
|
/**
|
|
@@ -155,6 +155,15 @@ globalThis.md_src_enter = async function (): Promise<void> {
|
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
// When multiple cursors are active, fall back to the built-in insert_newline
|
|
159
|
+
// action which correctly handles all cursors atomically. The markdown-specific
|
|
160
|
+
// list continuation logic below only operates on the primary cursor.
|
|
161
|
+
const allCursors = editor.getAllCursors();
|
|
162
|
+
if (allCursors.length > 1) {
|
|
163
|
+
editor.executeAction("insert_newline");
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
158
167
|
const cursorPos = editor.getCursorPosition();
|
|
159
168
|
|
|
160
169
|
// Read a window of text before the cursor to find the current line.
|