@fresh-editor/fresh-editor 0.1.86 → 0.1.88
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 +47 -0
- package/README.md +4 -0
- package/package.json +1 -1
- package/plugins/README.md +1 -0
- package/plugins/audit_mode.ts +38 -34
- package/plugins/calculator.i18n.json +13 -13
- package/plugins/calculator.ts +6 -6
- package/plugins/clangd_support.i18n.json +26 -26
- package/plugins/config-schema.json +180 -116
- package/plugins/csharp_support.i18n.json +52 -52
- package/plugins/csharp_support.ts +214 -41
- package/plugins/examples/virtual_buffer_demo.ts +4 -4
- package/plugins/find_references.i18n.json +91 -91
- package/plugins/git_blame.ts +3 -3
- package/plugins/git_explorer.ts +3 -2
- package/plugins/git_log.i18n.json +182 -182
- package/plugins/git_log.ts +10 -10
- package/plugins/java-lsp.ts +65 -0
- package/plugins/latex-lsp.ts +65 -0
- package/plugins/lib/finder.ts +32 -32
- package/plugins/lib/fresh.d.ts +432 -17
- package/plugins/lib/panel-manager.ts +7 -7
- package/plugins/lib/search-utils.ts +13 -13
- package/plugins/lib/virtual-buffer-factory.ts +16 -14
- package/plugins/live_grep.i18n.json +39 -39
- package/plugins/markdown_compose.i18n.json +13 -13
- package/plugins/markdown_compose.ts +4 -4
- package/plugins/marksman-lsp.ts +65 -0
- package/plugins/merge_conflict.i18n.json +143 -143
- package/plugins/merge_conflict.ts +21 -21
- package/plugins/search_replace.i18n.json +143 -143
- package/plugins/search_replace.ts +6 -6
- package/plugins/templ-lsp.ts +65 -0
- package/plugins/theme_editor.i18n.json +3797 -3745
- package/plugins/theme_editor.ts +6 -5
- package/plugins/vi_mode.ts +2 -2
- package/plugins/zig-lsp.ts +65 -0
- package/themes/dracula.json +26 -5
- package/plugins/csharp-lsp.ts +0 -147
package/plugins/theme_editor.ts
CHANGED
|
@@ -1734,15 +1734,16 @@ async function doOpenThemeEditor(): Promise<void> {
|
|
|
1734
1734
|
|
|
1735
1735
|
// Create virtual buffer in current split (no new split)
|
|
1736
1736
|
editor.debug("[theme_editor] doOpenThemeEditor: calling createVirtualBuffer...");
|
|
1737
|
-
const
|
|
1737
|
+
const result = await editor.createVirtualBuffer({
|
|
1738
1738
|
name: "*Theme Editor*",
|
|
1739
1739
|
mode: "theme-editor",
|
|
1740
|
-
|
|
1740
|
+
readOnly: true,
|
|
1741
1741
|
entries: entries,
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1742
|
+
showLineNumbers: false,
|
|
1743
|
+
showCursors: true,
|
|
1744
|
+
editingDisabled: true,
|
|
1745
1745
|
});
|
|
1746
|
+
const bufferId = result.bufferId;
|
|
1746
1747
|
editor.debug(`[theme_editor] doOpenThemeEditor: createVirtualBuffer returned bufferId=${bufferId}`);
|
|
1747
1748
|
editor.debug(`[theme_editor] doOpenThemeEditor: checking if bufferId !== null...`);
|
|
1748
1749
|
|
package/plugins/vi_mode.ts
CHANGED
|
@@ -795,7 +795,7 @@ globalThis.vi_visual_toggle_line = function (): void {
|
|
|
795
795
|
};
|
|
796
796
|
|
|
797
797
|
// Enter visual block mode (Ctrl-v)
|
|
798
|
-
globalThis.vi_visual_block = function (): void {
|
|
798
|
+
globalThis.vi_visual_block = async function (): Promise<void> {
|
|
799
799
|
// Store anchor position for block selection
|
|
800
800
|
state.visualAnchor = editor.getCursorPosition();
|
|
801
801
|
|
|
@@ -803,7 +803,7 @@ globalThis.vi_visual_block = function (): void {
|
|
|
803
803
|
const cursorPos = editor.getCursorPosition();
|
|
804
804
|
if (cursorPos !== null) {
|
|
805
805
|
const line = editor.getCursorLine() ?? 1;
|
|
806
|
-
const lineStart = editor.getLineStartPosition(line);
|
|
806
|
+
const lineStart = await editor.getLineStartPosition(line);
|
|
807
807
|
const col = lineStart !== null ? cursorPos - lineStart : 0;
|
|
808
808
|
state.visualBlockAnchor = { line, col };
|
|
809
809
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference path="./lib/fresh.d.ts" />
|
|
2
|
+
// Provides installation help when zls (Zig LSP) is not found
|
|
3
|
+
const editor = getEditor();
|
|
4
|
+
|
|
5
|
+
interface LspServerErrorData {
|
|
6
|
+
language: string;
|
|
7
|
+
server_command: string;
|
|
8
|
+
error_type: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface LspStatusClickedData {
|
|
13
|
+
language: string;
|
|
14
|
+
has_error: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ActionPopupResultData {
|
|
18
|
+
popup_id: string;
|
|
19
|
+
action_id: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const INSTALL_URL = "https://github.com/zigtools/zls#installation";
|
|
23
|
+
let zigLspError: { serverCommand: string; message: string } | null = null;
|
|
24
|
+
|
|
25
|
+
globalThis.on_zig_lsp_server_error = function (data: LspServerErrorData): void {
|
|
26
|
+
if (data.language !== "zig") return;
|
|
27
|
+
zigLspError = { serverCommand: data.server_command, message: data.message };
|
|
28
|
+
if (data.error_type === "not_found") {
|
|
29
|
+
editor.setStatus(`Zig LSP '${data.server_command}' not found. Click status bar for help.`);
|
|
30
|
+
} else {
|
|
31
|
+
editor.setStatus(`Zig LSP error: ${data.message}`);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
editor.on("lsp_server_error", "on_zig_lsp_server_error");
|
|
35
|
+
|
|
36
|
+
globalThis.on_zig_lsp_status_clicked = function (data: LspStatusClickedData): void {
|
|
37
|
+
if (data.language !== "zig" || !zigLspError) return;
|
|
38
|
+
editor.showActionPopup({
|
|
39
|
+
id: "zig-lsp-help",
|
|
40
|
+
title: "Zig Language Server Not Found",
|
|
41
|
+
message: `Install zls for code completion and diagnostics. Visit ${INSTALL_URL}`,
|
|
42
|
+
actions: [
|
|
43
|
+
{ id: "copy_url", label: "Copy install URL" },
|
|
44
|
+
{ id: "disable", label: "Disable Zig LSP" },
|
|
45
|
+
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
editor.on("lsp_status_clicked", "on_zig_lsp_status_clicked");
|
|
50
|
+
|
|
51
|
+
globalThis.on_zig_lsp_action_result = function (data: ActionPopupResultData): void {
|
|
52
|
+
if (data.popup_id !== "zig-lsp-help") return;
|
|
53
|
+
switch (data.action_id) {
|
|
54
|
+
case "copy_url":
|
|
55
|
+
editor.setClipboard(INSTALL_URL);
|
|
56
|
+
editor.setStatus("Copied: " + INSTALL_URL);
|
|
57
|
+
break;
|
|
58
|
+
case "disable":
|
|
59
|
+
editor.disableLspForLanguage("zig");
|
|
60
|
+
editor.setStatus("Zig LSP disabled");
|
|
61
|
+
zigLspError = null;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
editor.on("action_popup_result", "on_zig_lsp_action_result");
|
package/themes/dracula.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"fg": [248, 248, 242],
|
|
6
6
|
"cursor": [255, 121, 198],
|
|
7
7
|
"selection_bg": [68, 71, 90],
|
|
8
|
-
"current_line_bg": [
|
|
8
|
+
"current_line_bg": [50, 52, 66],
|
|
9
9
|
"line_number_fg": [98, 114, 164],
|
|
10
10
|
"line_number_bg": [40, 42, 54]
|
|
11
11
|
},
|
|
@@ -15,25 +15,46 @@
|
|
|
15
15
|
"tab_inactive_fg": [248, 248, 242],
|
|
16
16
|
"tab_inactive_bg": [68, 71, 90],
|
|
17
17
|
"tab_separator_bg": [40, 42, 54],
|
|
18
|
+
"tab_hover_bg": [80, 83, 100],
|
|
18
19
|
"status_bar_fg": [40, 42, 54],
|
|
19
20
|
"status_bar_bg": [189, 147, 249],
|
|
20
21
|
"prompt_fg": [40, 42, 54],
|
|
21
22
|
"prompt_bg": [80, 250, 123],
|
|
22
23
|
"prompt_selection_fg": [248, 248, 242],
|
|
23
24
|
"prompt_selection_bg": [189, 147, 249],
|
|
24
|
-
"popup_border_fg": [
|
|
25
|
-
"popup_bg": [
|
|
25
|
+
"popup_border_fg": [189, 147, 249],
|
|
26
|
+
"popup_bg": [40, 42, 54],
|
|
26
27
|
"popup_selection_bg": [189, 147, 249],
|
|
27
28
|
"popup_text_fg": [248, 248, 242],
|
|
28
|
-
"suggestion_bg": [
|
|
29
|
+
"suggestion_bg": [40, 42, 54],
|
|
29
30
|
"suggestion_selected_bg": [189, 147, 249],
|
|
31
|
+
"menu_bg": [40, 42, 54],
|
|
32
|
+
"menu_fg": [248, 248, 242],
|
|
33
|
+
"menu_active_bg": [68, 71, 90],
|
|
34
|
+
"menu_active_fg": [139, 233, 253],
|
|
35
|
+
"menu_dropdown_bg": [40, 42, 54],
|
|
36
|
+
"menu_dropdown_fg": [248, 248, 242],
|
|
37
|
+
"menu_highlight_bg": [189, 147, 249],
|
|
38
|
+
"menu_highlight_fg": [40, 42, 54],
|
|
39
|
+
"menu_border_fg": [98, 114, 164],
|
|
40
|
+
"menu_separator_fg": [98, 114, 164],
|
|
41
|
+
"menu_hover_bg": [68, 71, 90],
|
|
42
|
+
"menu_hover_fg": [248, 248, 242],
|
|
43
|
+
"menu_disabled_fg": [98, 114, 164],
|
|
44
|
+
"menu_disabled_bg": [40, 42, 54],
|
|
30
45
|
"help_bg": [40, 42, 54],
|
|
31
46
|
"help_fg": [248, 248, 242],
|
|
32
47
|
"help_key_fg": [139, 233, 253],
|
|
33
48
|
"help_separator_fg": [98, 114, 164],
|
|
34
49
|
"help_indicator_fg": [255, 85, 85],
|
|
35
50
|
"help_indicator_bg": [40, 42, 54],
|
|
36
|
-
"split_separator_fg": [98, 114, 164]
|
|
51
|
+
"split_separator_fg": [98, 114, 164],
|
|
52
|
+
"scrollbar_track_fg": [68, 71, 90],
|
|
53
|
+
"scrollbar_thumb_fg": [98, 114, 164],
|
|
54
|
+
"scrollbar_track_hover_fg": [80, 83, 100],
|
|
55
|
+
"scrollbar_thumb_hover_fg": [139, 233, 253],
|
|
56
|
+
"settings_selected_bg": [68, 71, 90],
|
|
57
|
+
"settings_selected_fg": [248, 248, 242]
|
|
37
58
|
},
|
|
38
59
|
"search": {
|
|
39
60
|
"match_bg": [241, 250, 140],
|
package/plugins/csharp-lsp.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/// <reference path="./lib/fresh.d.ts" />
|
|
2
|
-
const editor = getEditor();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* C# LSP Helper Plugin
|
|
7
|
-
*
|
|
8
|
-
* Provides user-friendly error handling for C# LSP server issues.
|
|
9
|
-
* When csharp-ls fails to start, this plugin shows an actionable
|
|
10
|
-
* popup with installation instructions.
|
|
11
|
-
*
|
|
12
|
-
* Features:
|
|
13
|
-
* - Detects C# LSP server errors (csharp-ls)
|
|
14
|
-
* - Shows popup with install commands (dotnet tool)
|
|
15
|
-
* - Allows copying install commands to clipboard
|
|
16
|
-
* - Provides option to disable C# LSP
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
interface LspServerErrorData {
|
|
20
|
-
language: string;
|
|
21
|
-
server_command: string;
|
|
22
|
-
error_type: string;
|
|
23
|
-
message: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface LspStatusClickedData {
|
|
27
|
-
language: string;
|
|
28
|
-
has_error: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface ActionPopupResultData {
|
|
32
|
-
popup_id: string;
|
|
33
|
-
action_id: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Install commands for C# LSP server (csharp-ls)
|
|
37
|
-
// Requires .NET SDK to be installed
|
|
38
|
-
// See: https://github.com/razzmatazz/csharp-language-server
|
|
39
|
-
const INSTALL_COMMANDS = {
|
|
40
|
-
dotnet: "dotnet tool install --global csharp-ls",
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// Track error state for C# LSP
|
|
44
|
-
let csharpLspError: { serverCommand: string; message: string } | null = null;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Handle LSP server errors for C#
|
|
48
|
-
*/
|
|
49
|
-
globalThis.on_csharp_lsp_server_error = function (
|
|
50
|
-
data: LspServerErrorData
|
|
51
|
-
): void {
|
|
52
|
-
// Only handle C# language errors
|
|
53
|
-
if (data.language !== "csharp") {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
editor.debug(
|
|
58
|
-
`csharp-lsp: Server error - ${data.error_type}: ${data.message}`
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
// Store error state for later reference
|
|
62
|
-
csharpLspError = {
|
|
63
|
-
serverCommand: data.server_command,
|
|
64
|
-
message: data.message,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Show a status message for immediate feedback
|
|
68
|
-
if (data.error_type === "not_found") {
|
|
69
|
-
editor.setStatus(
|
|
70
|
-
`C# LSP server '${data.server_command}' not found. Click status bar for help.`
|
|
71
|
-
);
|
|
72
|
-
} else {
|
|
73
|
-
editor.setStatus(`C# LSP error: ${data.message}`);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// Register hook for LSP server errors
|
|
78
|
-
editor.on("lsp_server_error", "on_csharp_lsp_server_error");
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Handle status bar click when there's a C# LSP error
|
|
82
|
-
*/
|
|
83
|
-
globalThis.on_csharp_lsp_status_clicked = function (
|
|
84
|
-
data: LspStatusClickedData
|
|
85
|
-
): void {
|
|
86
|
-
// Only handle C# language clicks when there's an error
|
|
87
|
-
if (data.language !== "csharp" || !csharpLspError) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
editor.debug("csharp-lsp: Status clicked, showing help popup");
|
|
92
|
-
|
|
93
|
-
// Show action popup with install options
|
|
94
|
-
editor.showActionPopup({
|
|
95
|
-
id: "csharp-lsp-help",
|
|
96
|
-
title: "C# Language Server Not Found",
|
|
97
|
-
message: `"${csharpLspError.serverCommand}" provides code completion, diagnostics, and navigation for C# files. Requires .NET SDK. Copy the command below to install it.`,
|
|
98
|
-
actions: [
|
|
99
|
-
{ id: "copy_dotnet", label: `Copy: ${INSTALL_COMMANDS.dotnet}` },
|
|
100
|
-
{ id: "disable", label: "Disable C# LSP" },
|
|
101
|
-
{ id: "dismiss", label: "Dismiss (ESC)" },
|
|
102
|
-
],
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Register hook for status bar clicks
|
|
107
|
-
editor.on("lsp_status_clicked", "on_csharp_lsp_status_clicked");
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Handle action popup results for C# LSP help
|
|
111
|
-
*/
|
|
112
|
-
globalThis.on_csharp_lsp_action_result = function (
|
|
113
|
-
data: ActionPopupResultData
|
|
114
|
-
): void {
|
|
115
|
-
// Only handle our popup
|
|
116
|
-
if (data.popup_id !== "csharp-lsp-help") {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
editor.debug(`csharp-lsp: Action selected - ${data.action_id}`);
|
|
121
|
-
|
|
122
|
-
switch (data.action_id) {
|
|
123
|
-
case "copy_dotnet":
|
|
124
|
-
editor.setClipboard(INSTALL_COMMANDS.dotnet);
|
|
125
|
-
editor.setStatus("Copied: " + INSTALL_COMMANDS.dotnet);
|
|
126
|
-
break;
|
|
127
|
-
|
|
128
|
-
case "disable":
|
|
129
|
-
editor.disableLspForLanguage("csharp");
|
|
130
|
-
editor.setStatus("C# LSP disabled");
|
|
131
|
-
csharpLspError = null;
|
|
132
|
-
break;
|
|
133
|
-
|
|
134
|
-
case "dismiss":
|
|
135
|
-
case "dismissed":
|
|
136
|
-
// Just close the popup without action
|
|
137
|
-
break;
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
editor.debug(`csharp-lsp: Unknown action: ${data.action_id}`);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// Register hook for action popup results
|
|
145
|
-
editor.on("action_popup_result", "on_csharp_lsp_action_result");
|
|
146
|
-
|
|
147
|
-
editor.debug("csharp-lsp: Plugin loaded");
|