@fresh-editor/fresh-editor 0.1.67 → 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 +58 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/plugins/audit_mode.i18n.json +380 -0
- package/plugins/audit_mode.ts +836 -68
- 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 +2 -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 +25 -140
- package/plugins/csharp-lsp.ts +2 -0
- package/plugins/csharp_support.i18n.json +38 -0
- package/plugins/csharp_support.ts +6 -4
- package/plugins/css-lsp.ts +2 -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 +2 -0
- package/plugins/html-lsp.ts +2 -0
- package/plugins/json-lsp.ts +2 -0
- package/plugins/lib/fresh.d.ts +53 -13
- 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 +2 -0
- package/plugins/rust-lsp.ts +2 -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 +2 -0
- package/plugins/vi_mode.i18n.json +716 -0
- package/plugins/vi_mode.ts +1195 -78
- package/plugins/welcome.i18n.json +110 -0
- package/plugins/welcome.ts +18 -16
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"cmd.find": "Git Find File",
|
|
4
|
+
"cmd.find_desc": "Find and open a git-tracked file",
|
|
5
|
+
"cmd.reload": "Git Find File: Reload",
|
|
6
|
+
"cmd.reload_desc": "Reload the git file index",
|
|
7
|
+
"cmd.count": "Git Find File: Count",
|
|
8
|
+
"cmd.count_desc": "Show number of indexed git files",
|
|
9
|
+
"prompt.find_file": "Find file: ",
|
|
10
|
+
"status.ready": "Git Find File plugin ready",
|
|
11
|
+
"status.loading": "Loading git files...",
|
|
12
|
+
"status.indexed": "Git Find File: %{count} files indexed",
|
|
13
|
+
"status.error_loading": "Error loading git files: %{error}",
|
|
14
|
+
"status.failed_load": "Failed to load git files",
|
|
15
|
+
"status.no_files": "No git-tracked files found",
|
|
16
|
+
"status.files_available": "%{count} files available - type to filter",
|
|
17
|
+
"status.showing_first": "Showing first %{shown} of %{total} files",
|
|
18
|
+
"status.found_matching": "Found %{count} files matching \"%{query}\"",
|
|
19
|
+
"status.no_matching": "No files matching \"%{query}\"",
|
|
20
|
+
"status.opened": "Opened %{file}",
|
|
21
|
+
"status.file_not_found": "File not found: %{file}",
|
|
22
|
+
"status.no_selection": "No file selected",
|
|
23
|
+
"status.cancelled": "File finder cancelled",
|
|
24
|
+
"status.no_files_loaded": "No git files loaded. Use 'Git Find File: Reload' to index files."
|
|
25
|
+
},
|
|
26
|
+
"es": {
|
|
27
|
+
"cmd.find": "Git Buscar Archivo",
|
|
28
|
+
"cmd.find_desc": "Buscar y abrir un archivo rastreado por git",
|
|
29
|
+
"cmd.reload": "Git Buscar Archivo: Recargar",
|
|
30
|
+
"cmd.reload_desc": "Recargar el índice de archivos git",
|
|
31
|
+
"cmd.count": "Git Buscar Archivo: Contar",
|
|
32
|
+
"cmd.count_desc": "Mostrar número de archivos git indexados",
|
|
33
|
+
"prompt.find_file": "Buscar archivo: ",
|
|
34
|
+
"status.ready": "Plugin Git Buscar Archivo listo",
|
|
35
|
+
"status.loading": "Cargando archivos git...",
|
|
36
|
+
"status.indexed": "Git Buscar Archivo: %{count} archivos indexados",
|
|
37
|
+
"status.error_loading": "Error cargando archivos git: %{error}",
|
|
38
|
+
"status.failed_load": "Error al cargar archivos git",
|
|
39
|
+
"status.no_files": "No se encontraron archivos rastreados por git",
|
|
40
|
+
"status.files_available": "%{count} archivos disponibles - escribe para filtrar",
|
|
41
|
+
"status.showing_first": "Mostrando primeros %{shown} de %{total} archivos",
|
|
42
|
+
"status.found_matching": "Encontrados %{count} archivos coincidentes con \"%{query}\"",
|
|
43
|
+
"status.no_matching": "Ningún archivo coincide con \"%{query}\"",
|
|
44
|
+
"status.opened": "Abierto %{file}",
|
|
45
|
+
"status.file_not_found": "Archivo no encontrado: %{file}",
|
|
46
|
+
"status.no_selection": "Ningún archivo seleccionado",
|
|
47
|
+
"status.cancelled": "Buscador de archivos cancelado",
|
|
48
|
+
"status.no_files_loaded": "No hay archivos git cargados. Usa 'Git Buscar Archivo: Recargar' para indexar."
|
|
49
|
+
},
|
|
50
|
+
"de": {
|
|
51
|
+
"cmd.find": "Git Datei Finden",
|
|
52
|
+
"cmd.find_desc": "Git-verfolgte Datei suchen und öffnen",
|
|
53
|
+
"cmd.reload": "Git Datei Finden: Neu laden",
|
|
54
|
+
"cmd.reload_desc": "Git-Dateiindex neu laden",
|
|
55
|
+
"cmd.count": "Git Datei Finden: Anzahl",
|
|
56
|
+
"cmd.count_desc": "Anzahl der indexierten Git-Dateien anzeigen",
|
|
57
|
+
"prompt.find_file": "Datei finden: ",
|
|
58
|
+
"status.ready": "Git Datei Finden Plugin bereit",
|
|
59
|
+
"status.loading": "Lade Git-Dateien...",
|
|
60
|
+
"status.indexed": "Git Datei Finden: %{count} Dateien indexiert",
|
|
61
|
+
"status.error_loading": "Fehler beim Laden der Git-Dateien: %{error}",
|
|
62
|
+
"status.failed_load": "Git-Dateien konnten nicht geladen werden",
|
|
63
|
+
"status.no_files": "Keine git-verfolgten Dateien gefunden",
|
|
64
|
+
"status.files_available": "%{count} Dateien verfügbar - tippen zum Filtern",
|
|
65
|
+
"status.showing_first": "Zeige erste %{shown} von %{total} Dateien",
|
|
66
|
+
"status.found_matching": "%{count} Dateien gefunden für \"%{query}\"",
|
|
67
|
+
"status.no_matching": "Keine Dateien für \"%{query}\"",
|
|
68
|
+
"status.opened": "Geöffnet: %{file}",
|
|
69
|
+
"status.file_not_found": "Datei nicht gefunden: %{file}",
|
|
70
|
+
"status.no_selection": "Keine Datei ausgewählt",
|
|
71
|
+
"status.cancelled": "Dateisuche abgebrochen",
|
|
72
|
+
"status.no_files_loaded": "Keine Git-Dateien geladen. 'Git Datei Finden: Neu laden' zum Indexieren."
|
|
73
|
+
},
|
|
74
|
+
"fr": {
|
|
75
|
+
"cmd.find": "Git Trouver Fichier",
|
|
76
|
+
"cmd.find_desc": "Trouver et ouvrir un fichier suivi par git",
|
|
77
|
+
"cmd.reload": "Git Trouver Fichier: Recharger",
|
|
78
|
+
"cmd.reload_desc": "Recharger l'index des fichiers git",
|
|
79
|
+
"cmd.count": "Git Trouver Fichier: Compter",
|
|
80
|
+
"cmd.count_desc": "Afficher le nombre de fichiers git indexés",
|
|
81
|
+
"prompt.find_file": "Trouver fichier: ",
|
|
82
|
+
"status.ready": "Plugin Git Trouver Fichier prêt",
|
|
83
|
+
"status.loading": "Chargement des fichiers git...",
|
|
84
|
+
"status.indexed": "Git Trouver Fichier: %{count} fichiers indexés",
|
|
85
|
+
"status.error_loading": "Erreur chargement fichiers git: %{error}",
|
|
86
|
+
"status.failed_load": "Échec du chargement des fichiers git",
|
|
87
|
+
"status.no_files": "Aucun fichier suivi par git trouvé",
|
|
88
|
+
"status.files_available": "%{count} fichiers disponibles - tapez pour filtrer",
|
|
89
|
+
"status.showing_first": "Affichage des %{shown} premiers sur %{total} fichiers",
|
|
90
|
+
"status.found_matching": "%{count} fichiers trouvés pour \"%{query}\"",
|
|
91
|
+
"status.no_matching": "Aucun fichier pour \"%{query}\"",
|
|
92
|
+
"status.opened": "Ouvert: %{file}",
|
|
93
|
+
"status.file_not_found": "Fichier non trouvé: %{file}",
|
|
94
|
+
"status.no_selection": "Aucun fichier sélectionné",
|
|
95
|
+
"status.cancelled": "Recherche annulée",
|
|
96
|
+
"status.no_files_loaded": "Aucun fichier git chargé. Utilisez 'Git Trouver Fichier: Recharger'."
|
|
97
|
+
},
|
|
98
|
+
"ja": {
|
|
99
|
+
"cmd.find": "Gitファイル検索",
|
|
100
|
+
"cmd.find_desc": "Git追跡ファイルを検索して開く",
|
|
101
|
+
"cmd.reload": "Gitファイル検索: 再読み込み",
|
|
102
|
+
"cmd.reload_desc": "Gitファイルインデックスを再読み込み",
|
|
103
|
+
"cmd.count": "Gitファイル検索: カウント",
|
|
104
|
+
"cmd.count_desc": "インデックス済みGitファイル数を表示",
|
|
105
|
+
"prompt.find_file": "ファイル検索: ",
|
|
106
|
+
"status.ready": "Gitファイル検索プラグイン準備完了",
|
|
107
|
+
"status.loading": "Gitファイルを読み込み中...",
|
|
108
|
+
"status.indexed": "Gitファイル検索: %{count}ファイルをインデックス",
|
|
109
|
+
"status.error_loading": "Gitファイル読み込みエラー: %{error}",
|
|
110
|
+
"status.failed_load": "Gitファイルの読み込みに失敗",
|
|
111
|
+
"status.no_files": "Git追跡ファイルが見つかりません",
|
|
112
|
+
"status.files_available": "%{count}ファイル利用可能 - 入力してフィルタ",
|
|
113
|
+
"status.showing_first": "%{total}ファイル中、最初の%{shown}を表示",
|
|
114
|
+
"status.found_matching": "\"%{query}\"に一致する%{count}ファイル",
|
|
115
|
+
"status.no_matching": "\"%{query}\"に一致するファイルなし",
|
|
116
|
+
"status.opened": "開きました: %{file}",
|
|
117
|
+
"status.file_not_found": "ファイルが見つかりません: %{file}",
|
|
118
|
+
"status.no_selection": "ファイルが選択されていません",
|
|
119
|
+
"status.cancelled": "ファイル検索キャンセル",
|
|
120
|
+
"status.no_files_loaded": "Gitファイル未読み込み。'Gitファイル検索: 再読み込み'を使用。"
|
|
121
|
+
},
|
|
122
|
+
"zh-CN": {
|
|
123
|
+
"cmd.find": "Git查找文件",
|
|
124
|
+
"cmd.find_desc": "查找并打开Git跟踪的文件",
|
|
125
|
+
"cmd.reload": "Git查找文件: 重新加载",
|
|
126
|
+
"cmd.reload_desc": "重新加载Git文件索引",
|
|
127
|
+
"cmd.count": "Git查找文件: 计数",
|
|
128
|
+
"cmd.count_desc": "显示已索引的Git文件数量",
|
|
129
|
+
"prompt.find_file": "查找文件: ",
|
|
130
|
+
"status.ready": "Git查找文件插件已就绪",
|
|
131
|
+
"status.loading": "正在加载Git文件...",
|
|
132
|
+
"status.indexed": "Git查找文件: 已索引%{count}个文件",
|
|
133
|
+
"status.error_loading": "加载Git文件错误: %{error}",
|
|
134
|
+
"status.failed_load": "加载Git文件失败",
|
|
135
|
+
"status.no_files": "未找到Git跟踪的文件",
|
|
136
|
+
"status.files_available": "%{count}个文件可用 - 输入以筛选",
|
|
137
|
+
"status.showing_first": "显示%{total}个文件中的前%{shown}个",
|
|
138
|
+
"status.found_matching": "找到%{count}个匹配\"%{query}\"的文件",
|
|
139
|
+
"status.no_matching": "没有匹配\"%{query}\"的文件",
|
|
140
|
+
"status.opened": "已打开: %{file}",
|
|
141
|
+
"status.file_not_found": "文件未找到: %{file}",
|
|
142
|
+
"status.no_selection": "未选择文件",
|
|
143
|
+
"status.cancelled": "文件查找已取消",
|
|
144
|
+
"status.no_files_loaded": "未加载Git文件。使用'Git查找文件: 重新加载'进行索引。"
|
|
145
|
+
}
|
|
146
|
+
}
|
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"));
|