@fresh-editor/fresh-editor 0.1.21 → 0.1.26

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 ADDED
@@ -0,0 +1,334 @@
1
+ # Release Notes
2
+
3
+ ## 0.1.25 - Unreleased
4
+
5
+ ### Features
6
+
7
+ * **GPM Mouse Support**: Added mouse support in Linux virtual consoles (TTY) via the GPM daemon (#231). Uses dlopen to load libgpm.so at runtime, so the binary works on systems without GPM installed. Gracefully falls back to standard terminal mouse protocol when GPM is unavailable.
8
+
9
+ * **Configurable Highlight Context**: Syntax highlighting lookback/lookforward is now configurable via `highlight_context_bytes` in config (default increased from 1KB to 10KB). Fixes inaccurate highlighting when viewing the middle of files with long multi-line constructs.
10
+
11
+ ### Bug Fixes
12
+
13
+ * **Mouse Wheel After Keyboard**: Fixed mouse wheel scroll not working in main editor after keyboard navigation (#248).
14
+
15
+ ### Internal
16
+
17
+ * **Reduced Logging**: Reduced verbose debug logging in default config.
18
+
19
+ * **Signal Handling**: Removed ctrlc dependency, use nix sigaction directly.
20
+
21
+ * **Test Reliability**: Fixed flaky auto-revert tests on macOS (FSEvents latency) and filesystems with 1-second mtime granularity.
22
+
23
+ * **Dependency Updates**: Reduced and updated dependencies.
24
+
25
+ ---
26
+
27
+ ## 0.1.24
28
+
29
+ ### Bug Fixes
30
+
31
+ * **Windows Build**: Fixed Windows build compatibility.
32
+
33
+ ---
34
+
35
+ ## 0.1.23
36
+
37
+ ### Bug Fixes
38
+
39
+ * **Split Close Tab Preservation**: Fixed tabs not being preserved when closing a split.
40
+
41
+ ### Performance
42
+
43
+ * **Diff Optimization**: Optimized diff_since_saved with two-phase algorithm.
44
+
45
+ ---
46
+
47
+ ## 0.1.22
48
+
49
+ ### Features
50
+
51
+ * **CLI file:line:col**: Support `file:line:col` format on CLI command (#217).
52
+
53
+ * **LSP Error Logging**: LSP stderr is now piped to a file and opened as read-only buffer on error.
54
+
55
+ * **Config Languages**: Use config languages section for LSP language detection.
56
+
57
+ ### Bug Fixes
58
+
59
+ * **TypeScript Highlighting**: Fixed TypeScript syntax highlighting by falling back to tree-sitter.
60
+
61
+ * **Plugin Race Condition**: Fixed race condition in plugin hooks reading stale state snapshot.
62
+
63
+ * **Long Path Truncation**: Truncate long paths in Open File prompt with styled [...].
64
+
65
+ * **Graceful Shutdown**: Prevent spurious LspError on graceful shutdown.
66
+
67
+ ### Internal
68
+
69
+ * **Syntect for Highlighting**: Use syntect for syntax highlighting, retain tree-sitter for other features (#237).
70
+
71
+ ---
72
+
73
+ ## 0.1.21
74
+
75
+ ### Packaging
76
+
77
+ * **AUR Package**: Added AUR package automation and installation instructions.
78
+
79
+ * **npm and crates.io**: Added automated npm and crates.io publishing.
80
+
81
+ ---
82
+
83
+ ## 0.1.20
84
+
85
+ ### Features
86
+
87
+ * **Theme Editor Plugin**: New interactive theme editor for customizing colors. Allows editing all theme color values with a visual interface.
88
+
89
+ * **Drag-to-Select Mouse Support**: Click and drag to select text, similar to graphical editors.
90
+
91
+ * **Homebrew Distribution**: Preliminary setup for Homebrew distribution on macOS.
92
+
93
+ ### Bug Fixes
94
+
95
+ * **File Open Dialog**: Fixed handling of pasted paths in the file open dialog. Previously pasting a full path would fail; now it correctly opens the file or navigates to the directory.
96
+
97
+ * **Mouse Click on Wrapped Lines**: Fixed mouse click positioning not working correctly on wrapped lines and empty lines.
98
+
99
+ ### Packaging
100
+
101
+ * **Linux Packages**: `.deb` and `.rpm` packages are now available for Debian/Ubuntu and Fedora/RHEL distributions respectively.
102
+
103
+ * **Homepage**: Set official homepage to https://sinelaw.github.io/fresh/
104
+
105
+ ---
106
+
107
+ ## 0.1.19
108
+
109
+ ### Packaging
110
+
111
+ * **Linux packages fix**: Fixed `.deb` and `.rpm` packages not being included in GitHub releases.
112
+
113
+ ---
114
+
115
+ ## 0.1.18
116
+
117
+ ### Features
118
+
119
+ * **Auto-load user config**: Startup now loads the default config file (e.g. `~/.config/fresh/config.json`) so themes and preferences persist without needing `--config`.
120
+ * **Clearer confirmation prompts**: Destructive prompts now use action verbs (revert, overwrite, discard) instead of generic y/n, reducing misclicks.
121
+
122
+ ### Bug Fixes
123
+
124
+ * **UTF-8 safe deletion**: Backspace/Delete operate on full Unicode characters (emojis, accented letters, currency symbols) instead of raw bytes.
125
+
126
+ ### Packaging
127
+
128
+ * **Deb/RPM artifacts**: Release workflow now builds stripped `.deb` and `.rpm` packages for x86_64 and aarch64, with matrixed install/uninstall tests across Ubuntu 22.04/24.04, Debian 12, Fedora 39/40, and Rocky Linux 9.
129
+
130
+ ---
131
+
132
+ ## 0.1.15 - Unreleased
133
+
134
+ ### Features
135
+
136
+ * **TextMate Grammar Support**: Syntax highlighting now uses TextMate grammars via syntect for languages without tree-sitter support. Includes proper highlighting for Markdown (headings, bold, italic, code, links, quotes, lists).
137
+
138
+ * **Fuzzy Matching**: Command palette and file browser now use fzf-style fuzzy matching. Matches are highlighted and scored by consecutive characters, word boundaries, and match position.
139
+
140
+ * **Tab Navigation Commands**: New commands "Go to Next Tab" and "Go to Previous Tab" in the command palette for keyboard-driven tab switching.
141
+
142
+ * **File Recovery**: Emacs-style auto-recovery for unsaved changes. Buffers are automatically saved every 2 seconds to `~/.local/share/fresh/recovery/`. On startup, automatically recovers unsaved changes from crashed sessions. Uses chunked storage for large files to avoid memory issues.
143
+
144
+ * **Explorer Menu**: New menu bar entry with file explorer actions (New File, New Folder, Rename, Delete) and keybindings. Disabled items shown in theme colors when not applicable.
145
+
146
+ * **File Explorer Rename**: Press F2 or use Explorer menu to rename files/folders. Project root is protected from renaming.
147
+
148
+ * **Emacs-Style Readline Bindings**: Added terminal key equivalents for common operations:
149
+ - Ctrl+A: Home (beginning of line)
150
+ - Ctrl+E: End (end of line)
151
+ - Ctrl+K: Kill to end of line
152
+ - Ctrl+U: Kill to beginning of line
153
+ - Ctrl+W: Kill word backward
154
+ - Alt+D: Kill word forward
155
+ - Ctrl+Y: Yank (paste from kill ring)
156
+
157
+ ### Bug Fixes
158
+
159
+ * **Multi-Cursor Selection**: Fixed Ctrl+D selection replacement not working correctly (issue #210).
160
+
161
+ * **LSP Auto-Restart**: Fixed stopped LSP server incorrectly auto-restarting on edit.
162
+
163
+ * **File Explorer Selection**: Fixed selection being lost after rename completes.
164
+
165
+ * **Markdown Highlighting**: Fixed markdown files not getting syntax highlighting for headers, bold, italic, links, etc.
166
+
167
+ ### Performance
168
+
169
+ * **Recovery Write Performance**: Removed sync_all from recovery writes, reducing disk I/O overhead.
170
+
171
+ * **Large File Recovery**: Chunked recovery format applies edits directly without loading entire file into memory.
172
+
173
+ ---
174
+
175
+ ## 0.1.14
176
+
177
+ See git history for changes.
178
+
179
+ ---
180
+
181
+ ## 0.1.13
182
+
183
+ ### Features
184
+
185
+ * **Git Gutter Plugin**: Shows git diff indicators in the gutter for lines changed vs HEAD:
186
+ - │ (green): Added line
187
+ - │ (yellow): Modified line
188
+ - ▾ (red): Deleted line(s) below
189
+
190
+ * **Buffer Modified Plugin**: Shows unsaved changes with │ (blue) indicators for lines modified since last save.
191
+
192
+ * **Line Indicator System**: New plugin API for gutter indicators with automatic position tracking. Indicators use byte-position markers that shift automatically when text is inserted/deleted. Priority system allows multiple indicator types to coexist (diagnostics > git > buffer modified).
193
+
194
+ * **LCS-Based Line Diff**: Buffer modified indicators now use the classic LCS (Longest Common Subsequence) algorithm - the foundation of Unix diff - for accurate change detection. Correctly handles insertions without marking shifted lines as changed, and detects deletion points.
195
+
196
+ * **Content-Based Diff**: Diff comparison now uses actual byte content rather than piece tree structure. This means if you delete text and paste it back, the indicator correctly clears because the content matches the saved state.
197
+
198
+ ### Bug Fixes
199
+
200
+ * **Save As Undo History**: Fixed undo history being cleared after Save As due to auto-revert triggered by file watcher detecting the newly created file. Uses optimistic concurrency with mtime comparison to avoid spurious reverts.
201
+
202
+ * **Save As Dirty State**: Fixed undo dirty state not being tracked correctly after Save As on unnamed buffers (issue #191).
203
+
204
+ ### Performance
205
+
206
+ * **Large File Mode**: Diffing is now disabled in large file mode for performance. Uses the simpler is_modified() flag instead of expensive diff calculations for files with >10MB or unknown line counts.
207
+
208
+ ---
209
+
210
+ ## 0.1.12
211
+
212
+ ### Features
213
+
214
+ * **Live Grep Plugin**: Project-wide search with ripgrep integration and live preview. Search results update as you type (minimum 2 characters), with a split pane showing file context and syntax highlighting. Press Enter to open file at location, ESC to close preview.
215
+
216
+ * **Calculator Plugin**: Scientific calculator with clickable buttons and keyboard input. Supports parentheses, exponents (^), sqrt, ln, log, trig functions, pi, and e. Mouse click/hover support, copy button for results, and ANSI-colored UI with Unicode box drawing. ESC to close, DEL to clear.
217
+
218
+ * **File Explorer Improvements**:
219
+ - Shows file sizes (KB/MB/GB) and directory entry counts
220
+ - Close button (×) in title bar to hide explorer
221
+ - Left arrow on file/collapsed directory selects parent
222
+ - Keybinding changed from Ctrl+B to Ctrl+E (avoids tmux conflict)
223
+
224
+ * **Split View Close Buttons**: Split views now show a × button on the right side of the tab row (only when multiple splits exist) for easy closing.
225
+
226
+ * **Close Last Buffer**: Closing the last buffer now creates a fresh anonymous buffer instead of blocking with "Cannot close last buffer".
227
+
228
+ * **Alt+W Keybinding**: New shortcut to close the current tab.
229
+
230
+ * **Command Palette Source Column**: Shows where each command comes from - "builtin" or the plugin filename - in a right-aligned column.
231
+
232
+ * **Relative Buffer Names**: Buffer display names are now shown relative to the working directory.
233
+
234
+ ### Bug Fixes
235
+
236
+ * **File Explorer Toggle**: Fixed Ctrl+B/Ctrl+E toggle not working correctly - now properly opens/closes instead of just focusing.
237
+
238
+ * **Session Restore**: Fixed file explorer not initializing when restoring a session with explorer visible.
239
+
240
+ * **Open File Popup**: Hide status bar when file browser popup is shown; improved high-contrast theme colors (cyan instead of yellow).
241
+
242
+ ---
243
+
244
+ ## 0.1.11
245
+
246
+ See git history for changes.
247
+
248
+ ---
249
+
250
+ ## 0.1.10
251
+
252
+ ### Features
253
+
254
+ * **Session Persistence**: Automatically saves per-project state (open files, tabs, split layout, cursor/scroll positions, file explorer state, search/replace history and options, bookmarks) to the XDG data dir and restores it on launch. Session restore is skipped when opening a specific file; use `--no-session` to start fresh.
255
+
256
+ * **Unified Search & Replace**: Replace (Ctrl+H) and Query Replace (Ctrl+Shift+H) now share the same interface with a "Confirm each" toggle (Alt+E). Query Replace enables confirmation by default; Replace uses the toggle state. Confirmation prompt shows `(y)es (n)o (a)ll (c)ancel` options.
257
+
258
+ ### Bug Fixes
259
+
260
+ * **Session Restore Reliability**: Fixed session rehydration to reopen files/splits with the correct active buffer, cursor, and scroll position (including nested splits) instead of jumping back to the top on first render.
261
+
262
+ * **macOS Build**: Fixed Linux-specific `.init_array` by using cross-platform V8 initialization.
263
+
264
+ * **Syntax Highlighting**: Fixed invisible/hard-to-read highlighting in light and nostalgia themes by using theme-based color resolution instead of hardcoded colors.
265
+
266
+ * **Theme Colors**: Improved status bar and prompt colors across all themes (dark, high-contrast, light, nostalgia).
267
+
268
+ * **Search Prompt**: Search/replace prompts now cancel when focus leaves the editor (switching buffers or focusing file explorer).
269
+
270
+ ---
271
+
272
+ ## 0.1.9
273
+
274
+ ### Features
275
+
276
+ * **Native File Browser**: New built-in file browser for Open File command (Ctrl+O) that works without plugins. Features sortable columns (name, size, modified), navigation shortcuts (parent, home, root), filtering with grayed non-matches, mouse support with hover indicators, and async directory loading.
277
+
278
+ * **CRLF Line Ending Support**: Transparent handling of Windows-style line endings. Files are detected and normalized internally, then saved with their original line ending format preserved.
279
+
280
+ * **CLI Enhancements**: Added `--version`, `--no-plugins` (skip JS runtime for faster startup), `--log-file`, and `--config` flags.
281
+
282
+ * **UI Improvements**:
283
+ - Tab hover effects with close button changing to red on hover
284
+ - Menu hover-to-switch when a menu is open
285
+ - Buffer name shown in modified buffer confirmation prompts
286
+ - Fixed column widths in command palette for stable layout
287
+
288
+ ### Bug Fixes
289
+
290
+ * **V8 Segfault**: Fixed crash when creating multiple Editor instances (e.g., in tests) by initializing V8 platform once at library load.
291
+
292
+ * **Windows**: Fixed duplicate key presses caused by processing both Press and Release events.
293
+
294
+ ---
295
+
296
+ ## 0.1.8
297
+
298
+ ### Bug Fixes
299
+
300
+ * **Open File Prompt**: Fixed completions not showing immediately (issue #193) by enabling ICU support for Unicode functions.
301
+
302
+ * **Keyboard Shortcuts Help**: Fixed crash when reopening keyboard shortcuts buffer (issue #192).
303
+
304
+ * **Undo Save Points**: Fixed extra undo step at beginning of save history (issue #191).
305
+
306
+ * **Scroll Keybindings**: Fixed Ctrl+Up/Down scroll not working by syncing viewport between SplitViewState and EditorState.
307
+
308
+ ---
309
+
310
+ ## 0.1.7
311
+
312
+ ### Features
313
+
314
+ * **Select Theme Command**: New theme picker accessible from the command palette and View menu. Includes a new "nostalgia" theme inspired by Turbo Pascal 5 / WordPerfect 5.
315
+
316
+ * **Compose Mode Improvements**: Paper-on-desk visual effect with desk margin colors, and hanging indent support for markdown lists and blockquotes.
317
+
318
+ * **Binary File Detection**: Binary files are now detected and opened in read-only mode to prevent accidental corruption.
319
+
320
+ ### Bug Fixes
321
+
322
+ * **Light Theme**: Fixed colors for status bar, prompt, scrollbar, tabs, and file explorer to use proper light theme colors.
323
+
324
+ * **Mouse Performance**: Fixed slow mouse movement on large terminals by skipping redundant renders when hover target hasn't changed. Added mouse event coalescing to skip stale positions.
325
+
326
+ * **UTF-8 Truncation**: Fixed panic when truncating suggestion descriptions mid-character.
327
+
328
+ ### Internal Changes
329
+
330
+ * **Code Refactoring**: Major cleanup extracting helpers and reducing duplication across many modules including `process_async_messages`, `handle_plugin_command`, `render_view_lines`, `multi_cursor`, `highlight_color`, and more. Consolidated duplicate `hook_args_to_json` implementations.
331
+
332
+ * **Test Improvements**: Fixed flaky tests by removing timing assertions, made shortcut tests platform-aware for macOS.
333
+
334
+ * **Documentation**: Reorganized internal planning docs, updated plugin README from Lua to TypeScript, and added embedded help manual using `include_str!()`.
@@ -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.26"
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.26"
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.26",
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.26",
97
97
  "volta": {
98
98
  "node": "18.14.1",
99
99
  "npm": "9.5.0"
@@ -76,6 +76,10 @@
76
76
  "type": "integer",
77
77
  "description": "Estimated average line length in bytes (used for large file line estimation)\nThis is used by LineIterator to estimate line positions in large files\nwithout line metadata. Typical values: 80-120 bytes."
78
78
  },
79
+ "highlight_context_bytes": {
80
+ "type": "integer",
81
+ "description": "Number of bytes to look back/forward from the viewport for syntax highlighting context.\nLarger values improve accuracy for multi-line constructs (strings, comments, nested blocks)\nbut may slow down highlighting for very large files.\nDefault: 10KB (10000 bytes)"
82
+ },
79
83
  "highlight_timeout_ms": {
80
84
  "type": "integer",
81
85
  "description": "Maximum time in milliseconds for syntax highlighting per frame"
@@ -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