@involvex/fresh-editor 0.1.76 → 0.1.78

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.
Files changed (90) hide show
  1. package/bin/CHANGELOG.md +1017 -0
  2. package/bin/LICENSE +117 -0
  3. package/bin/README.md +248 -0
  4. package/bin/fresh.exe +0 -0
  5. package/bin/plugins/README.md +71 -0
  6. package/bin/plugins/audit_mode.i18n.json +821 -0
  7. package/bin/plugins/audit_mode.ts +1810 -0
  8. package/bin/plugins/buffer_modified.i18n.json +67 -0
  9. package/bin/plugins/buffer_modified.ts +281 -0
  10. package/bin/plugins/calculator.i18n.json +93 -0
  11. package/bin/plugins/calculator.ts +770 -0
  12. package/bin/plugins/clangd-lsp.ts +168 -0
  13. package/bin/plugins/clangd_support.i18n.json +223 -0
  14. package/bin/plugins/clangd_support.md +20 -0
  15. package/bin/plugins/clangd_support.ts +325 -0
  16. package/bin/plugins/color_highlighter.i18n.json +145 -0
  17. package/bin/plugins/color_highlighter.ts +304 -0
  18. package/bin/plugins/config-schema.json +768 -0
  19. package/bin/plugins/csharp-lsp.ts +147 -0
  20. package/bin/plugins/csharp_support.i18n.json +80 -0
  21. package/bin/plugins/csharp_support.ts +170 -0
  22. package/bin/plugins/css-lsp.ts +143 -0
  23. package/bin/plugins/diagnostics_panel.i18n.json +236 -0
  24. package/bin/plugins/diagnostics_panel.ts +642 -0
  25. package/bin/plugins/examples/README.md +85 -0
  26. package/bin/plugins/examples/async_demo.ts +165 -0
  27. package/bin/plugins/examples/bookmarks.ts +329 -0
  28. package/bin/plugins/examples/buffer_query_demo.ts +110 -0
  29. package/bin/plugins/examples/git_grep.ts +262 -0
  30. package/bin/plugins/examples/hello_world.ts +93 -0
  31. package/bin/plugins/examples/virtual_buffer_demo.ts +116 -0
  32. package/bin/plugins/find_references.i18n.json +275 -0
  33. package/bin/plugins/find_references.ts +359 -0
  34. package/bin/plugins/git_blame.i18n.json +496 -0
  35. package/bin/plugins/git_blame.ts +707 -0
  36. package/bin/plugins/git_find_file.i18n.json +314 -0
  37. package/bin/plugins/git_find_file.ts +300 -0
  38. package/bin/plugins/git_grep.i18n.json +171 -0
  39. package/bin/plugins/git_grep.ts +191 -0
  40. package/bin/plugins/git_gutter.i18n.json +93 -0
  41. package/bin/plugins/git_gutter.ts +477 -0
  42. package/bin/plugins/git_log.i18n.json +481 -0
  43. package/bin/plugins/git_log.ts +1285 -0
  44. package/bin/plugins/go-lsp.ts +143 -0
  45. package/bin/plugins/html-lsp.ts +145 -0
  46. package/bin/plugins/json-lsp.ts +145 -0
  47. package/bin/plugins/lib/fresh.d.ts +1321 -0
  48. package/bin/plugins/lib/index.ts +24 -0
  49. package/bin/plugins/lib/navigation-controller.ts +214 -0
  50. package/bin/plugins/lib/panel-manager.ts +220 -0
  51. package/bin/plugins/lib/types.ts +72 -0
  52. package/bin/plugins/lib/virtual-buffer-factory.ts +130 -0
  53. package/bin/plugins/live_grep.i18n.json +171 -0
  54. package/bin/plugins/live_grep.ts +422 -0
  55. package/bin/plugins/markdown_compose.i18n.json +223 -0
  56. package/bin/plugins/markdown_compose.ts +630 -0
  57. package/bin/plugins/merge_conflict.i18n.json +821 -0
  58. package/bin/plugins/merge_conflict.ts +1810 -0
  59. package/bin/plugins/path_complete.i18n.json +80 -0
  60. package/bin/plugins/path_complete.ts +165 -0
  61. package/bin/plugins/python-lsp.ts +162 -0
  62. package/bin/plugins/rust-lsp.ts +166 -0
  63. package/bin/plugins/search_replace.i18n.json +405 -0
  64. package/bin/plugins/search_replace.ts +484 -0
  65. package/bin/plugins/test_i18n.i18n.json +67 -0
  66. package/bin/plugins/test_i18n.ts +18 -0
  67. package/bin/plugins/theme_editor.i18n.json +3746 -0
  68. package/bin/plugins/theme_editor.ts +2063 -0
  69. package/bin/plugins/todo_highlighter.i18n.json +184 -0
  70. package/bin/plugins/todo_highlighter.ts +206 -0
  71. package/bin/plugins/typescript-lsp.ts +167 -0
  72. package/bin/plugins/vi_mode.i18n.json +1549 -0
  73. package/bin/plugins/vi_mode.ts +2747 -0
  74. package/bin/plugins/welcome.i18n.json +236 -0
  75. package/bin/plugins/welcome.ts +76 -0
  76. package/bin/themes/dark.json +102 -0
  77. package/bin/themes/dracula.json +62 -0
  78. package/bin/themes/high-contrast.json +102 -0
  79. package/bin/themes/light.json +102 -0
  80. package/bin/themes/nord.json +62 -0
  81. package/bin/themes/nostalgia.json +102 -0
  82. package/bin/themes/solarized-dark.json +62 -0
  83. package/binary-install.js +1 -1
  84. package/dist/bin/fresh.js +9 -0
  85. package/dist/binary-install.js +149 -0
  86. package/dist/binary.js +30 -0
  87. package/dist/fresh-6yhknp07.exe +0 -0
  88. package/dist/install.js +158 -0
  89. package/dist/run-fresh.js +43 -0
  90. package/package.json +7 -2
@@ -0,0 +1,314 @@
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
+ "cs": {
27
+ "cmd.find": "Git Najit Soubor",
28
+ "cmd.find_desc": "Najit a otevrit soubor sledovany gitem",
29
+ "cmd.reload": "Git Najit Soubor: Znovu nacist",
30
+ "cmd.reload_desc": "Znovu nacist index git souboru",
31
+ "cmd.count": "Git Najit Soubor: Pocet",
32
+ "cmd.count_desc": "Zobrazit pocet indexovanych git souboru",
33
+ "prompt.find_file": "Najit soubor: ",
34
+ "status.ready": "Plugin Git Najit Soubor pripraven",
35
+ "status.loading": "Nacitam git soubory...",
36
+ "status.indexed": "Git Najit Soubor: %{count} souboru indexovano",
37
+ "status.error_loading": "Chyba pri nacitani git souboru: %{error}",
38
+ "status.failed_load": "Nepodarilo se nacist git soubory",
39
+ "status.no_files": "Nebyly nalezeny zadne soubory sledovane gitem",
40
+ "status.files_available": "%{count} souboru k dispozici - piste pro filtrovani",
41
+ "status.showing_first": "Zobrazuji prvnich %{shown} z %{total} souboru",
42
+ "status.found_matching": "Nalezeno %{count} souboru odpovidajicich \"%{query}\"",
43
+ "status.no_matching": "Zadne soubory neodpovidaji \"%{query}\"",
44
+ "status.opened": "Otevreno: %{file}",
45
+ "status.file_not_found": "Soubor nenalezen: %{file}",
46
+ "status.no_selection": "Zadny soubor nevybran",
47
+ "status.cancelled": "Hledani souboru zruseno",
48
+ "status.no_files_loaded": "Zadne git soubory nacteny. Pouzijte 'Git Najit Soubor: Znovu nacist' pro indexovani."
49
+ },
50
+ "de": {
51
+ "cmd.find": "Git Datei Finden",
52
+ "cmd.find_desc": "Git-verfolgte Datei suchen und oeffnen",
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 verfuegbar - tippen zum Filtern",
65
+ "status.showing_first": "Zeige erste %{shown} von %{total} Dateien",
66
+ "status.found_matching": "%{count} Dateien gefunden fuer \"%{query}\"",
67
+ "status.no_matching": "Keine Dateien fuer \"%{query}\"",
68
+ "status.opened": "Geoeffnet: %{file}",
69
+ "status.file_not_found": "Datei nicht gefunden: %{file}",
70
+ "status.no_selection": "Keine Datei ausgewaehlt",
71
+ "status.cancelled": "Dateisuche abgebrochen",
72
+ "status.no_files_loaded": "Keine Git-Dateien geladen. 'Git Datei Finden: Neu laden' zum Indexieren."
73
+ },
74
+ "es": {
75
+ "cmd.find": "Git Buscar Archivo",
76
+ "cmd.find_desc": "Buscar y abrir un archivo rastreado por git",
77
+ "cmd.reload": "Git Buscar Archivo: Recargar",
78
+ "cmd.reload_desc": "Recargar el indice de archivos git",
79
+ "cmd.count": "Git Buscar Archivo: Contar",
80
+ "cmd.count_desc": "Mostrar numero de archivos git indexados",
81
+ "prompt.find_file": "Buscar archivo: ",
82
+ "status.ready": "Plugin Git Buscar Archivo listo",
83
+ "status.loading": "Cargando archivos git...",
84
+ "status.indexed": "Git Buscar Archivo: %{count} archivos indexados",
85
+ "status.error_loading": "Error cargando archivos git: %{error}",
86
+ "status.failed_load": "Error al cargar archivos git",
87
+ "status.no_files": "No se encontraron archivos rastreados por git",
88
+ "status.files_available": "%{count} archivos disponibles - escribe para filtrar",
89
+ "status.showing_first": "Mostrando primeros %{shown} de %{total} archivos",
90
+ "status.found_matching": "Encontrados %{count} archivos coincidentes con \"%{query}\"",
91
+ "status.no_matching": "Ningun archivo coincide con \"%{query}\"",
92
+ "status.opened": "Abierto %{file}",
93
+ "status.file_not_found": "Archivo no encontrado: %{file}",
94
+ "status.no_selection": "Ningun archivo seleccionado",
95
+ "status.cancelled": "Buscador de archivos cancelado",
96
+ "status.no_files_loaded": "No hay archivos git cargados. Usa 'Git Buscar Archivo: Recargar' para indexar."
97
+ },
98
+ "fr": {
99
+ "cmd.find": "Git Trouver Fichier",
100
+ "cmd.find_desc": "Trouver et ouvrir un fichier suivi par git",
101
+ "cmd.reload": "Git Trouver Fichier: Recharger",
102
+ "cmd.reload_desc": "Recharger l'index des fichiers git",
103
+ "cmd.count": "Git Trouver Fichier: Compter",
104
+ "cmd.count_desc": "Afficher le nombre de fichiers git indexes",
105
+ "prompt.find_file": "Trouver fichier: ",
106
+ "status.ready": "Plugin Git Trouver Fichier pret",
107
+ "status.loading": "Chargement des fichiers git...",
108
+ "status.indexed": "Git Trouver Fichier: %{count} fichiers indexes",
109
+ "status.error_loading": "Erreur chargement fichiers git: %{error}",
110
+ "status.failed_load": "Echec du chargement des fichiers git",
111
+ "status.no_files": "Aucun fichier suivi par git trouve",
112
+ "status.files_available": "%{count} fichiers disponibles - tapez pour filtrer",
113
+ "status.showing_first": "Affichage des %{shown} premiers sur %{total} fichiers",
114
+ "status.found_matching": "%{count} fichiers trouves pour \"%{query}\"",
115
+ "status.no_matching": "Aucun fichier pour \"%{query}\"",
116
+ "status.opened": "Ouvert: %{file}",
117
+ "status.file_not_found": "Fichier non trouve: %{file}",
118
+ "status.no_selection": "Aucun fichier selectionne",
119
+ "status.cancelled": "Recherche annulee",
120
+ "status.no_files_loaded": "Aucun fichier git charge. Utilisez 'Git Trouver Fichier: Recharger'."
121
+ },
122
+ "it": {
123
+ "cmd.find": "Git: Trova file",
124
+ "cmd.find_desc": "Trova e apri un file tracciato da git",
125
+ "cmd.reload": "Git: Ricarica file",
126
+ "cmd.reload_desc": "Ricarica l'indice dei file git",
127
+ "cmd.count": "Git: Conta file",
128
+ "cmd.count_desc": "Mostra il numero di file git indicizzati",
129
+ "prompt.find_file": "Trova file: ",
130
+ "status.ready": "Plugin Trova file git pronto",
131
+ "status.loading": "Caricamento file git...",
132
+ "status.indexed": "Git: %{count} file indicizzati",
133
+ "status.error_loading": "Errore nel caricamento dei file git: %{error}",
134
+ "status.failed_load": "Caricamento file git fallito",
135
+ "status.no_files": "Nessun file tracciato da git trovato",
136
+ "status.files_available": "%{count} file disponibili - scrivi per filtrare",
137
+ "status.showing_first": "Visualizzazione dei primi %{shown} di %{total} file",
138
+ "status.found_matching": "Trovati %{count} file corrispondenti a \"%{query}\"",
139
+ "status.no_matching": "Nessun file corrispondente a \"%{query}\"",
140
+ "status.opened": "Aperto %{file}",
141
+ "status.file_not_found": "File non trovato: %{file}",
142
+ "status.no_selection": "Nessun file selezionato",
143
+ "status.cancelled": "Ricerca file annullata",
144
+ "status.no_files_loaded": "Nessun file git caricato. Usa 'Git: Ricarica file' per indicizzare i file."
145
+ },
146
+ "ja": {
147
+ "cmd.find": "Gitファイル検索",
148
+ "cmd.find_desc": "Git追跡ファイルを検索して開く",
149
+ "cmd.reload": "Gitファイル検索: 再読み込み",
150
+ "cmd.reload_desc": "Gitファイルインデックスを再読み込み",
151
+ "cmd.count": "Gitファイル検索: カウント",
152
+ "cmd.count_desc": "インデックス済みGitファイル数を表示",
153
+ "prompt.find_file": "ファイル検索: ",
154
+ "status.ready": "Gitファイル検索プラグイン準備完了",
155
+ "status.loading": "Gitファイルを読み込み中...",
156
+ "status.indexed": "Gitファイル検索: %{count}ファイルをインデックス",
157
+ "status.error_loading": "Gitファイル読み込みエラー: %{error}",
158
+ "status.failed_load": "Gitファイルの読み込みに失敗",
159
+ "status.no_files": "Git追跡ファイルが見つかりません",
160
+ "status.files_available": "%{count}ファイル利用可能 - 入力してフィルタ",
161
+ "status.showing_first": "%{total}ファイル中、最初の%{shown}を表示",
162
+ "status.found_matching": "\"%{query}\"に一致する%{count}ファイル",
163
+ "status.no_matching": "\"%{query}\"に一致するファイルなし",
164
+ "status.opened": "開きました: %{file}",
165
+ "status.file_not_found": "ファイルが見つかりません: %{file}",
166
+ "status.no_selection": "ファイルが選択されていません",
167
+ "status.cancelled": "ファイル検索キャンセル",
168
+ "status.no_files_loaded": "Gitファイル未読み込み。'Gitファイル検索: 再読み込み'を使用。"
169
+ },
170
+ "ko": {
171
+ "cmd.find": "Git 파일 찾기",
172
+ "cmd.find_desc": "Git 추적 파일 찾기 및 열기",
173
+ "cmd.reload": "Git 파일 찾기: 새로고침",
174
+ "cmd.reload_desc": "Git 파일 인덱스 새로고침",
175
+ "cmd.count": "Git 파일 찾기: 개수",
176
+ "cmd.count_desc": "인덱싱된 Git 파일 수 표시",
177
+ "prompt.find_file": "파일 찾기: ",
178
+ "status.ready": "Git 파일 찾기 플러그인 준비됨",
179
+ "status.loading": "Git 파일 로딩 중...",
180
+ "status.indexed": "Git 파일 찾기: %{count}개 파일 인덱싱됨",
181
+ "status.error_loading": "Git 파일 로딩 오류: %{error}",
182
+ "status.failed_load": "Git 파일 로드 실패",
183
+ "status.no_files": "Git 추적 파일을 찾을 수 없습니다",
184
+ "status.files_available": "%{count}개 파일 사용 가능 - 입력하여 필터링",
185
+ "status.showing_first": "%{total}개 중 처음 %{shown}개 표시",
186
+ "status.found_matching": "\"%{query}\"와 일치하는 %{count}개 파일 찾음",
187
+ "status.no_matching": "\"%{query}\"와 일치하는 파일 없음",
188
+ "status.opened": "열림: %{file}",
189
+ "status.file_not_found": "파일을 찾을 수 없음: %{file}",
190
+ "status.no_selection": "선택된 파일 없음",
191
+ "status.cancelled": "파일 찾기 취소됨",
192
+ "status.no_files_loaded": "Git 파일이 로드되지 않음. 'Git 파일 찾기: 새로고침'을 사용하여 인덱싱하세요."
193
+ },
194
+ "pt-BR": {
195
+ "cmd.find": "Git Buscar Arquivo",
196
+ "cmd.find_desc": "Buscar e abrir um arquivo rastreado pelo git",
197
+ "cmd.reload": "Git Buscar Arquivo: Recarregar",
198
+ "cmd.reload_desc": "Recarregar o indice de arquivos git",
199
+ "cmd.count": "Git Buscar Arquivo: Contagem",
200
+ "cmd.count_desc": "Mostrar numero de arquivos git indexados",
201
+ "prompt.find_file": "Buscar arquivo: ",
202
+ "status.ready": "Plugin Git Buscar Arquivo pronto",
203
+ "status.loading": "Carregando arquivos git...",
204
+ "status.indexed": "Git Buscar Arquivo: %{count} arquivos indexados",
205
+ "status.error_loading": "Erro ao carregar arquivos git: %{error}",
206
+ "status.failed_load": "Falha ao carregar arquivos git",
207
+ "status.no_files": "Nenhum arquivo rastreado pelo git encontrado",
208
+ "status.files_available": "%{count} arquivos disponiveis - digite para filtrar",
209
+ "status.showing_first": "Mostrando primeiros %{shown} de %{total} arquivos",
210
+ "status.found_matching": "Encontrados %{count} arquivos correspondentes a \"%{query}\"",
211
+ "status.no_matching": "Nenhum arquivo corresponde a \"%{query}\"",
212
+ "status.opened": "Aberto: %{file}",
213
+ "status.file_not_found": "Arquivo nao encontrado: %{file}",
214
+ "status.no_selection": "Nenhum arquivo selecionado",
215
+ "status.cancelled": "Busca de arquivo cancelada",
216
+ "status.no_files_loaded": "Nenhum arquivo git carregado. Use 'Git Buscar Arquivo: Recarregar' para indexar."
217
+ },
218
+ "ru": {
219
+ "cmd.find": "Git Nayti Fayl",
220
+ "cmd.find_desc": "Nayti i otkryt' fayl otslezhivaemyy git",
221
+ "cmd.reload": "Git Nayti Fayl: Perezagruzit'",
222
+ "cmd.reload_desc": "Perezagruzit' indeks git faylov",
223
+ "cmd.count": "Git Nayti Fayl: Kolichestvo",
224
+ "cmd.count_desc": "Pokazat' kolichestvo proindeksirovannykh git faylov",
225
+ "prompt.find_file": "Nayti fayl: ",
226
+ "status.ready": "Plugin Git Nayti Fayl gotov",
227
+ "status.loading": "Zagruzka git faylov...",
228
+ "status.indexed": "Git Nayti Fayl: %{count} faylov proindeksirovano",
229
+ "status.error_loading": "Oshibka zagruzki git faylov: %{error}",
230
+ "status.failed_load": "Ne udalos' zagruzit' git fayly",
231
+ "status.no_files": "Git otslezhivaemye fayly ne naydeny",
232
+ "status.files_available": "%{count} faylov dostupno - vvedite dlya fil'tratsii",
233
+ "status.showing_first": "Pokazany pervye %{shown} iz %{total} faylov",
234
+ "status.found_matching": "Naydeno %{count} faylov sootvetstvuyushchikh \"%{query}\"",
235
+ "status.no_matching": "Net faylov sootvetstvuyushchikh \"%{query}\"",
236
+ "status.opened": "Otkryto: %{file}",
237
+ "status.file_not_found": "Fayl ne nayden: %{file}",
238
+ "status.no_selection": "Fayl ne vybran",
239
+ "status.cancelled": "Poisk fayla otmenen",
240
+ "status.no_files_loaded": "Git fayly ne zagruzheny. Ispol'zuyte 'Git Nayti Fayl: Perezagruzit'' dlya indeksatsii."
241
+ },
242
+ "th": {
243
+ "cmd.find": "Git ค้นหาไฟล์",
244
+ "cmd.find_desc": "ค้นหาและเปิดไฟล์ที่ git ติดตาม",
245
+ "cmd.reload": "Git ค้นหาไฟล์: โหลดใหม่",
246
+ "cmd.reload_desc": "โหลดดัชนีไฟล์ git ใหม่",
247
+ "cmd.count": "Git ค้นหาไฟล์: นับ",
248
+ "cmd.count_desc": "แสดงจำนวนไฟล์ git ที่จัดทำดัชนีแล้ว",
249
+ "prompt.find_file": "ค้นหาไฟล์: ",
250
+ "status.ready": "ปลั๊กอิน Git ค้นหาไฟล์พร้อมใช้งาน",
251
+ "status.loading": "กำลังโหลดไฟล์ git...",
252
+ "status.indexed": "Git ค้นหาไฟล์: จัดทำดัชนี %{count} ไฟล์แล้ว",
253
+ "status.error_loading": "ข้อผิดพลาดในการโหลดไฟล์ git: %{error}",
254
+ "status.failed_load": "โหลดไฟล์ git ไม่สำเร็จ",
255
+ "status.no_files": "ไม่พบไฟล์ที่ git ติดตาม",
256
+ "status.files_available": "%{count} ไฟล์พร้อมใช้งาน - พิมพ์เพื่อกรอง",
257
+ "status.showing_first": "แสดง %{shown} แรกจาก %{total} ไฟล์",
258
+ "status.found_matching": "พบ %{count} ไฟล์ที่ตรงกับ \"%{query}\"",
259
+ "status.no_matching": "ไม่มีไฟล์ที่ตรงกับ \"%{query}\"",
260
+ "status.opened": "เปิดแล้ว: %{file}",
261
+ "status.file_not_found": "ไม่พบไฟล์: %{file}",
262
+ "status.no_selection": "ไม่ได้เลือกไฟล์",
263
+ "status.cancelled": "ยกเลิกการค้นหาไฟล์",
264
+ "status.no_files_loaded": "ไม่มีไฟล์ git ที่โหลด ใช้ 'Git ค้นหาไฟล์: โหลดใหม่' เพื่อจัดทำดัชนี"
265
+ },
266
+ "uk": {
267
+ "cmd.find": "Git Znayty Fayl",
268
+ "cmd.find_desc": "Znayty i vidkryty fayl vidstezhuvanyy git",
269
+ "cmd.reload": "Git Znayty Fayl: Perezavantazhyty",
270
+ "cmd.reload_desc": "Perezavantazhyty indeks git fayliv",
271
+ "cmd.count": "Git Znayty Fayl: Kil'kist'",
272
+ "cmd.count_desc": "Pokazaty kil'kist' proindeksovanykh git fayliv",
273
+ "prompt.find_file": "Znayty fayl: ",
274
+ "status.ready": "Plahin Git Znayty Fayl hotovyy",
275
+ "status.loading": "Zavantazhennya git fayliv...",
276
+ "status.indexed": "Git Znayty Fayl: %{count} fayliv proindeksovano",
277
+ "status.error_loading": "Pomylka zavantazhennya git fayliv: %{error}",
278
+ "status.failed_load": "Ne vdalosya zavantazhyty git fayly",
279
+ "status.no_files": "Git vidstezhuvani fayly ne znaydeno",
280
+ "status.files_available": "%{count} fayliv dostupno - vvedit' dlya fil'tratsiyi",
281
+ "status.showing_first": "Pokazano pershi %{shown} z %{total} fayliv",
282
+ "status.found_matching": "Znaydeno %{count} fayliv shcho vidpovidayut' \"%{query}\"",
283
+ "status.no_matching": "Nemaye fayliv shcho vidpovidayut' \"%{query}\"",
284
+ "status.opened": "Vidkryto: %{file}",
285
+ "status.file_not_found": "Fayl ne znayden: %{file}",
286
+ "status.no_selection": "Fayl ne vybrano",
287
+ "status.cancelled": "Poshuk faylu skasovano",
288
+ "status.no_files_loaded": "Git fayly ne zavantazheni. Vykorystovuyte 'Git Znayty Fayl: Perezavantazhyty' dlya indeksatsiyi."
289
+ },
290
+ "zh-CN": {
291
+ "cmd.find": "Git查找文件",
292
+ "cmd.find_desc": "查找并打开Git跟踪的文件",
293
+ "cmd.reload": "Git查找文件: 重新加载",
294
+ "cmd.reload_desc": "重新加载Git文件索引",
295
+ "cmd.count": "Git查找文件: 计数",
296
+ "cmd.count_desc": "显示已索引的Git文件数量",
297
+ "prompt.find_file": "查找文件: ",
298
+ "status.ready": "Git查找文件插件已就绪",
299
+ "status.loading": "正在加载Git文件...",
300
+ "status.indexed": "Git查找文件: 已索引%{count}个文件",
301
+ "status.error_loading": "加载Git文件错误: %{error}",
302
+ "status.failed_load": "加载Git文件失败",
303
+ "status.no_files": "未找到Git跟踪的文件",
304
+ "status.files_available": "%{count}个文件可用 - 输入以筛选",
305
+ "status.showing_first": "显示%{total}个文件中的前%{shown}个",
306
+ "status.found_matching": "找到%{count}个匹配\"%{query}\"的文件",
307
+ "status.no_matching": "没有匹配\"%{query}\"的文件",
308
+ "status.opened": "已打开: %{file}",
309
+ "status.file_not_found": "文件未找到: %{file}",
310
+ "status.no_selection": "未选择文件",
311
+ "status.cancelled": "文件查找已取消",
312
+ "status.no_files_loaded": "未加载Git文件。使用'Git查找文件: 重新加载'进行索引。"
313
+ }
314
+ }
@@ -0,0 +1,300 @@
1
+ /// <reference path="../types/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
4
+
5
+ /**
6
+ * Git Find File Plugin
7
+ *
8
+ * Provides interactive file finding functionality with fuzzy search
9
+ * for git-tracked files. Uses the prompt API for interactive selection.
10
+ */
11
+
12
+ // State management
13
+ let allFiles: string[] = [];
14
+ let filteredFiles: string[] = [];
15
+ let isLoading = false;
16
+
17
+ // Simple fuzzy filter function
18
+ function fuzzyMatch(str: string, pattern: string): boolean {
19
+ if (pattern === "") {
20
+ return true;
21
+ }
22
+
23
+ str = str.toLowerCase();
24
+ pattern = pattern.toLowerCase();
25
+
26
+ let strIdx = 0;
27
+ let patIdx = 0;
28
+
29
+ while (strIdx < str.length && patIdx < pattern.length) {
30
+ if (str[strIdx] === pattern[patIdx]) {
31
+ patIdx++;
32
+ }
33
+ strIdx++;
34
+ }
35
+
36
+ return patIdx >= pattern.length;
37
+ }
38
+
39
+ // Score a fuzzy match (higher is better)
40
+ function fuzzyScore(str: string, pattern: string): number {
41
+ if (pattern === "") return 0;
42
+
43
+ str = str.toLowerCase();
44
+ pattern = pattern.toLowerCase();
45
+
46
+ let score = 0;
47
+ let strIdx = 0;
48
+ let patIdx = 0;
49
+ let consecutiveMatches = 0;
50
+ let lastMatchIdx = -1;
51
+
52
+ while (strIdx < str.length && patIdx < pattern.length) {
53
+ if (str[strIdx] === pattern[patIdx]) {
54
+ // Bonus for consecutive matches
55
+ if (lastMatchIdx === strIdx - 1) {
56
+ consecutiveMatches++;
57
+ score += consecutiveMatches * 10;
58
+ } else {
59
+ consecutiveMatches = 1;
60
+ score += 1;
61
+ }
62
+
63
+ // Bonus for matching at start of path segments
64
+ if (strIdx === 0 || str[strIdx - 1] === "/" || str[strIdx - 1] === "_" || str[strIdx - 1] === "-") {
65
+ score += 15;
66
+ }
67
+
68
+ // Bonus for matching filename (after last /)
69
+ const lastSlash = str.lastIndexOf("/");
70
+ if (strIdx > lastSlash) {
71
+ score += 5;
72
+ }
73
+
74
+ lastMatchIdx = strIdx;
75
+ patIdx++;
76
+ }
77
+ strIdx++;
78
+ }
79
+
80
+ // Penalty for longer paths
81
+ score -= str.length * 0.1;
82
+
83
+ return patIdx >= pattern.length ? score : -1;
84
+ }
85
+
86
+ // Filter and sort files by query using fuzzy matching
87
+ function filterFiles(files: string[], query: string): string[] {
88
+ if (query === "" || query.trim() === "") {
89
+ // Return first 100 files for empty query
90
+ return files.slice(0, 100);
91
+ }
92
+
93
+ const scored: Array<{ file: string; score: number }> = [];
94
+
95
+ for (const file of files) {
96
+ const score = fuzzyScore(file, query);
97
+ if (score > 0) {
98
+ scored.push({ file, score });
99
+ }
100
+
101
+ // Stop early if we have enough high-quality matches
102
+ if (scored.length >= 500) {
103
+ break;
104
+ }
105
+ }
106
+
107
+ // Sort by score descending
108
+ scored.sort((a, b) => b.score - a.score);
109
+
110
+ // Return top 100 results
111
+ return scored.slice(0, 100).map((s) => s.file);
112
+ }
113
+
114
+ // Load git-tracked files asynchronously
115
+ async function loadGitFiles(): Promise<void> {
116
+ if (isLoading) {
117
+ return;
118
+ }
119
+
120
+ isLoading = true;
121
+ editor.setStatus(editor.t("status.loading"));
122
+
123
+ try {
124
+ const result = await editor.spawnProcess("git", ["ls-files"]);
125
+
126
+ if (result.exit_code === 0) {
127
+ allFiles = result.stdout.split("\n").filter((line) => line.trim() !== "");
128
+
129
+ editor.debug(`Loaded ${allFiles.length} git-tracked files`);
130
+ editor.setStatus(editor.t("status.indexed", { count: String(allFiles.length) }));
131
+ } else {
132
+ editor.debug(`Failed to load git files: ${result.stderr}`);
133
+ editor.setStatus(editor.t("status.error_loading", { error: result.stderr }));
134
+ allFiles = [];
135
+ }
136
+ } catch (e) {
137
+ editor.debug(`Exception loading git files: ${e}`);
138
+ editor.setStatus(editor.t("status.failed_load"));
139
+ allFiles = [];
140
+ } finally {
141
+ isLoading = false;
142
+ }
143
+ }
144
+
145
+ // Convert filtered files to prompt suggestions
146
+ function filesToSuggestions(files: string[]): PromptSuggestion[] {
147
+ return files.map((file) => {
148
+ return {
149
+ text: file,
150
+ description: undefined,
151
+ value: file,
152
+ disabled: false,
153
+ };
154
+ });
155
+ }
156
+
157
+ // Global function to start file finder
158
+ globalThis.start_git_find_file = async function (): Promise<void> {
159
+ // Load files if not already loaded
160
+ if (allFiles.length === 0 && !isLoading) {
161
+ await loadGitFiles();
162
+ }
163
+
164
+ if (allFiles.length === 0) {
165
+ editor.setStatus(editor.t("status.no_files"));
166
+ return;
167
+ }
168
+
169
+ // Clear previous results
170
+ filteredFiles = [];
171
+
172
+ // Start the prompt
173
+ editor.startPrompt(editor.t("prompt.find_file"), "git-find-file");
174
+
175
+ // Show initial suggestions (first 100 files)
176
+ const initial = filterFiles(allFiles, "");
177
+ filteredFiles = initial;
178
+ editor.setPromptSuggestions(filesToSuggestions(initial));
179
+ editor.setStatus(editor.t("status.files_available", { count: String(allFiles.length) }));
180
+ };
181
+
182
+ // React to prompt input changes
183
+ globalThis.onGitFindFilePromptChanged = function (args: { prompt_type: string; input: string }): boolean {
184
+ if (args.prompt_type !== "git-find-file") {
185
+ return true; // Not our prompt
186
+ }
187
+
188
+ const query = args.input;
189
+
190
+ // Filter files based on query
191
+ const matches = filterFiles(allFiles, query);
192
+ filteredFiles = matches;
193
+
194
+ // Update suggestions
195
+ editor.setPromptSuggestions(filesToSuggestions(matches));
196
+
197
+ // Update status
198
+ if (matches.length > 0) {
199
+ if (query.trim() === "") {
200
+ editor.setStatus(editor.t("status.showing_first", { shown: String(matches.length), total: String(allFiles.length) }));
201
+ } else {
202
+ editor.setStatus(editor.t("status.found_matching", { count: String(matches.length), query }));
203
+ }
204
+ } else {
205
+ editor.setStatus(editor.t("status.no_matching", { query }));
206
+ }
207
+
208
+ return true;
209
+ };
210
+
211
+ // Handle prompt confirmation (user pressed Enter)
212
+ globalThis.onGitFindFilePromptConfirmed = function (args: {
213
+ prompt_type: string;
214
+ selected_index: number | null;
215
+ input: string;
216
+ }): boolean {
217
+ if (args.prompt_type !== "git-find-file") {
218
+ return true; // Not our prompt
219
+ }
220
+
221
+ editor.debug(`git-find-file confirmed: selected_index=${args.selected_index}, input=${args.input}`);
222
+
223
+ // Check if user selected a suggestion
224
+ if (args.selected_index !== null && filteredFiles[args.selected_index]) {
225
+ const selectedFile = filteredFiles[args.selected_index];
226
+
227
+ editor.debug(`Opening file: ${selectedFile}`);
228
+
229
+ // Open the file at line 1
230
+ editor.openFile(selectedFile, 1, 1);
231
+ editor.setStatus(editor.t("status.opened", { file: selectedFile }));
232
+ } else if (args.input.trim() !== "") {
233
+ // Try to open input directly if it's a valid file path
234
+ const inputFile = args.input.trim();
235
+
236
+ // Check if the exact input matches any file
237
+ if (allFiles.includes(inputFile)) {
238
+ editor.openFile(inputFile, 1, 1);
239
+ editor.setStatus(editor.t("status.opened", { file: inputFile }));
240
+ } else {
241
+ editor.setStatus(editor.t("status.file_not_found", { file: inputFile }));
242
+ }
243
+ } else {
244
+ editor.setStatus(editor.t("status.no_selection"));
245
+ }
246
+
247
+ return true;
248
+ };
249
+
250
+ // Handle prompt cancellation (user pressed Escape)
251
+ globalThis.onGitFindFilePromptCancelled = function (args: { prompt_type: string }): boolean {
252
+ if (args.prompt_type !== "git-find-file") {
253
+ return true; // Not our prompt
254
+ }
255
+
256
+ // Clear results
257
+ filteredFiles = [];
258
+ editor.setStatus(editor.t("status.cancelled"));
259
+
260
+ return true;
261
+ };
262
+
263
+ // Register event handlers
264
+ editor.on("prompt_changed", "onGitFindFilePromptChanged");
265
+ editor.on("prompt_confirmed", "onGitFindFilePromptConfirmed");
266
+ editor.on("prompt_cancelled", "onGitFindFilePromptCancelled");
267
+
268
+ // Reload git files command
269
+ globalThis.git_reload_files = async function (): Promise<void> {
270
+ allFiles = [];
271
+ await loadGitFiles();
272
+ };
273
+
274
+ // Show file count command
275
+ globalThis.git_file_count = function (): void {
276
+ if (allFiles.length === 0) {
277
+ editor.setStatus(editor.t("status.no_files_loaded"));
278
+ } else {
279
+ editor.setStatus(editor.t("status.indexed", { count: String(allFiles.length) }));
280
+ }
281
+ };
282
+
283
+ // Register commands
284
+ editor.registerCommand("%cmd.find", "%cmd.find_desc", "start_git_find_file", "normal");
285
+
286
+ editor.registerCommand(
287
+ "%cmd.reload",
288
+ "%cmd.reload_desc",
289
+ "git_reload_files",
290
+ "normal"
291
+ );
292
+
293
+ editor.registerCommand("%cmd.count", "%cmd.count_desc", "git_file_count", "normal");
294
+
295
+ // Note: We don't load git files on plugin init because spawning processes requires async context
296
+ // Files will be loaded lazily on first use
297
+
298
+ editor.debug("Git Find File plugin loaded successfully (TypeScript)");
299
+ editor.debug("Usage: Call start_git_find_file() or use command palette 'Git Find File'");
300
+ editor.setStatus(editor.t("status.ready"));