@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
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"cmd.git_blame": "Git Blame",
|
|
4
|
+
"cmd.git_blame_desc": "Show git blame for current file (magit-style)",
|
|
5
|
+
"cmd.git_blame_close": "Git Blame: Close",
|
|
6
|
+
"cmd.git_blame_close_desc": "Close the git blame panel",
|
|
7
|
+
"cmd.git_blame_go_back": "Git Blame: Go Back",
|
|
8
|
+
"cmd.git_blame_go_back_desc": "Show blame at parent commit of current line",
|
|
9
|
+
|
|
10
|
+
"status.already_open": "Git blame already open",
|
|
11
|
+
"status.loading": "Loading git blame...",
|
|
12
|
+
"status.no_file": "No file open to blame",
|
|
13
|
+
"status.no_blame_info": "No blame information available (not a git file or error)",
|
|
14
|
+
"status.failed_open": "Failed to open git blame panel",
|
|
15
|
+
"status.closed": "Git blame closed",
|
|
16
|
+
"status.blame_ready": "Git blame: {count} blocks | b: blame at parent | q: close",
|
|
17
|
+
"status.move_to_line": "Move cursor to a blame line first",
|
|
18
|
+
"status.not_committed": "This line is not yet committed",
|
|
19
|
+
"status.loading_parent": "Loading blame at {hash}^...",
|
|
20
|
+
"status.cannot_go_back": "Cannot get blame at {hash}^ (may be initial commit or file didn't exist)",
|
|
21
|
+
"status.blame_at_parent": "Git blame at {hash}^ | depth: {depth} | b: go deeper | q: close",
|
|
22
|
+
"status.hash_copied": "Copied: {short} ({full})",
|
|
23
|
+
"status.hash_display": "Hash: {hash}",
|
|
24
|
+
"status.git_error": "Git blame error: {error}",
|
|
25
|
+
|
|
26
|
+
"time.just_now": "just now",
|
|
27
|
+
"time.minutes_ago": "{count} minute ago",
|
|
28
|
+
"time.minutes_ago_plural": "{count} minutes ago",
|
|
29
|
+
"time.hours_ago": "{count} hour ago",
|
|
30
|
+
"time.hours_ago_plural": "{count} hours ago",
|
|
31
|
+
"time.days_ago": "{count} day ago",
|
|
32
|
+
"time.days_ago_plural": "{count} days ago",
|
|
33
|
+
"time.weeks_ago": "{count} week ago",
|
|
34
|
+
"time.weeks_ago_plural": "{count} weeks ago",
|
|
35
|
+
"time.months_ago": "{count} month ago",
|
|
36
|
+
"time.months_ago_plural": "{count} months ago",
|
|
37
|
+
"time.years_ago": "{count} year ago",
|
|
38
|
+
"time.years_ago_plural": "{count} years ago"
|
|
39
|
+
},
|
|
40
|
+
"es": {
|
|
41
|
+
"cmd.git_blame": "Git Blame",
|
|
42
|
+
"cmd.git_blame_desc": "Mostrar git blame del archivo actual (estilo magit)",
|
|
43
|
+
"cmd.git_blame_close": "Git Blame: Cerrar",
|
|
44
|
+
"cmd.git_blame_close_desc": "Cerrar el panel de git blame",
|
|
45
|
+
"cmd.git_blame_go_back": "Git Blame: Retroceder",
|
|
46
|
+
"cmd.git_blame_go_back_desc": "Mostrar blame en el commit padre de la linea actual",
|
|
47
|
+
|
|
48
|
+
"status.already_open": "Git blame ya esta abierto",
|
|
49
|
+
"status.loading": "Cargando git blame...",
|
|
50
|
+
"status.no_file": "No hay archivo abierto para blame",
|
|
51
|
+
"status.no_blame_info": "No hay informacion de blame disponible (no es un archivo git o hay un error)",
|
|
52
|
+
"status.failed_open": "Error al abrir el panel de git blame",
|
|
53
|
+
"status.closed": "Git blame cerrado",
|
|
54
|
+
"status.blame_ready": "Git blame: {count} bloques | b: blame en padre | q: cerrar",
|
|
55
|
+
"status.move_to_line": "Primero mueve el cursor a una linea de blame",
|
|
56
|
+
"status.not_committed": "Esta linea aun no esta comprometida",
|
|
57
|
+
"status.loading_parent": "Cargando blame en {hash}^...",
|
|
58
|
+
"status.cannot_go_back": "No se puede obtener blame en {hash}^ (puede ser el commit inicial o el archivo no existia)",
|
|
59
|
+
"status.blame_at_parent": "Git blame en {hash}^ | profundidad: {depth} | b: ir mas profundo | q: cerrar",
|
|
60
|
+
"status.hash_copied": "Copiado: {short} ({full})",
|
|
61
|
+
"status.hash_display": "Hash: {hash}",
|
|
62
|
+
"status.git_error": "Error de git blame: {error}",
|
|
63
|
+
|
|
64
|
+
"time.just_now": "ahora mismo",
|
|
65
|
+
"time.minutes_ago": "hace {count} minuto",
|
|
66
|
+
"time.minutes_ago_plural": "hace {count} minutos",
|
|
67
|
+
"time.hours_ago": "hace {count} hora",
|
|
68
|
+
"time.hours_ago_plural": "hace {count} horas",
|
|
69
|
+
"time.days_ago": "hace {count} dia",
|
|
70
|
+
"time.days_ago_plural": "hace {count} dias",
|
|
71
|
+
"time.weeks_ago": "hace {count} semana",
|
|
72
|
+
"time.weeks_ago_plural": "hace {count} semanas",
|
|
73
|
+
"time.months_ago": "hace {count} mes",
|
|
74
|
+
"time.months_ago_plural": "hace {count} meses",
|
|
75
|
+
"time.years_ago": "hace {count} ano",
|
|
76
|
+
"time.years_ago_plural": "hace {count} anos"
|
|
77
|
+
},
|
|
78
|
+
"de": {
|
|
79
|
+
"cmd.git_blame": "Git Blame",
|
|
80
|
+
"cmd.git_blame_desc": "Git blame fuer aktuelle Datei anzeigen (Magit-Stil)",
|
|
81
|
+
"cmd.git_blame_close": "Git Blame: Schliessen",
|
|
82
|
+
"cmd.git_blame_close_desc": "Git blame Panel schliessen",
|
|
83
|
+
"cmd.git_blame_go_back": "Git Blame: Zurueck",
|
|
84
|
+
"cmd.git_blame_go_back_desc": "Blame beim Eltern-Commit der aktuellen Zeile anzeigen",
|
|
85
|
+
|
|
86
|
+
"status.already_open": "Git blame bereits geoeffnet",
|
|
87
|
+
"status.loading": "Lade git blame...",
|
|
88
|
+
"status.no_file": "Keine Datei zum Blamen geoeffnet",
|
|
89
|
+
"status.no_blame_info": "Keine Blame-Informationen verfuegbar (keine Git-Datei oder Fehler)",
|
|
90
|
+
"status.failed_open": "Git blame Panel konnte nicht geoeffnet werden",
|
|
91
|
+
"status.closed": "Git blame geschlossen",
|
|
92
|
+
"status.blame_ready": "Git blame: {count} Bloecke | b: Blame bei Eltern | q: schliessen",
|
|
93
|
+
"status.move_to_line": "Zuerst Cursor auf eine Blame-Zeile bewegen",
|
|
94
|
+
"status.not_committed": "Diese Zeile ist noch nicht committet",
|
|
95
|
+
"status.loading_parent": "Lade blame bei {hash}^...",
|
|
96
|
+
"status.cannot_go_back": "Kann blame bei {hash}^ nicht abrufen (moeglicherweise initialer Commit oder Datei existierte nicht)",
|
|
97
|
+
"status.blame_at_parent": "Git blame bei {hash}^ | Tiefe: {depth} | b: tiefer gehen | q: schliessen",
|
|
98
|
+
"status.hash_copied": "Kopiert: {short} ({full})",
|
|
99
|
+
"status.hash_display": "Hash: {hash}",
|
|
100
|
+
"status.git_error": "Git blame Fehler: {error}",
|
|
101
|
+
|
|
102
|
+
"time.just_now": "gerade eben",
|
|
103
|
+
"time.minutes_ago": "vor {count} Minute",
|
|
104
|
+
"time.minutes_ago_plural": "vor {count} Minuten",
|
|
105
|
+
"time.hours_ago": "vor {count} Stunde",
|
|
106
|
+
"time.hours_ago_plural": "vor {count} Stunden",
|
|
107
|
+
"time.days_ago": "vor {count} Tag",
|
|
108
|
+
"time.days_ago_plural": "vor {count} Tagen",
|
|
109
|
+
"time.weeks_ago": "vor {count} Woche",
|
|
110
|
+
"time.weeks_ago_plural": "vor {count} Wochen",
|
|
111
|
+
"time.months_ago": "vor {count} Monat",
|
|
112
|
+
"time.months_ago_plural": "vor {count} Monaten",
|
|
113
|
+
"time.years_ago": "vor {count} Jahr",
|
|
114
|
+
"time.years_ago_plural": "vor {count} Jahren"
|
|
115
|
+
},
|
|
116
|
+
"fr": {
|
|
117
|
+
"cmd.git_blame": "Git Blame",
|
|
118
|
+
"cmd.git_blame_desc": "Afficher git blame pour le fichier actuel (style magit)",
|
|
119
|
+
"cmd.git_blame_close": "Git Blame: Fermer",
|
|
120
|
+
"cmd.git_blame_close_desc": "Fermer le panneau git blame",
|
|
121
|
+
"cmd.git_blame_go_back": "Git Blame: Retour",
|
|
122
|
+
"cmd.git_blame_go_back_desc": "Afficher le blame au commit parent de la ligne actuelle",
|
|
123
|
+
|
|
124
|
+
"status.already_open": "Git blame deja ouvert",
|
|
125
|
+
"status.loading": "Chargement de git blame...",
|
|
126
|
+
"status.no_file": "Aucun fichier ouvert pour blame",
|
|
127
|
+
"status.no_blame_info": "Aucune information de blame disponible (pas un fichier git ou erreur)",
|
|
128
|
+
"status.failed_open": "Echec de l'ouverture du panneau git blame",
|
|
129
|
+
"status.closed": "Git blame ferme",
|
|
130
|
+
"status.blame_ready": "Git blame: {count} blocs | b: blame au parent | q: fermer",
|
|
131
|
+
"status.move_to_line": "Deplacez d'abord le curseur sur une ligne de blame",
|
|
132
|
+
"status.not_committed": "Cette ligne n'est pas encore commitee",
|
|
133
|
+
"status.loading_parent": "Chargement du blame a {hash}^...",
|
|
134
|
+
"status.cannot_go_back": "Impossible d'obtenir le blame a {hash}^ (peut etre le commit initial ou le fichier n'existait pas)",
|
|
135
|
+
"status.blame_at_parent": "Git blame a {hash}^ | profondeur: {depth} | b: aller plus loin | q: fermer",
|
|
136
|
+
"status.hash_copied": "Copie: {short} ({full})",
|
|
137
|
+
"status.hash_display": "Hash: {hash}",
|
|
138
|
+
"status.git_error": "Erreur git blame: {error}",
|
|
139
|
+
|
|
140
|
+
"time.just_now": "a l'instant",
|
|
141
|
+
"time.minutes_ago": "il y a {count} minute",
|
|
142
|
+
"time.minutes_ago_plural": "il y a {count} minutes",
|
|
143
|
+
"time.hours_ago": "il y a {count} heure",
|
|
144
|
+
"time.hours_ago_plural": "il y a {count} heures",
|
|
145
|
+
"time.days_ago": "il y a {count} jour",
|
|
146
|
+
"time.days_ago_plural": "il y a {count} jours",
|
|
147
|
+
"time.weeks_ago": "il y a {count} semaine",
|
|
148
|
+
"time.weeks_ago_plural": "il y a {count} semaines",
|
|
149
|
+
"time.months_ago": "il y a {count} mois",
|
|
150
|
+
"time.months_ago_plural": "il y a {count} mois",
|
|
151
|
+
"time.years_ago": "il y a {count} an",
|
|
152
|
+
"time.years_ago_plural": "il y a {count} ans"
|
|
153
|
+
},
|
|
154
|
+
"ja": {
|
|
155
|
+
"cmd.git_blame": "Git Blame",
|
|
156
|
+
"cmd.git_blame_desc": "現在のファイルのgit blameを表示(magitスタイル)",
|
|
157
|
+
"cmd.git_blame_close": "Git Blame: 閉じる",
|
|
158
|
+
"cmd.git_blame_close_desc": "git blameパネルを閉じる",
|
|
159
|
+
"cmd.git_blame_go_back": "Git Blame: 戻る",
|
|
160
|
+
"cmd.git_blame_go_back_desc": "現在の行の親コミットでblameを表示",
|
|
161
|
+
|
|
162
|
+
"status.already_open": "Git blameは既に開いています",
|
|
163
|
+
"status.loading": "Git blameを読み込み中...",
|
|
164
|
+
"status.no_file": "blameするファイルが開かれていません",
|
|
165
|
+
"status.no_blame_info": "blame情報がありません(gitファイルではないかエラーです)",
|
|
166
|
+
"status.failed_open": "Git blameパネルを開けませんでした",
|
|
167
|
+
"status.closed": "Git blameを閉じました",
|
|
168
|
+
"status.blame_ready": "Git blame: {count}ブロック | b: 親でblame | q: 閉じる",
|
|
169
|
+
"status.move_to_line": "まずカーソルをblame行に移動してください",
|
|
170
|
+
"status.not_committed": "この行はまだコミットされていません",
|
|
171
|
+
"status.loading_parent": "{hash}^でblameを読み込み中...",
|
|
172
|
+
"status.cannot_go_back": "{hash}^でblameを取得できません(初期コミットかファイルが存在しなかった可能性があります)",
|
|
173
|
+
"status.blame_at_parent": "Git blame {hash}^ | 深さ: {depth} | b: さらに深く | q: 閉じる",
|
|
174
|
+
"status.hash_copied": "コピーしました: {short} ({full})",
|
|
175
|
+
"status.hash_display": "ハッシュ: {hash}",
|
|
176
|
+
"status.git_error": "Git blameエラー: {error}",
|
|
177
|
+
|
|
178
|
+
"time.just_now": "たった今",
|
|
179
|
+
"time.minutes_ago": "{count}分前",
|
|
180
|
+
"time.minutes_ago_plural": "{count}分前",
|
|
181
|
+
"time.hours_ago": "{count}時間前",
|
|
182
|
+
"time.hours_ago_plural": "{count}時間前",
|
|
183
|
+
"time.days_ago": "{count}日前",
|
|
184
|
+
"time.days_ago_plural": "{count}日前",
|
|
185
|
+
"time.weeks_ago": "{count}週間前",
|
|
186
|
+
"time.weeks_ago_plural": "{count}週間前",
|
|
187
|
+
"time.months_ago": "{count}ヶ月前",
|
|
188
|
+
"time.months_ago_plural": "{count}ヶ月前",
|
|
189
|
+
"time.years_ago": "{count}年前",
|
|
190
|
+
"time.years_ago_plural": "{count}年前"
|
|
191
|
+
},
|
|
192
|
+
"zh": {
|
|
193
|
+
"cmd.git_blame": "Git Blame",
|
|
194
|
+
"cmd.git_blame_desc": "显示当前文件的git blame(magit风格)",
|
|
195
|
+
"cmd.git_blame_close": "Git Blame: 关闭",
|
|
196
|
+
"cmd.git_blame_close_desc": "关闭git blame面板",
|
|
197
|
+
"cmd.git_blame_go_back": "Git Blame: 返回",
|
|
198
|
+
"cmd.git_blame_go_back_desc": "显示当前行的父提交的blame",
|
|
199
|
+
|
|
200
|
+
"status.already_open": "Git blame已经打开",
|
|
201
|
+
"status.loading": "正在加载git blame...",
|
|
202
|
+
"status.no_file": "没有打开的文件可以blame",
|
|
203
|
+
"status.no_blame_info": "没有可用的blame信息(不是git文件或出错)",
|
|
204
|
+
"status.failed_open": "无法打开git blame面板",
|
|
205
|
+
"status.closed": "Git blame已关闭",
|
|
206
|
+
"status.blame_ready": "Git blame: {count}个块 | b: 在父提交blame | q: 关闭",
|
|
207
|
+
"status.move_to_line": "请先将光标移动到blame行",
|
|
208
|
+
"status.not_committed": "此行尚未提交",
|
|
209
|
+
"status.loading_parent": "正在加载{hash}^的blame...",
|
|
210
|
+
"status.cannot_go_back": "无法获取{hash}^的blame(可能是初始提交或文件不存在)",
|
|
211
|
+
"status.blame_at_parent": "Git blame {hash}^ | 深度: {depth} | b: 更深入 | q: 关闭",
|
|
212
|
+
"status.hash_copied": "已复制: {short} ({full})",
|
|
213
|
+
"status.hash_display": "哈希: {hash}",
|
|
214
|
+
"status.git_error": "Git blame错误: {error}",
|
|
215
|
+
|
|
216
|
+
"time.just_now": "刚刚",
|
|
217
|
+
"time.minutes_ago": "{count}分钟前",
|
|
218
|
+
"time.minutes_ago_plural": "{count}分钟前",
|
|
219
|
+
"time.hours_ago": "{count}小时前",
|
|
220
|
+
"time.hours_ago_plural": "{count}小时前",
|
|
221
|
+
"time.days_ago": "{count}天前",
|
|
222
|
+
"time.days_ago_plural": "{count}天前",
|
|
223
|
+
"time.weeks_ago": "{count}周前",
|
|
224
|
+
"time.weeks_ago_plural": "{count}周前",
|
|
225
|
+
"time.months_ago": "{count}个月前",
|
|
226
|
+
"time.months_ago_plural": "{count}个月前",
|
|
227
|
+
"time.years_ago": "{count}年前",
|
|
228
|
+
"time.years_ago_plural": "{count}年前"
|
|
229
|
+
}
|
|
230
|
+
}
|
package/plugins/git_blame.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 Blame Plugin - Magit-style Git Blame Interface
|
|
@@ -125,7 +127,7 @@ async function fetchGitBlame(filePath: string, commit: string | null): Promise<B
|
|
|
125
127
|
const result = await editor.spawnProcess("git", args);
|
|
126
128
|
|
|
127
129
|
if (result.exit_code !== 0) {
|
|
128
|
-
editor.setStatus(
|
|
130
|
+
editor.setStatus(editor.t("status.git_error", { error: result.stderr }));
|
|
129
131
|
return [];
|
|
130
132
|
}
|
|
131
133
|
|
|
@@ -215,25 +217,25 @@ function formatRelativeDate(timestamp: number): string {
|
|
|
215
217
|
const diff = now - timestamp;
|
|
216
218
|
|
|
217
219
|
if (diff < 60) {
|
|
218
|
-
return "
|
|
220
|
+
return editor.t("time.just_now");
|
|
219
221
|
} else if (diff < 3600) {
|
|
220
|
-
const
|
|
221
|
-
return
|
|
222
|
+
const count = Math.floor(diff / 60);
|
|
223
|
+
return editor.t(count > 1 ? "time.minutes_ago_plural" : "time.minutes_ago", { count: String(count) });
|
|
222
224
|
} else if (diff < 86400) {
|
|
223
|
-
const
|
|
224
|
-
return
|
|
225
|
+
const count = Math.floor(diff / 3600);
|
|
226
|
+
return editor.t(count > 1 ? "time.hours_ago_plural" : "time.hours_ago", { count: String(count) });
|
|
225
227
|
} else if (diff < 604800) {
|
|
226
|
-
const
|
|
227
|
-
return
|
|
228
|
+
const count = Math.floor(diff / 86400);
|
|
229
|
+
return editor.t(count > 1 ? "time.days_ago_plural" : "time.days_ago", { count: String(count) });
|
|
228
230
|
} else if (diff < 2592000) {
|
|
229
|
-
const
|
|
230
|
-
return
|
|
231
|
+
const count = Math.floor(diff / 604800);
|
|
232
|
+
return editor.t(count > 1 ? "time.weeks_ago_plural" : "time.weeks_ago", { count: String(count) });
|
|
231
233
|
} else if (diff < 31536000) {
|
|
232
|
-
const
|
|
233
|
-
return
|
|
234
|
+
const count = Math.floor(diff / 2592000);
|
|
235
|
+
return editor.t(count > 1 ? "time.months_ago_plural" : "time.months_ago", { count: String(count) });
|
|
234
236
|
} else {
|
|
235
|
-
const
|
|
236
|
-
return
|
|
237
|
+
const count = Math.floor(diff / 31536000);
|
|
238
|
+
return editor.t(count > 1 ? "time.years_ago_plural" : "time.years_ago", { count: String(count) });
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
241
|
|
|
@@ -404,7 +406,7 @@ function addBlameHeaders(): void {
|
|
|
404
406
|
*/
|
|
405
407
|
globalThis.show_git_blame = async function(): Promise<void> {
|
|
406
408
|
if (blameState.isOpen) {
|
|
407
|
-
editor.setStatus("
|
|
409
|
+
editor.setStatus(editor.t("status.already_open"));
|
|
408
410
|
return;
|
|
409
411
|
}
|
|
410
412
|
|
|
@@ -412,11 +414,11 @@ globalThis.show_git_blame = async function(): Promise<void> {
|
|
|
412
414
|
const activeBufferId = editor.getActiveBufferId();
|
|
413
415
|
const filePath = editor.getBufferPath(activeBufferId);
|
|
414
416
|
if (!filePath || filePath === "") {
|
|
415
|
-
editor.setStatus("
|
|
417
|
+
editor.setStatus(editor.t("status.no_file"));
|
|
416
418
|
return;
|
|
417
419
|
}
|
|
418
420
|
|
|
419
|
-
editor.setStatus("
|
|
421
|
+
editor.setStatus(editor.t("status.loading"));
|
|
420
422
|
|
|
421
423
|
// Store state before opening blame
|
|
422
424
|
blameState.splitId = editor.getActiveSplitId();
|
|
@@ -432,7 +434,7 @@ globalThis.show_git_blame = async function(): Promise<void> {
|
|
|
432
434
|
]);
|
|
433
435
|
|
|
434
436
|
if (blameLines.length === 0) {
|
|
435
|
-
editor.setStatus(
|
|
437
|
+
editor.setStatus(editor.t("status.no_blame_info"));
|
|
436
438
|
resetState();
|
|
437
439
|
return;
|
|
438
440
|
}
|
|
@@ -494,11 +496,11 @@ globalThis.show_git_blame = async function(): Promise<void> {
|
|
|
494
496
|
// Add virtual lines for blame headers (persistent state model)
|
|
495
497
|
addBlameHeaders();
|
|
496
498
|
|
|
497
|
-
editor.setStatus(
|
|
499
|
+
editor.setStatus(editor.t("status.blame_ready", { count: String(blameState.blocks.length) }));
|
|
498
500
|
editor.debug("Git blame panel opened with virtual lines architecture");
|
|
499
501
|
} else {
|
|
500
502
|
resetState();
|
|
501
|
-
editor.setStatus("
|
|
503
|
+
editor.setStatus(editor.t("status.failed_open"));
|
|
502
504
|
}
|
|
503
505
|
};
|
|
504
506
|
|
|
@@ -538,7 +540,7 @@ globalThis.git_blame_close = function(): void {
|
|
|
538
540
|
blameState.bufferId = null;
|
|
539
541
|
resetState();
|
|
540
542
|
|
|
541
|
-
editor.setStatus("
|
|
543
|
+
editor.setStatus(editor.t("status.closed"));
|
|
542
544
|
};
|
|
543
545
|
|
|
544
546
|
/**
|
|
@@ -569,17 +571,17 @@ globalThis.git_blame_go_back = async function(): Promise<void> {
|
|
|
569
571
|
|
|
570
572
|
const currentHash = getCommitAtCursor();
|
|
571
573
|
if (!currentHash) {
|
|
572
|
-
editor.setStatus("
|
|
574
|
+
editor.setStatus(editor.t("status.move_to_line"));
|
|
573
575
|
return;
|
|
574
576
|
}
|
|
575
577
|
|
|
576
578
|
// Skip if this is the "not committed yet" hash (all zeros)
|
|
577
579
|
if (currentHash === "0000000000000000000000000000000000000000") {
|
|
578
|
-
editor.setStatus("
|
|
580
|
+
editor.setStatus(editor.t("status.not_committed"));
|
|
579
581
|
return;
|
|
580
582
|
}
|
|
581
583
|
|
|
582
|
-
editor.setStatus(
|
|
584
|
+
editor.setStatus(editor.t("status.loading_parent", { hash: currentHash.slice(0, 7) }));
|
|
583
585
|
|
|
584
586
|
// Get the parent commit
|
|
585
587
|
const parentCommit = `${currentHash}^`;
|
|
@@ -600,7 +602,7 @@ globalThis.git_blame_go_back = async function(): Promise<void> {
|
|
|
600
602
|
if (blameLines.length === 0) {
|
|
601
603
|
// Pop the stack since we couldn't navigate
|
|
602
604
|
blameState.commitStack.pop();
|
|
603
|
-
editor.setStatus(
|
|
605
|
+
editor.setStatus(editor.t("status.cannot_go_back", { hash: currentHash.slice(0, 7) }));
|
|
604
606
|
return;
|
|
605
607
|
}
|
|
606
608
|
|
|
@@ -641,7 +643,7 @@ globalThis.git_blame_go_back = async function(): Promise<void> {
|
|
|
641
643
|
}
|
|
642
644
|
|
|
643
645
|
const depth = blameState.commitStack.length;
|
|
644
|
-
editor.setStatus(
|
|
646
|
+
editor.setStatus(editor.t("status.blame_at_parent", { hash: currentHash.slice(0, 7), depth: String(depth) }));
|
|
645
647
|
};
|
|
646
648
|
|
|
647
649
|
/**
|
|
@@ -652,23 +654,23 @@ globalThis.git_blame_copy_hash = function(): void {
|
|
|
652
654
|
|
|
653
655
|
const hash = getCommitAtCursor();
|
|
654
656
|
if (!hash) {
|
|
655
|
-
editor.setStatus("
|
|
657
|
+
editor.setStatus(editor.t("status.move_to_line"));
|
|
656
658
|
return;
|
|
657
659
|
}
|
|
658
660
|
|
|
659
661
|
// Skip if this is the "not committed yet" hash
|
|
660
662
|
if (hash === "0000000000000000000000000000000000000000") {
|
|
661
|
-
editor.setStatus("
|
|
663
|
+
editor.setStatus(editor.t("status.not_committed"));
|
|
662
664
|
return;
|
|
663
665
|
}
|
|
664
666
|
|
|
665
667
|
// Use spawn to copy to clipboard
|
|
666
668
|
editor.spawnProcess("sh", ["-c", `echo -n "${hash}" | xclip -selection clipboard 2>/dev/null || echo -n "${hash}" | pbcopy 2>/dev/null || echo -n "${hash}" | xsel --clipboard 2>/dev/null`])
|
|
667
669
|
.then(() => {
|
|
668
|
-
editor.setStatus(
|
|
670
|
+
editor.setStatus(editor.t("status.hash_copied", { short: hash.slice(0, 7), full: hash }));
|
|
669
671
|
})
|
|
670
672
|
.catch(() => {
|
|
671
|
-
editor.setStatus(
|
|
673
|
+
editor.setStatus(editor.t("status.hash_display", { hash }));
|
|
672
674
|
});
|
|
673
675
|
};
|
|
674
676
|
|
|
@@ -677,22 +679,22 @@ globalThis.git_blame_copy_hash = function(): void {
|
|
|
677
679
|
// =============================================================================
|
|
678
680
|
|
|
679
681
|
editor.registerCommand(
|
|
680
|
-
"
|
|
681
|
-
"
|
|
682
|
+
"%cmd.git_blame",
|
|
683
|
+
"%cmd.git_blame_desc",
|
|
682
684
|
"show_git_blame",
|
|
683
685
|
"normal"
|
|
684
686
|
);
|
|
685
687
|
|
|
686
688
|
editor.registerCommand(
|
|
687
|
-
"
|
|
688
|
-
"
|
|
689
|
+
"%cmd.git_blame_close",
|
|
690
|
+
"%cmd.git_blame_close_desc",
|
|
689
691
|
"git_blame_close",
|
|
690
692
|
"normal"
|
|
691
693
|
);
|
|
692
694
|
|
|
693
695
|
editor.registerCommand(
|
|
694
|
-
"
|
|
695
|
-
"
|
|
696
|
+
"%cmd.git_blame_go_back",
|
|
697
|
+
"%cmd.git_blame_go_back_desc",
|
|
696
698
|
"git_blame_go_back",
|
|
697
699
|
"normal"
|
|
698
700
|
);
|
|
@@ -701,5 +703,5 @@ editor.registerCommand(
|
|
|
701
703
|
// Plugin Initialization
|
|
702
704
|
// =============================================================================
|
|
703
705
|
|
|
704
|
-
editor.setStatus(
|
|
706
|
+
editor.setStatus(editor.t("status.ready"));
|
|
705
707
|
editor.debug("Git Blame plugin initialized - Use 'Git Blame' command to open");
|
|
@@ -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
|
+
}
|