@fresh-editor/fresh-editor 0.1.65 → 0.1.69
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 +106 -0
- package/README.md +4 -2
- package/package.json +1 -1
- package/plugins/audit_mode.i18n.json +380 -0
- package/plugins/audit_mode.ts +1813 -0
- package/plugins/buffer_modified.i18n.json +32 -0
- package/plugins/buffer_modified.ts +5 -3
- package/plugins/calculator.i18n.json +44 -0
- package/plugins/calculator.ts +6 -4
- package/plugins/clangd-lsp.ts +168 -0
- package/plugins/clangd_support.i18n.json +104 -0
- package/plugins/clangd_support.ts +18 -16
- package/plugins/color_highlighter.i18n.json +68 -0
- package/plugins/color_highlighter.ts +12 -10
- package/plugins/config-schema.json +79 -141
- package/plugins/csharp-lsp.ts +147 -0
- package/plugins/csharp_support.i18n.json +38 -0
- package/plugins/csharp_support.ts +6 -4
- package/plugins/css-lsp.ts +143 -0
- package/plugins/diagnostics_panel.i18n.json +110 -0
- package/plugins/diagnostics_panel.ts +19 -17
- package/plugins/find_references.i18n.json +128 -0
- package/plugins/find_references.ts +22 -20
- package/plugins/git_blame.i18n.json +230 -0
- package/plugins/git_blame.ts +39 -37
- package/plugins/git_find_file.i18n.json +146 -0
- package/plugins/git_find_file.ts +24 -22
- package/plugins/git_grep.i18n.json +80 -0
- package/plugins/git_grep.ts +15 -13
- package/plugins/git_gutter.i18n.json +44 -0
- package/plugins/git_gutter.ts +7 -5
- package/plugins/git_log.i18n.json +224 -0
- package/plugins/git_log.ts +41 -39
- package/plugins/go-lsp.ts +143 -0
- package/plugins/html-lsp.ts +145 -0
- package/plugins/json-lsp.ts +145 -0
- package/plugins/lib/fresh.d.ts +150 -14
- package/plugins/lib/index.ts +1 -1
- package/plugins/lib/navigation-controller.ts +3 -3
- package/plugins/lib/panel-manager.ts +15 -13
- package/plugins/lib/virtual-buffer-factory.ts +84 -112
- package/plugins/live_grep.i18n.json +80 -0
- package/plugins/live_grep.ts +15 -13
- package/plugins/markdown_compose.i18n.json +104 -0
- package/plugins/markdown_compose.ts +17 -15
- package/plugins/merge_conflict.i18n.json +380 -0
- package/plugins/merge_conflict.ts +72 -73
- package/plugins/path_complete.i18n.json +38 -0
- package/plugins/path_complete.ts +6 -4
- package/plugins/python-lsp.ts +162 -0
- package/plugins/rust-lsp.ts +166 -0
- package/plugins/search_replace.i18n.json +188 -0
- package/plugins/search_replace.ts +31 -29
- package/plugins/test_i18n.i18n.json +12 -0
- package/plugins/test_i18n.ts +18 -0
- package/plugins/theme_editor.i18n.json +1417 -0
- package/plugins/theme_editor.ts +73 -69
- package/plugins/todo_highlighter.i18n.json +86 -0
- package/plugins/todo_highlighter.ts +15 -13
- package/plugins/typescript-lsp.ts +167 -0
- package/plugins/vi_mode.i18n.json +716 -0
- package/plugins/vi_mode.ts +2747 -0
- package/plugins/welcome.i18n.json +110 -0
- package/plugins/welcome.ts +18 -16
package/plugins/git_find_file.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference path="../types/fresh.d.ts" />
|
|
2
|
+
const editor = getEditor();
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Git Find File Plugin
|
|
@@ -116,7 +118,7 @@ async function loadGitFiles(): Promise<void> {
|
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
isLoading = true;
|
|
119
|
-
editor.setStatus("
|
|
121
|
+
editor.setStatus(editor.t("status.loading"));
|
|
120
122
|
|
|
121
123
|
try {
|
|
122
124
|
const result = await editor.spawnProcess("git", ["ls-files"]);
|
|
@@ -125,15 +127,15 @@ async function loadGitFiles(): Promise<void> {
|
|
|
125
127
|
allFiles = result.stdout.split("\n").filter((line) => line.trim() !== "");
|
|
126
128
|
|
|
127
129
|
editor.debug(`Loaded ${allFiles.length} git-tracked files`);
|
|
128
|
-
editor.setStatus(
|
|
130
|
+
editor.setStatus(editor.t("status.indexed", { count: String(allFiles.length) }));
|
|
129
131
|
} else {
|
|
130
132
|
editor.debug(`Failed to load git files: ${result.stderr}`);
|
|
131
|
-
editor.setStatus(
|
|
133
|
+
editor.setStatus(editor.t("status.error_loading", { error: result.stderr }));
|
|
132
134
|
allFiles = [];
|
|
133
135
|
}
|
|
134
136
|
} catch (e) {
|
|
135
137
|
editor.debug(`Exception loading git files: ${e}`);
|
|
136
|
-
editor.setStatus("
|
|
138
|
+
editor.setStatus(editor.t("status.failed_load"));
|
|
137
139
|
allFiles = [];
|
|
138
140
|
} finally {
|
|
139
141
|
isLoading = false;
|
|
@@ -160,7 +162,7 @@ globalThis.start_git_find_file = async function (): Promise<void> {
|
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
if (allFiles.length === 0) {
|
|
163
|
-
editor.setStatus("
|
|
165
|
+
editor.setStatus(editor.t("status.no_files"));
|
|
164
166
|
return;
|
|
165
167
|
}
|
|
166
168
|
|
|
@@ -168,13 +170,13 @@ globalThis.start_git_find_file = async function (): Promise<void> {
|
|
|
168
170
|
filteredFiles = [];
|
|
169
171
|
|
|
170
172
|
// Start the prompt
|
|
171
|
-
editor.startPrompt("
|
|
173
|
+
editor.startPrompt(editor.t("prompt.find_file"), "git-find-file");
|
|
172
174
|
|
|
173
175
|
// Show initial suggestions (first 100 files)
|
|
174
176
|
const initial = filterFiles(allFiles, "");
|
|
175
177
|
filteredFiles = initial;
|
|
176
178
|
editor.setPromptSuggestions(filesToSuggestions(initial));
|
|
177
|
-
editor.setStatus(
|
|
179
|
+
editor.setStatus(editor.t("status.files_available", { count: String(allFiles.length) }));
|
|
178
180
|
};
|
|
179
181
|
|
|
180
182
|
// React to prompt input changes
|
|
@@ -195,12 +197,12 @@ globalThis.onGitFindFilePromptChanged = function (args: { prompt_type: string; i
|
|
|
195
197
|
// Update status
|
|
196
198
|
if (matches.length > 0) {
|
|
197
199
|
if (query.trim() === "") {
|
|
198
|
-
editor.setStatus(
|
|
200
|
+
editor.setStatus(editor.t("status.showing_first", { shown: String(matches.length), total: String(allFiles.length) }));
|
|
199
201
|
} else {
|
|
200
|
-
editor.setStatus(
|
|
202
|
+
editor.setStatus(editor.t("status.found_matching", { count: String(matches.length), query }));
|
|
201
203
|
}
|
|
202
204
|
} else {
|
|
203
|
-
editor.setStatus(
|
|
205
|
+
editor.setStatus(editor.t("status.no_matching", { query }));
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
return true;
|
|
@@ -226,7 +228,7 @@ globalThis.onGitFindFilePromptConfirmed = function (args: {
|
|
|
226
228
|
|
|
227
229
|
// Open the file at line 1
|
|
228
230
|
editor.openFile(selectedFile, 1, 1);
|
|
229
|
-
editor.setStatus(
|
|
231
|
+
editor.setStatus(editor.t("status.opened", { file: selectedFile }));
|
|
230
232
|
} else if (args.input.trim() !== "") {
|
|
231
233
|
// Try to open input directly if it's a valid file path
|
|
232
234
|
const inputFile = args.input.trim();
|
|
@@ -234,12 +236,12 @@ globalThis.onGitFindFilePromptConfirmed = function (args: {
|
|
|
234
236
|
// Check if the exact input matches any file
|
|
235
237
|
if (allFiles.includes(inputFile)) {
|
|
236
238
|
editor.openFile(inputFile, 1, 1);
|
|
237
|
-
editor.setStatus(
|
|
239
|
+
editor.setStatus(editor.t("status.opened", { file: inputFile }));
|
|
238
240
|
} else {
|
|
239
|
-
editor.setStatus(
|
|
241
|
+
editor.setStatus(editor.t("status.file_not_found", { file: inputFile }));
|
|
240
242
|
}
|
|
241
243
|
} else {
|
|
242
|
-
editor.setStatus("
|
|
244
|
+
editor.setStatus(editor.t("status.no_selection"));
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
return true;
|
|
@@ -253,7 +255,7 @@ globalThis.onGitFindFilePromptCancelled = function (args: { prompt_type: string
|
|
|
253
255
|
|
|
254
256
|
// Clear results
|
|
255
257
|
filteredFiles = [];
|
|
256
|
-
editor.setStatus("
|
|
258
|
+
editor.setStatus(editor.t("status.cancelled"));
|
|
257
259
|
|
|
258
260
|
return true;
|
|
259
261
|
};
|
|
@@ -272,27 +274,27 @@ globalThis.git_reload_files = async function (): Promise<void> {
|
|
|
272
274
|
// Show file count command
|
|
273
275
|
globalThis.git_file_count = function (): void {
|
|
274
276
|
if (allFiles.length === 0) {
|
|
275
|
-
editor.setStatus("
|
|
277
|
+
editor.setStatus(editor.t("status.no_files_loaded"));
|
|
276
278
|
} else {
|
|
277
|
-
editor.setStatus(
|
|
279
|
+
editor.setStatus(editor.t("status.indexed", { count: String(allFiles.length) }));
|
|
278
280
|
}
|
|
279
281
|
};
|
|
280
282
|
|
|
281
283
|
// Register commands
|
|
282
|
-
editor.registerCommand("
|
|
284
|
+
editor.registerCommand("%cmd.find", "%cmd.find_desc", "start_git_find_file", "normal");
|
|
283
285
|
|
|
284
286
|
editor.registerCommand(
|
|
285
|
-
"
|
|
286
|
-
"
|
|
287
|
+
"%cmd.reload",
|
|
288
|
+
"%cmd.reload_desc",
|
|
287
289
|
"git_reload_files",
|
|
288
290
|
"normal"
|
|
289
291
|
);
|
|
290
292
|
|
|
291
|
-
editor.registerCommand("
|
|
293
|
+
editor.registerCommand("%cmd.count", "%cmd.count_desc", "git_file_count", "normal");
|
|
292
294
|
|
|
293
295
|
// Note: We don't load git files on plugin init because spawning processes requires async context
|
|
294
296
|
// Files will be loaded lazily on first use
|
|
295
297
|
|
|
296
298
|
editor.debug("Git Find File plugin loaded successfully (TypeScript)");
|
|
297
299
|
editor.debug("Usage: Call start_git_find_file() or use command palette 'Git Find File'");
|
|
298
|
-
editor.setStatus("
|
|
300
|
+
editor.setStatus(editor.t("status.ready"));
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"cmd.grep": "Git Grep",
|
|
4
|
+
"cmd.grep_desc": "Search for text in git-tracked files",
|
|
5
|
+
"prompt.grep": "Git grep: ",
|
|
6
|
+
"status.ready": "Git Grep plugin ready",
|
|
7
|
+
"status.type_to_search": "Type to search...",
|
|
8
|
+
"status.found": "Found %{count} matches",
|
|
9
|
+
"status.no_matches": "No matches found",
|
|
10
|
+
"status.error": "Git grep error: %{error}",
|
|
11
|
+
"status.opened": "Opened %{location}",
|
|
12
|
+
"status.no_selection": "No file selected",
|
|
13
|
+
"status.cancelled": "Git grep cancelled"
|
|
14
|
+
},
|
|
15
|
+
"es": {
|
|
16
|
+
"cmd.grep": "Git Grep",
|
|
17
|
+
"cmd.grep_desc": "Buscar texto en archivos rastreados por git",
|
|
18
|
+
"prompt.grep": "Git grep: ",
|
|
19
|
+
"status.ready": "Plugin Git Grep listo",
|
|
20
|
+
"status.type_to_search": "Escribe para buscar...",
|
|
21
|
+
"status.found": "Encontradas %{count} coincidencias",
|
|
22
|
+
"status.no_matches": "No se encontraron coincidencias",
|
|
23
|
+
"status.error": "Error de git grep: %{error}",
|
|
24
|
+
"status.opened": "Abierto %{location}",
|
|
25
|
+
"status.no_selection": "Ningún archivo seleccionado",
|
|
26
|
+
"status.cancelled": "Git grep cancelado"
|
|
27
|
+
},
|
|
28
|
+
"de": {
|
|
29
|
+
"cmd.grep": "Git Grep",
|
|
30
|
+
"cmd.grep_desc": "Text in git-verfolgten Dateien suchen",
|
|
31
|
+
"prompt.grep": "Git grep: ",
|
|
32
|
+
"status.ready": "Git Grep Plugin bereit",
|
|
33
|
+
"status.type_to_search": "Tippen zum Suchen...",
|
|
34
|
+
"status.found": "%{count} Treffer gefunden",
|
|
35
|
+
"status.no_matches": "Keine Treffer gefunden",
|
|
36
|
+
"status.error": "Git grep Fehler: %{error}",
|
|
37
|
+
"status.opened": "Geöffnet: %{location}",
|
|
38
|
+
"status.no_selection": "Keine Datei ausgewählt",
|
|
39
|
+
"status.cancelled": "Git grep abgebrochen"
|
|
40
|
+
},
|
|
41
|
+
"fr": {
|
|
42
|
+
"cmd.grep": "Git Grep",
|
|
43
|
+
"cmd.grep_desc": "Rechercher du texte dans les fichiers suivis par git",
|
|
44
|
+
"prompt.grep": "Git grep: ",
|
|
45
|
+
"status.ready": "Plugin Git Grep prêt",
|
|
46
|
+
"status.type_to_search": "Tapez pour rechercher...",
|
|
47
|
+
"status.found": "%{count} correspondances trouvées",
|
|
48
|
+
"status.no_matches": "Aucune correspondance trouvée",
|
|
49
|
+
"status.error": "Erreur git grep: %{error}",
|
|
50
|
+
"status.opened": "Ouvert: %{location}",
|
|
51
|
+
"status.no_selection": "Aucun fichier sélectionné",
|
|
52
|
+
"status.cancelled": "Git grep annulé"
|
|
53
|
+
},
|
|
54
|
+
"ja": {
|
|
55
|
+
"cmd.grep": "Git Grep",
|
|
56
|
+
"cmd.grep_desc": "Git追跡ファイル内でテキストを検索",
|
|
57
|
+
"prompt.grep": "Git grep: ",
|
|
58
|
+
"status.ready": "Git Grepプラグイン準備完了",
|
|
59
|
+
"status.type_to_search": "入力して検索...",
|
|
60
|
+
"status.found": "%{count}件の一致",
|
|
61
|
+
"status.no_matches": "一致なし",
|
|
62
|
+
"status.error": "Git grepエラー: %{error}",
|
|
63
|
+
"status.opened": "開きました: %{location}",
|
|
64
|
+
"status.no_selection": "ファイルが選択されていません",
|
|
65
|
+
"status.cancelled": "Git grepキャンセル"
|
|
66
|
+
},
|
|
67
|
+
"zh-CN": {
|
|
68
|
+
"cmd.grep": "Git Grep",
|
|
69
|
+
"cmd.grep_desc": "在Git跟踪的文件中搜索文本",
|
|
70
|
+
"prompt.grep": "Git grep: ",
|
|
71
|
+
"status.ready": "Git Grep插件已就绪",
|
|
72
|
+
"status.type_to_search": "输入以搜索...",
|
|
73
|
+
"status.found": "找到%{count}个匹配",
|
|
74
|
+
"status.no_matches": "未找到匹配",
|
|
75
|
+
"status.error": "Git grep错误: %{error}",
|
|
76
|
+
"status.opened": "已打开: %{location}",
|
|
77
|
+
"status.no_selection": "未选择文件",
|
|
78
|
+
"status.cancelled": "Git grep已取消"
|
|
79
|
+
}
|
|
80
|
+
}
|
package/plugins/git_grep.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference path="../types/fresh.d.ts" />
|
|
2
|
+
const editor = getEditor();
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Git Grep Plugin
|
|
@@ -67,8 +69,8 @@ globalThis.start_git_grep = function(): void {
|
|
|
67
69
|
gitGrepResults = [];
|
|
68
70
|
|
|
69
71
|
// Start the prompt
|
|
70
|
-
editor.startPrompt("
|
|
71
|
-
editor.setStatus("
|
|
72
|
+
editor.startPrompt(editor.t("prompt.grep"), "git-grep");
|
|
73
|
+
editor.setStatus(editor.t("status.type_to_search"));
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
// React to prompt input changes
|
|
@@ -102,22 +104,22 @@ globalThis.onGitGrepPromptChanged = function(args: {
|
|
|
102
104
|
|
|
103
105
|
// Update status
|
|
104
106
|
if (results.length > 0) {
|
|
105
|
-
editor.setStatus(
|
|
107
|
+
editor.setStatus(editor.t("status.found", { count: String(results.length) }));
|
|
106
108
|
} else {
|
|
107
|
-
editor.setStatus("
|
|
109
|
+
editor.setStatus(editor.t("status.no_matches"));
|
|
108
110
|
}
|
|
109
111
|
} else if (result.exit_code === 1) {
|
|
110
112
|
// No matches found (git grep returns 1)
|
|
111
113
|
gitGrepResults = [];
|
|
112
114
|
editor.setPromptSuggestions([]);
|
|
113
|
-
editor.setStatus("
|
|
115
|
+
editor.setStatus(editor.t("status.no_matches"));
|
|
114
116
|
} else {
|
|
115
117
|
// Error occurred
|
|
116
|
-
editor.setStatus(
|
|
118
|
+
editor.setStatus(editor.t("status.error", { error: result.stderr }));
|
|
117
119
|
}
|
|
118
120
|
})
|
|
119
121
|
.catch((e) => {
|
|
120
|
-
editor.setStatus(
|
|
122
|
+
editor.setStatus(editor.t("status.error", { error: String(e) }));
|
|
121
123
|
});
|
|
122
124
|
|
|
123
125
|
return true;
|
|
@@ -145,11 +147,11 @@ globalThis.onGitGrepPromptConfirmed = function(args: {
|
|
|
145
147
|
|
|
146
148
|
// Open the file at the specific location
|
|
147
149
|
editor.openFile(selected.file, selected.line, selected.column);
|
|
148
|
-
editor.setStatus(
|
|
150
|
+
editor.setStatus(editor.t("status.opened", { location: `${selected.file}:${selected.line}:${selected.column}` }));
|
|
149
151
|
} else {
|
|
150
152
|
// No selection
|
|
151
153
|
editor.debug("No file selected - selected_index is null or out of bounds");
|
|
152
|
-
editor.setStatus("
|
|
154
|
+
editor.setStatus(editor.t("status.no_selection"));
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
return true;
|
|
@@ -165,7 +167,7 @@ globalThis.onGitGrepPromptCancelled = function(args: {
|
|
|
165
167
|
|
|
166
168
|
// Clear results
|
|
167
169
|
gitGrepResults = [];
|
|
168
|
-
editor.setStatus("
|
|
170
|
+
editor.setStatus(editor.t("status.cancelled"));
|
|
169
171
|
|
|
170
172
|
return true;
|
|
171
173
|
};
|
|
@@ -177,8 +179,8 @@ editor.on("prompt_cancelled", "onGitGrepPromptCancelled");
|
|
|
177
179
|
|
|
178
180
|
// Register command
|
|
179
181
|
editor.registerCommand(
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
+
"%cmd.grep",
|
|
183
|
+
"%cmd.grep_desc",
|
|
182
184
|
"start_git_grep",
|
|
183
185
|
"normal"
|
|
184
186
|
);
|
|
@@ -186,4 +188,4 @@ editor.registerCommand(
|
|
|
186
188
|
// Log that plugin loaded successfully
|
|
187
189
|
editor.debug("Git Grep plugin loaded successfully (TypeScript)");
|
|
188
190
|
editor.debug("Usage: Call start_git_grep() or use command palette 'Git Grep'");
|
|
189
|
-
editor.setStatus("
|
|
191
|
+
editor.setStatus(editor.t("status.ready"));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"cmd.refresh": "Git Gutter: Refresh",
|
|
4
|
+
"cmd.refresh_desc": "Refresh git gutter indicators for the current buffer",
|
|
5
|
+
"status.ready": "Git Gutter plugin ready",
|
|
6
|
+
"status.no_file": "Git Gutter: No file open",
|
|
7
|
+
"status.changes": "Git Gutter: %{count} change(s) detected"
|
|
8
|
+
},
|
|
9
|
+
"es": {
|
|
10
|
+
"cmd.refresh": "Git Gutter: Actualizar",
|
|
11
|
+
"cmd.refresh_desc": "Actualizar indicadores de git gutter para el buffer actual",
|
|
12
|
+
"status.ready": "Plugin Git Gutter listo",
|
|
13
|
+
"status.no_file": "Git Gutter: Ningún archivo abierto",
|
|
14
|
+
"status.changes": "Git Gutter: %{count} cambio(s) detectado(s)"
|
|
15
|
+
},
|
|
16
|
+
"de": {
|
|
17
|
+
"cmd.refresh": "Git Gutter: Aktualisieren",
|
|
18
|
+
"cmd.refresh_desc": "Git Gutter-Indikatoren für den aktuellen Buffer aktualisieren",
|
|
19
|
+
"status.ready": "Git Gutter Plugin bereit",
|
|
20
|
+
"status.no_file": "Git Gutter: Keine Datei geöffnet",
|
|
21
|
+
"status.changes": "Git Gutter: %{count} Änderung(en) erkannt"
|
|
22
|
+
},
|
|
23
|
+
"fr": {
|
|
24
|
+
"cmd.refresh": "Git Gutter: Rafraîchir",
|
|
25
|
+
"cmd.refresh_desc": "Rafraîchir les indicateurs git gutter pour le tampon actuel",
|
|
26
|
+
"status.ready": "Plugin Git Gutter prêt",
|
|
27
|
+
"status.no_file": "Git Gutter: Aucun fichier ouvert",
|
|
28
|
+
"status.changes": "Git Gutter: %{count} modification(s) détectée(s)"
|
|
29
|
+
},
|
|
30
|
+
"ja": {
|
|
31
|
+
"cmd.refresh": "Git Gutter: 更新",
|
|
32
|
+
"cmd.refresh_desc": "現在のバッファのGit Gutterインジケーターを更新",
|
|
33
|
+
"status.ready": "Git Gutterプラグイン準備完了",
|
|
34
|
+
"status.no_file": "Git Gutter: ファイルが開かれていません",
|
|
35
|
+
"status.changes": "Git Gutter: %{count}件の変更を検出"
|
|
36
|
+
},
|
|
37
|
+
"zh-CN": {
|
|
38
|
+
"cmd.refresh": "Git Gutter: 刷新",
|
|
39
|
+
"cmd.refresh_desc": "刷新当前缓冲区的Git Gutter指示器",
|
|
40
|
+
"status.ready": "Git Gutter插件已就绪",
|
|
41
|
+
"status.no_file": "Git Gutter: 没有打开的文件",
|
|
42
|
+
"status.changes": "Git Gutter: 检测到%{count}处更改"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/plugins/git_gutter.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference path="../types/fresh.d.ts" />
|
|
2
|
+
const editor = getEditor();
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Git Gutter Plugin
|
|
@@ -418,7 +420,7 @@ globalThis.git_gutter_refresh = function (): void {
|
|
|
418
420
|
const filePath = editor.getBufferPath(bufferId);
|
|
419
421
|
|
|
420
422
|
if (!filePath || filePath === "") {
|
|
421
|
-
editor.setStatus("
|
|
423
|
+
editor.setStatus(editor.t("status.no_file"));
|
|
422
424
|
return;
|
|
423
425
|
}
|
|
424
426
|
|
|
@@ -435,7 +437,7 @@ globalThis.git_gutter_refresh = function (): void {
|
|
|
435
437
|
updateGitGutter(bufferId).then(() => {
|
|
436
438
|
const state = bufferStates.get(bufferId);
|
|
437
439
|
const count = state?.hunks.length || 0;
|
|
438
|
-
editor.setStatus(
|
|
440
|
+
editor.setStatus(editor.t("status.changes", { count: String(count) }));
|
|
439
441
|
});
|
|
440
442
|
};
|
|
441
443
|
|
|
@@ -453,8 +455,8 @@ editor.on("buffer_closed", "onGitGutterBufferClosed");
|
|
|
453
455
|
|
|
454
456
|
// Register commands
|
|
455
457
|
editor.registerCommand(
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
+
"%cmd.refresh",
|
|
459
|
+
"%cmd.refresh_desc",
|
|
458
460
|
"git_gutter_refresh",
|
|
459
461
|
"normal"
|
|
460
462
|
);
|
|
@@ -472,4 +474,4 @@ if (initPath && initPath !== "") {
|
|
|
472
474
|
}
|
|
473
475
|
|
|
474
476
|
editor.debug("Git Gutter plugin loaded");
|
|
475
|
-
editor.setStatus("
|
|
477
|
+
editor.setStatus(editor.t("status.ready"));
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"cmd.git_log": "Git Log",
|
|
4
|
+
"cmd.git_log_desc": "Show git log in magit-style interface",
|
|
5
|
+
"cmd.git_log_close": "Git Log: Close",
|
|
6
|
+
"cmd.git_log_close_desc": "Close the git log panel",
|
|
7
|
+
"cmd.git_log_refresh": "Git Log: Refresh",
|
|
8
|
+
"cmd.git_log_refresh_desc": "Refresh the git log",
|
|
9
|
+
|
|
10
|
+
"status.already_open": "Git log already open",
|
|
11
|
+
"status.loading": "Loading git log...",
|
|
12
|
+
"status.no_commits": "No commits found or not a git repository",
|
|
13
|
+
"status.closed": "Git log closed",
|
|
14
|
+
"status.failed_open": "Failed to open git log panel",
|
|
15
|
+
"status.refreshing": "Refreshing git log...",
|
|
16
|
+
"status.refreshed": "Git log refreshed: {count} commits",
|
|
17
|
+
"status.log_ready": "Git log: {count} commits | Up/Down: navigate | RET: show | q: quit",
|
|
18
|
+
"status.commit_position": "Commit {current}/{total}",
|
|
19
|
+
"status.move_to_commit": "Move cursor to a commit line",
|
|
20
|
+
"status.loading_commit": "Loading commit {hash}...",
|
|
21
|
+
"status.commit_ready": "Commit {hash} | Up/Down: navigate | RET: open file | q: back",
|
|
22
|
+
"status.failed_open_details": "Failed to open commit details",
|
|
23
|
+
"status.hash_copied": "Copied: {short} ({full})",
|
|
24
|
+
"status.hash_display": "Hash: {hash}",
|
|
25
|
+
"status.git_error": "Git log error: {error}",
|
|
26
|
+
"status.error_fetching_diff": "Error fetching diff: {error}",
|
|
27
|
+
"status.file_loading": "Loading {file} at {hash}...",
|
|
28
|
+
"status.file_not_found": "File {file} not found at commit {hash}",
|
|
29
|
+
"status.file_view_ready": "{file} @ {hash} (read-only) | Target: line {line} | q: back",
|
|
30
|
+
"status.failed_open_file": "Failed to open {file}",
|
|
31
|
+
"status.move_to_diff_with_context": "Move cursor to a diff line with file context",
|
|
32
|
+
"status.move_to_diff": "Move cursor to a diff line",
|
|
33
|
+
|
|
34
|
+
"panel.commits_header": "Commits:",
|
|
35
|
+
"panel.no_commits": " No commits found",
|
|
36
|
+
"panel.log_footer": "{count} commits | Up/Down/j/k: navigate | RET: show | y: yank hash | r: refresh | q: quit",
|
|
37
|
+
"panel.detail_footer": "Up/Down/j/k: navigate | RET: open file at line | q: back to log"
|
|
38
|
+
},
|
|
39
|
+
"es": {
|
|
40
|
+
"cmd.git_log": "Registro Git",
|
|
41
|
+
"cmd.git_log_desc": "Mostrar registro git en interfaz estilo magit",
|
|
42
|
+
"cmd.git_log_close": "Registro Git: Cerrar",
|
|
43
|
+
"cmd.git_log_close_desc": "Cerrar el panel de registro git",
|
|
44
|
+
"cmd.git_log_refresh": "Registro Git: Actualizar",
|
|
45
|
+
"cmd.git_log_refresh_desc": "Actualizar el registro git",
|
|
46
|
+
|
|
47
|
+
"status.already_open": "El registro git ya esta abierto",
|
|
48
|
+
"status.loading": "Cargando registro git...",
|
|
49
|
+
"status.no_commits": "No se encontraron commits o no es un repositorio git",
|
|
50
|
+
"status.closed": "Registro git cerrado",
|
|
51
|
+
"status.failed_open": "Error al abrir el panel de registro git",
|
|
52
|
+
"status.refreshing": "Actualizando registro git...",
|
|
53
|
+
"status.refreshed": "Registro git actualizado: {count} commits",
|
|
54
|
+
"status.log_ready": "Registro git: {count} commits | Arriba/Abajo: navegar | RET: mostrar | q: salir",
|
|
55
|
+
"status.commit_position": "Commit {current}/{total}",
|
|
56
|
+
"status.move_to_commit": "Mueve el cursor a una linea de commit",
|
|
57
|
+
"status.loading_commit": "Cargando commit {hash}...",
|
|
58
|
+
"status.commit_ready": "Commit {hash} | Arriba/Abajo: navegar | RET: abrir archivo | q: volver",
|
|
59
|
+
"status.failed_open_details": "Error al abrir detalles del commit",
|
|
60
|
+
"status.hash_copied": "Copiado: {short} ({full})",
|
|
61
|
+
"status.hash_display": "Hash: {hash}",
|
|
62
|
+
"status.git_error": "Error de registro git: {error}",
|
|
63
|
+
"status.error_fetching_diff": "Error al obtener diff: {error}",
|
|
64
|
+
"status.file_loading": "Cargando {file} en {hash}...",
|
|
65
|
+
"status.file_not_found": "Archivo {file} no encontrado en commit {hash}",
|
|
66
|
+
"status.file_view_ready": "{file} @ {hash} (solo lectura) | Objetivo: linea {line} | q: volver",
|
|
67
|
+
"status.failed_open_file": "Error al abrir {file}",
|
|
68
|
+
"status.move_to_diff_with_context": "Mueve el cursor a una linea de diff con contexto de archivo",
|
|
69
|
+
"status.move_to_diff": "Mueve el cursor a una linea de diff",
|
|
70
|
+
|
|
71
|
+
"panel.commits_header": "Commits:",
|
|
72
|
+
"panel.no_commits": " No se encontraron commits",
|
|
73
|
+
"panel.log_footer": "{count} commits | Arriba/Abajo/j/k: navegar | RET: mostrar | y: copiar hash | r: actualizar | q: salir",
|
|
74
|
+
"panel.detail_footer": "Arriba/Abajo/j/k: navegar | RET: abrir archivo en linea | q: volver al registro"
|
|
75
|
+
},
|
|
76
|
+
"de": {
|
|
77
|
+
"cmd.git_log": "Git-Protokoll",
|
|
78
|
+
"cmd.git_log_desc": "Git-Protokoll in Magit-Stil-Oberflache anzeigen",
|
|
79
|
+
"cmd.git_log_close": "Git-Protokoll: Schliessen",
|
|
80
|
+
"cmd.git_log_close_desc": "Git-Protokoll-Panel schliessen",
|
|
81
|
+
"cmd.git_log_refresh": "Git-Protokoll: Aktualisieren",
|
|
82
|
+
"cmd.git_log_refresh_desc": "Git-Protokoll aktualisieren",
|
|
83
|
+
|
|
84
|
+
"status.already_open": "Git-Protokoll bereits geoeffnet",
|
|
85
|
+
"status.loading": "Lade Git-Protokoll...",
|
|
86
|
+
"status.no_commits": "Keine Commits gefunden oder kein Git-Repository",
|
|
87
|
+
"status.closed": "Git-Protokoll geschlossen",
|
|
88
|
+
"status.failed_open": "Git-Protokoll-Panel konnte nicht geoeffnet werden",
|
|
89
|
+
"status.refreshing": "Aktualisiere Git-Protokoll...",
|
|
90
|
+
"status.refreshed": "Git-Protokoll aktualisiert: {count} Commits",
|
|
91
|
+
"status.log_ready": "Git-Protokoll: {count} Commits | Auf/Ab: navigieren | RET: anzeigen | q: beenden",
|
|
92
|
+
"status.commit_position": "Commit {current}/{total}",
|
|
93
|
+
"status.move_to_commit": "Cursor auf eine Commit-Zeile bewegen",
|
|
94
|
+
"status.loading_commit": "Lade Commit {hash}...",
|
|
95
|
+
"status.commit_ready": "Commit {hash} | Auf/Ab: navigieren | RET: Datei oeffnen | q: zurueck",
|
|
96
|
+
"status.failed_open_details": "Commit-Details konnten nicht geoeffnet werden",
|
|
97
|
+
"status.hash_copied": "Kopiert: {short} ({full})",
|
|
98
|
+
"status.hash_display": "Hash: {hash}",
|
|
99
|
+
"status.git_error": "Git-Protokoll-Fehler: {error}",
|
|
100
|
+
"status.error_fetching_diff": "Fehler beim Abrufen des Diffs: {error}",
|
|
101
|
+
"status.file_loading": "Lade {file} bei {hash}...",
|
|
102
|
+
"status.file_not_found": "Datei {file} nicht gefunden bei Commit {hash}",
|
|
103
|
+
"status.file_view_ready": "{file} @ {hash} (schreibgeschuetzt) | Ziel: Zeile {line} | q: zurueck",
|
|
104
|
+
"status.failed_open_file": "{file} konnte nicht geoeffnet werden",
|
|
105
|
+
"status.move_to_diff_with_context": "Cursor auf eine Diff-Zeile mit Dateikontext bewegen",
|
|
106
|
+
"status.move_to_diff": "Cursor auf eine Diff-Zeile bewegen",
|
|
107
|
+
|
|
108
|
+
"panel.commits_header": "Commits:",
|
|
109
|
+
"panel.no_commits": " Keine Commits gefunden",
|
|
110
|
+
"panel.log_footer": "{count} Commits | Auf/Ab/j/k: navigieren | RET: anzeigen | y: Hash kopieren | r: aktualisieren | q: beenden",
|
|
111
|
+
"panel.detail_footer": "Auf/Ab/j/k: navigieren | RET: Datei bei Zeile oeffnen | q: zurueck zum Protokoll"
|
|
112
|
+
},
|
|
113
|
+
"fr": {
|
|
114
|
+
"cmd.git_log": "Journal Git",
|
|
115
|
+
"cmd.git_log_desc": "Afficher le journal git en interface style magit",
|
|
116
|
+
"cmd.git_log_close": "Journal Git: Fermer",
|
|
117
|
+
"cmd.git_log_close_desc": "Fermer le panneau du journal git",
|
|
118
|
+
"cmd.git_log_refresh": "Journal Git: Actualiser",
|
|
119
|
+
"cmd.git_log_refresh_desc": "Actualiser le journal git",
|
|
120
|
+
|
|
121
|
+
"status.already_open": "Le journal git est deja ouvert",
|
|
122
|
+
"status.loading": "Chargement du journal git...",
|
|
123
|
+
"status.no_commits": "Aucun commit trouve ou ce n'est pas un depot git",
|
|
124
|
+
"status.closed": "Journal git ferme",
|
|
125
|
+
"status.failed_open": "Echec de l'ouverture du panneau du journal git",
|
|
126
|
+
"status.refreshing": "Actualisation du journal git...",
|
|
127
|
+
"status.refreshed": "Journal git actualise: {count} commits",
|
|
128
|
+
"status.log_ready": "Journal git: {count} commits | Haut/Bas: naviguer | RET: afficher | q: quitter",
|
|
129
|
+
"status.commit_position": "Commit {current}/{total}",
|
|
130
|
+
"status.move_to_commit": "Deplacez le curseur sur une ligne de commit",
|
|
131
|
+
"status.loading_commit": "Chargement du commit {hash}...",
|
|
132
|
+
"status.commit_ready": "Commit {hash} | Haut/Bas: naviguer | RET: ouvrir fichier | q: retour",
|
|
133
|
+
"status.failed_open_details": "Echec de l'ouverture des details du commit",
|
|
134
|
+
"status.hash_copied": "Copie: {short} ({full})",
|
|
135
|
+
"status.hash_display": "Hash: {hash}",
|
|
136
|
+
"status.git_error": "Erreur du journal git: {error}",
|
|
137
|
+
"status.error_fetching_diff": "Erreur lors de la recuperation du diff: {error}",
|
|
138
|
+
"status.file_loading": "Chargement de {file} a {hash}...",
|
|
139
|
+
"status.file_not_found": "Fichier {file} non trouve au commit {hash}",
|
|
140
|
+
"status.file_view_ready": "{file} @ {hash} (lecture seule) | Cible: ligne {line} | q: retour",
|
|
141
|
+
"status.failed_open_file": "Echec de l'ouverture de {file}",
|
|
142
|
+
"status.move_to_diff_with_context": "Deplacez le curseur sur une ligne de diff avec contexte de fichier",
|
|
143
|
+
"status.move_to_diff": "Deplacez le curseur sur une ligne de diff",
|
|
144
|
+
|
|
145
|
+
"panel.commits_header": "Commits:",
|
|
146
|
+
"panel.no_commits": " Aucun commit trouve",
|
|
147
|
+
"panel.log_footer": "{count} commits | Haut/Bas/j/k: naviguer | RET: afficher | y: copier hash | r: actualiser | q: quitter",
|
|
148
|
+
"panel.detail_footer": "Haut/Bas/j/k: naviguer | RET: ouvrir fichier a la ligne | q: retour au journal"
|
|
149
|
+
},
|
|
150
|
+
"ja": {
|
|
151
|
+
"cmd.git_log": "Gitログ",
|
|
152
|
+
"cmd.git_log_desc": "magitスタイルのインターフェースでgitログを表示",
|
|
153
|
+
"cmd.git_log_close": "Gitログ: 閉じる",
|
|
154
|
+
"cmd.git_log_close_desc": "gitログパネルを閉じる",
|
|
155
|
+
"cmd.git_log_refresh": "Gitログ: 更新",
|
|
156
|
+
"cmd.git_log_refresh_desc": "gitログを更新",
|
|
157
|
+
|
|
158
|
+
"status.already_open": "Gitログは既に開いています",
|
|
159
|
+
"status.loading": "Gitログを読み込み中...",
|
|
160
|
+
"status.no_commits": "コミットが見つからないか、gitリポジトリではありません",
|
|
161
|
+
"status.closed": "Gitログを閉じました",
|
|
162
|
+
"status.failed_open": "Gitログパネルを開けませんでした",
|
|
163
|
+
"status.refreshing": "Gitログを更新中...",
|
|
164
|
+
"status.refreshed": "Gitログを更新しました: {count}件のコミット",
|
|
165
|
+
"status.log_ready": "Gitログ: {count}件のコミット | 上/下: 移動 | RET: 表示 | q: 終了",
|
|
166
|
+
"status.commit_position": "コミット {current}/{total}",
|
|
167
|
+
"status.move_to_commit": "カーソルをコミット行に移動してください",
|
|
168
|
+
"status.loading_commit": "コミット {hash} を読み込み中...",
|
|
169
|
+
"status.commit_ready": "コミット {hash} | 上/下: 移動 | RET: ファイルを開く | q: 戻る",
|
|
170
|
+
"status.failed_open_details": "コミット詳細を開けませんでした",
|
|
171
|
+
"status.hash_copied": "コピーしました: {short} ({full})",
|
|
172
|
+
"status.hash_display": "ハッシュ: {hash}",
|
|
173
|
+
"status.git_error": "Gitログエラー: {error}",
|
|
174
|
+
"status.error_fetching_diff": "差分取得エラー: {error}",
|
|
175
|
+
"status.file_loading": "{file} を {hash} で読み込み中...",
|
|
176
|
+
"status.file_not_found": "コミット {hash} でファイル {file} が見つかりません",
|
|
177
|
+
"status.file_view_ready": "{file} @ {hash} (読み取り専用) | 対象: {line}行目 | q: 戻る",
|
|
178
|
+
"status.failed_open_file": "{file} を開けませんでした",
|
|
179
|
+
"status.move_to_diff_with_context": "ファイルコンテキストのある差分行にカーソルを移動してください",
|
|
180
|
+
"status.move_to_diff": "カーソルを差分行に移動してください",
|
|
181
|
+
|
|
182
|
+
"panel.commits_header": "コミット:",
|
|
183
|
+
"panel.no_commits": " コミットが見つかりません",
|
|
184
|
+
"panel.log_footer": "{count}件のコミット | 上/下/j/k: 移動 | RET: 表示 | y: ハッシュをコピー | r: 更新 | q: 終了",
|
|
185
|
+
"panel.detail_footer": "上/下/j/k: 移動 | RET: ファイルを行で開く | q: ログに戻る"
|
|
186
|
+
},
|
|
187
|
+
"zh": {
|
|
188
|
+
"cmd.git_log": "Git日志",
|
|
189
|
+
"cmd.git_log_desc": "以magit风格界面显示git日志",
|
|
190
|
+
"cmd.git_log_close": "Git日志: 关闭",
|
|
191
|
+
"cmd.git_log_close_desc": "关闭git日志面板",
|
|
192
|
+
"cmd.git_log_refresh": "Git日志: 刷新",
|
|
193
|
+
"cmd.git_log_refresh_desc": "刷新git日志",
|
|
194
|
+
|
|
195
|
+
"status.already_open": "Git日志已经打开",
|
|
196
|
+
"status.loading": "正在加载Git日志...",
|
|
197
|
+
"status.no_commits": "未找到提交或不是git仓库",
|
|
198
|
+
"status.closed": "Git日志已关闭",
|
|
199
|
+
"status.failed_open": "无法打开Git日志面板",
|
|
200
|
+
"status.refreshing": "正在刷新Git日志...",
|
|
201
|
+
"status.refreshed": "Git日志已刷新: {count}个提交",
|
|
202
|
+
"status.log_ready": "Git日志: {count}个提交 | 上/下: 导航 | RET: 显示 | q: 退出",
|
|
203
|
+
"status.commit_position": "提交 {current}/{total}",
|
|
204
|
+
"status.move_to_commit": "请将光标移动到提交行",
|
|
205
|
+
"status.loading_commit": "正在加载提交 {hash}...",
|
|
206
|
+
"status.commit_ready": "提交 {hash} | 上/下: 导航 | RET: 打开文件 | q: 返回",
|
|
207
|
+
"status.failed_open_details": "无法打开提交详情",
|
|
208
|
+
"status.hash_copied": "已复制: {short} ({full})",
|
|
209
|
+
"status.hash_display": "哈希: {hash}",
|
|
210
|
+
"status.git_error": "Git日志错误: {error}",
|
|
211
|
+
"status.error_fetching_diff": "获取差异时出错: {error}",
|
|
212
|
+
"status.file_loading": "正在加载 {file} 于 {hash}...",
|
|
213
|
+
"status.file_not_found": "在提交 {hash} 中未找到文件 {file}",
|
|
214
|
+
"status.file_view_ready": "{file} @ {hash} (只读) | 目标: 第{line}行 | q: 返回",
|
|
215
|
+
"status.failed_open_file": "无法打开 {file}",
|
|
216
|
+
"status.move_to_diff_with_context": "请将光标移动到带有文件上下文的差异行",
|
|
217
|
+
"status.move_to_diff": "请将光标移动到差异行",
|
|
218
|
+
|
|
219
|
+
"panel.commits_header": "提交:",
|
|
220
|
+
"panel.no_commits": " 未找到提交",
|
|
221
|
+
"panel.log_footer": "{count}个提交 | 上/下/j/k: 导航 | RET: 显示 | y: 复制哈希 | r: 刷新 | q: 退出",
|
|
222
|
+
"panel.detail_footer": "上/下/j/k: 导航 | RET: 在行处打开文件 | q: 返回日志"
|
|
223
|
+
}
|
|
224
|
+
}
|