@fresh-editor/fresh-editor 0.1.58 → 0.1.63
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 +84 -0
- package/README.md +22 -0
- package/binary-install.js +26 -2
- package/package.json +2 -1
- package/plugins/config-schema.json +100 -666
- package/plugins/git_grep.ts +2 -1
- package/plugins/lib/fresh.d.ts +39 -13
- package/plugins/live_grep.ts +88 -10
- package/plugins/search_replace.ts +2 -1
- package/themes/dracula.json +62 -0
- package/themes/nord.json +62 -0
- package/themes/solarized-dark.json +62 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## 0.1.63
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **Shell Command Prompt**: Pipe buffer or selection through shell commands (Alt+|).
|
|
8
|
+
|
|
9
|
+
* **On-Save Actions**: Run formatters/linters on save. Default formatters included for Rust (rustfmt), JavaScript/TypeScript (prettier), Python (ruff), C/C++ (clang-format), Go (gofmt).
|
|
10
|
+
|
|
11
|
+
* **Stdin Input**: Pipe content via stdin with background streaming (`echo "hello" | fresh -`).
|
|
12
|
+
|
|
13
|
+
* **Multi-File CLI**: Open multiple files from command line (#389).
|
|
14
|
+
|
|
15
|
+
* **Tab Indent Selection**: Tab indents selected lines, Shift+Tab dedents (#353).
|
|
16
|
+
|
|
17
|
+
* **Toggle Menu Bar**: Hide/show menu bar via command palette for extra screen space.
|
|
18
|
+
|
|
19
|
+
* **Global File Positions**: Cursor/scroll positions stored globally per file, not per project (#423).
|
|
20
|
+
|
|
21
|
+
* **Relative Line Numbers**: Show relative distances from cursor in gutter for easier vim-style navigation. Enable via `relative_line_numbers` config (#454).
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **On-Save Missing Tools**: Graceful handling when formatter/linter command not found.
|
|
26
|
+
|
|
27
|
+
* **Settings UI Nested Dialogs**: Fixed nested ObjectArray navigation and save not persisting (e.g., editing on_save inside language config).
|
|
28
|
+
|
|
29
|
+
* **Live Grep Working Directory**: Fixed search plugins using process cwd instead of project working directory.
|
|
30
|
+
|
|
31
|
+
* **Open File Path Resolution**: Fixed relative paths resolving incorrectly when editor launched from different directory.
|
|
32
|
+
|
|
33
|
+
### Performance
|
|
34
|
+
|
|
35
|
+
* **Live Grep UI**: Fixed UI freezing for seconds during large codebase searches by making plugin event loop non-blocking.
|
|
36
|
+
|
|
37
|
+
### Internal
|
|
38
|
+
|
|
39
|
+
* Embedded plugins in binary as fallback for cargo-binstall (#416).
|
|
40
|
+
|
|
41
|
+
* Removed duplicate theme JSON files (#438).
|
|
42
|
+
|
|
43
|
+
* Extracted modules from mod.rs (file_operations, split_actions, clipboard, etc.).
|
|
44
|
+
|
|
45
|
+
* Pinned Rust 1.92 via rust-toolchain.toml (#338).
|
|
46
|
+
|
|
47
|
+
* Windows build switched from MSVC to GNU target.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 0.1.59
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* **Copy with Formatting**: Copy selected text as HTML with syntax highlighting. Works in Google Docs, Word, etc. Available via Edit menu submenu or command palette.
|
|
56
|
+
|
|
57
|
+
* **Pascal Language Support**: Auto-indentation and semantic highlighting for `.pas` and `.p` files (@casibbald).
|
|
58
|
+
|
|
59
|
+
* **Set Line Ending Command**: Change buffer line ending format (LF/CRLF/CR) via command palette.
|
|
60
|
+
|
|
61
|
+
* **Buffer Settings Commands**: Toggle auto_indent, use_tabs, and tab_size via command palette.
|
|
62
|
+
|
|
63
|
+
* **Settings UI**: Recursive dialog stack for nested arrays/maps, focus indicators, Ctrl+S to save, select-all on number input edit.
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
* **Tab Size Config**: Fixed tab_size config not being respected (#384).
|
|
68
|
+
|
|
69
|
+
* **Windows Multi-Line Paste**: Fixed CRLF paste appearing as single line (#427).
|
|
70
|
+
|
|
71
|
+
* **CRLF Highlighting**: Fixed syntax highlighting offset drift in CRLF files.
|
|
72
|
+
|
|
73
|
+
* **CRLF Cursor**: Fixed cursor invisible at end of line in CRLF mode.
|
|
74
|
+
|
|
75
|
+
* **Menu Navigation**: Keyboard navigation now skips disabled items.
|
|
76
|
+
|
|
77
|
+
* **Cut/Copy Disabled**: Menu items grayed out when no selection.
|
|
78
|
+
|
|
79
|
+
### Internal
|
|
80
|
+
|
|
81
|
+
* Extracted CRLF helpers, consolidated TextMateHighlighter into TextMateEngine.
|
|
82
|
+
|
|
83
|
+
* Updated insta (1.45.0), deno_core (0.376.0).
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
3
87
|
## 0.1.57
|
|
4
88
|
|
|
5
89
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ A terminal-based text editor. [Official Website →](https://sinelaw.github.io/f
|
|
|
4
4
|
|
|
5
5
|
**[📦 Installation Instructions](#installation)**
|
|
6
6
|
|
|
7
|
+
**[Contributing](#contributing)**
|
|
8
|
+
|
|
7
9
|
## Why?
|
|
8
10
|
|
|
9
11
|
Why another text editor? Fresh brings the intuitive, conventional UX of editors like VS Code and Sublime Text to the terminal.
|
|
@@ -217,6 +219,26 @@ cargo build --release
|
|
|
217
219
|
- [Plugin Development](docs/PLUGIN_DEVELOPMENT.md)
|
|
218
220
|
- [Architecture](docs/ARCHITECTURE.md)
|
|
219
221
|
|
|
222
|
+
## Contributing
|
|
223
|
+
|
|
224
|
+
Thanks for contributing!
|
|
225
|
+
|
|
226
|
+
1. **Reproduce Before Fixing**: Always include a test case that reproduces the bug (fails) without the fix, and passes with the fix. This ensures the issue is verified and prevents future regressions.
|
|
227
|
+
|
|
228
|
+
2. **E2E Tests for New Flows**: Any new user flow or feature must include an end-to-end (e2e) test. E2E tests send keyboard/mouse events and examines the final rendered output, do not examine internal state.
|
|
229
|
+
|
|
230
|
+
3. **No timeouts or time-sensitive tests**: Use "semantic waiting" (waiting for specific state changes/events) instead of fixed timers to ensure test stability. Wait indefinitely, don't put timeouts inside tests (cargo nextest will timeout externally).
|
|
231
|
+
|
|
232
|
+
4. **Test isolation**: Tests should run in parallel. Use the internal clipboard mode in tests to isolate them from the host system and prevent flakiness in CI. Same for other external resources (temp files, etc. should all be isolated between tests, under a per-test temporary workdir).
|
|
233
|
+
|
|
234
|
+
5. **Required Formatting**: All code must be formatted with `cargo fmt` before submission. PRs that fail formatting checks will not be merged.
|
|
235
|
+
|
|
236
|
+
6. **Cross-Platform Consistency**: Avoid hard-coding newline or CRLF related logic, consider the buffer mode.
|
|
237
|
+
|
|
238
|
+
7. **LSP**: Ensure LSP interactions follow the correct lifecycle (e.g., `didOpen` must always precede other requests to avoid server-side errors). Use the appropriate existing helpers for this pattern.
|
|
239
|
+
|
|
240
|
+
**Tip**: You can use tmux + send-keys + render-pane to script ad-hoc tests on the UI, for example when trying to reproduce an issue.
|
|
241
|
+
|
|
220
242
|
## License
|
|
221
243
|
|
|
222
244
|
Copyright (c) Noam Lewis
|
package/binary-install.js
CHANGED
|
@@ -10,18 +10,28 @@ const REPO = 'sinelaw/fresh';
|
|
|
10
10
|
function download(url, dest) {
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
12
12
|
const file = fs.createWriteStream(dest);
|
|
13
|
+
file.on('error', (err) => {
|
|
14
|
+
file.close();
|
|
15
|
+
reject(err);
|
|
16
|
+
});
|
|
13
17
|
https.get(url, (response) => {
|
|
14
18
|
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
15
|
-
|
|
19
|
+
file.close(() => {
|
|
20
|
+
download(response.headers.location, dest).then(resolve).catch(reject);
|
|
21
|
+
});
|
|
16
22
|
return;
|
|
17
23
|
}
|
|
18
24
|
if (response.statusCode !== 200) {
|
|
25
|
+
file.close();
|
|
19
26
|
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
20
27
|
return;
|
|
21
28
|
}
|
|
22
29
|
response.pipe(file);
|
|
23
30
|
file.on('finish', () => { file.close(); resolve(); });
|
|
24
|
-
}).on('error',
|
|
31
|
+
}).on('error', (err) => {
|
|
32
|
+
file.close();
|
|
33
|
+
reject(err);
|
|
34
|
+
});
|
|
25
35
|
});
|
|
26
36
|
}
|
|
27
37
|
|
|
@@ -31,10 +41,18 @@ async function install() {
|
|
|
31
41
|
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${archiveName}`;
|
|
32
42
|
const archivePath = path.join(__dirname, archiveName);
|
|
33
43
|
const binDir = path.join(__dirname, 'bin');
|
|
44
|
+
const binaryPath = path.join(binDir, info.binaryName);
|
|
34
45
|
|
|
35
46
|
console.log(`Downloading ${url}...`);
|
|
36
47
|
await download(url, archivePath);
|
|
37
48
|
|
|
49
|
+
// Verify download succeeded
|
|
50
|
+
const stats = fs.statSync(archivePath);
|
|
51
|
+
if (stats.size === 0) {
|
|
52
|
+
throw new Error(`Downloaded file is empty: ${archivePath}`);
|
|
53
|
+
}
|
|
54
|
+
console.log(`Downloaded ${stats.size} bytes`);
|
|
55
|
+
|
|
38
56
|
fs.mkdirSync(binDir, { recursive: true });
|
|
39
57
|
|
|
40
58
|
if (info.ext === 'tar.xz') {
|
|
@@ -56,6 +74,12 @@ async function install() {
|
|
|
56
74
|
}
|
|
57
75
|
|
|
58
76
|
fs.unlinkSync(archivePath);
|
|
77
|
+
|
|
78
|
+
// Verify binary exists
|
|
79
|
+
if (!fs.existsSync(binaryPath)) {
|
|
80
|
+
throw new Error(`Installation failed: binary not found at ${binaryPath}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
59
83
|
console.log('fresh-editor installed successfully!');
|
|
60
84
|
}
|
|
61
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fresh-editor/fresh-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.63",
|
|
4
4
|
"description": "A modern terminal-based text editor with plugin support",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"install.js",
|
|
20
20
|
"run-fresh.js",
|
|
21
21
|
"plugins/**/*",
|
|
22
|
+
"themes/**/*",
|
|
22
23
|
"README.md",
|
|
23
24
|
"LICENSE",
|
|
24
25
|
"CHANGELOG.md"
|