@fresh-editor/fresh-editor 0.3.4 → 0.3.6
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 +72 -0
- package/README.md +9 -2
- package/package.json +1 -1
- package/plugins/config-schema.json +7 -1
- package/plugins/dashboard.ts +16 -93
- package/plugins/git_grep.ts +3 -1
- package/plugins/git_log.ts +196 -224
- package/plugins/goto_with_selection.i18n.json +58 -0
- package/plugins/goto_with_selection.ts +17 -0
- package/plugins/lib/finder.ts +27 -6
- package/plugins/lib/fresh.d.ts +620 -14
- package/plugins/lib/index.ts +34 -0
- package/plugins/lib/widgets.ts +796 -0
- package/plugins/live_diff.ts +324 -29
- package/plugins/live_grep.ts +114 -48
- package/plugins/orchestrator.ts +1685 -0
- package/plugins/pkg.ts +234 -53
- package/plugins/rust-lsp.ts +58 -40
- package/plugins/schemas/theme.schema.json +4 -0
- package/plugins/search_replace.ts +780 -517
- package/plugins/theme_editor.i18n.json +84 -0
- package/plugins/theme_editor.ts +30 -5
- package/plugins/tsconfig.json +2 -0
- package/plugins/vi_mode.ts +38 -17
- package/themes/terminal.json +3 -0
package/plugins/lib/finder.ts
CHANGED
|
@@ -346,7 +346,8 @@ export function parseGrepLine(line: string): {
|
|
|
346
346
|
*/
|
|
347
347
|
export function parseGrepOutput(
|
|
348
348
|
stdout: string,
|
|
349
|
-
maxResults: number = 100
|
|
349
|
+
maxResults: number = 100,
|
|
350
|
+
debug?: (msg: string) => void
|
|
350
351
|
): Array<{ file: string; line: number; column: number; content: string }> {
|
|
351
352
|
const results: Array<{
|
|
352
353
|
file: string;
|
|
@@ -355,14 +356,16 @@ export function parseGrepOutput(
|
|
|
355
356
|
content: string;
|
|
356
357
|
}> = [];
|
|
357
358
|
|
|
358
|
-
for (const line of stdout.split(
|
|
359
|
-
if (!line
|
|
359
|
+
for (const line of stdout.split(/\r?\n/)) {
|
|
360
|
+
if (!line) continue;
|
|
360
361
|
const match = parseGrepLine(line);
|
|
361
362
|
if (match) {
|
|
362
363
|
results.push(match);
|
|
363
364
|
if (results.length >= maxResults) {
|
|
364
365
|
break;
|
|
365
366
|
}
|
|
367
|
+
} else if (debug) {
|
|
368
|
+
debug(`[parseGrepOutput] failed to parse line: ${line}`);
|
|
366
369
|
}
|
|
367
370
|
}
|
|
368
371
|
|
|
@@ -784,7 +787,8 @@ export class Finder<T> {
|
|
|
784
787
|
// Parse as grep output by default
|
|
785
788
|
const parsed = parseGrepOutput(
|
|
786
789
|
result.stdout,
|
|
787
|
-
this.config.maxResults
|
|
790
|
+
this.config.maxResults,
|
|
791
|
+
(msg) => this.editor.debug(msg)
|
|
788
792
|
) as unknown as T[];
|
|
789
793
|
this.updatePromptResults(parsed);
|
|
790
794
|
|
|
@@ -827,9 +831,26 @@ export class Finder<T> {
|
|
|
827
831
|
}
|
|
828
832
|
} catch (e) {
|
|
829
833
|
const errorMsg = String(e);
|
|
830
|
-
|
|
831
|
-
|
|
834
|
+
// "killed" / "not found" come from the cancellation path (a
|
|
835
|
+
// newer search aborted this one). Suppress those entirely —
|
|
836
|
+
// the user didn't ask for them.
|
|
837
|
+
if (errorMsg.includes("killed") || errorMsg.includes("not found")) {
|
|
838
|
+
return;
|
|
832
839
|
}
|
|
840
|
+
// Render the error inside the overlay's result list itself.
|
|
841
|
+
// The status bar is shared and clobbered by other code paths,
|
|
842
|
+
// so it's not a reliable place to surface a feature-scoped
|
|
843
|
+
// error — the overlay is where the user is looking.
|
|
844
|
+
this.promptState.results = [];
|
|
845
|
+
this.promptState.entries = [];
|
|
846
|
+
const display = errorMsg.replace(/^Error:\s*/, "");
|
|
847
|
+
this.editor.setPromptSuggestions([
|
|
848
|
+
{
|
|
849
|
+
text: `⚠ ${display}`,
|
|
850
|
+
value: "",
|
|
851
|
+
disabled: true,
|
|
852
|
+
},
|
|
853
|
+
]);
|
|
833
854
|
}
|
|
834
855
|
}
|
|
835
856
|
|