@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,67 @@
1
+ {
2
+ "en": {
3
+ "status.loaded": "Buffer Modified plugin loaded",
4
+ "status.initialized": "Buffer Modified: initialized for %{path}",
5
+ "status.cleared_on_save": "Buffer Modified: cleared on save"
6
+ },
7
+ "cs": {
8
+ "status.loaded": "Plugin Buffer Modified nacten",
9
+ "status.initialized": "Buffer Modified: inicializovano pro %{path}",
10
+ "status.cleared_on_save": "Buffer Modified: vymazano pri ulozeni"
11
+ },
12
+ "de": {
13
+ "status.loaded": "Buffer Modified Plugin geladen",
14
+ "status.initialized": "Buffer Modified: initialisiert für %{path}",
15
+ "status.cleared_on_save": "Buffer Modified: beim Speichern gelöscht"
16
+ },
17
+ "es": {
18
+ "status.loaded": "Plugin Buffer Modificado cargado",
19
+ "status.initialized": "Buffer Modificado: inicializado para %{path}",
20
+ "status.cleared_on_save": "Buffer Modificado: limpiado al guardar"
21
+ },
22
+ "fr": {
23
+ "status.loaded": "Plugin Buffer Modified chargé",
24
+ "status.initialized": "Buffer Modified: initialisé pour %{path}",
25
+ "status.cleared_on_save": "Buffer Modified: effacé lors de la sauvegarde"
26
+ },
27
+ "it": {
28
+ "status.loaded": "Plugin Buffer Modified caricato",
29
+ "status.initialized": "Buffer Modified: inizializzato per %{path}",
30
+ "status.cleared_on_save": "Buffer Modified: cancellato al salvataggio"
31
+ },
32
+ "ja": {
33
+ "status.loaded": "Buffer Modifiedプラグインを読み込みました",
34
+ "status.initialized": "Buffer Modified: %{path}を初期化しました",
35
+ "status.cleared_on_save": "Buffer Modified: 保存時にクリアしました"
36
+ },
37
+ "ko": {
38
+ "status.loaded": "Buffer Modified 플러그인이 로드되었습니다",
39
+ "status.initialized": "Buffer Modified: %{path} 초기화됨",
40
+ "status.cleared_on_save": "Buffer Modified: 저장 시 지워짐"
41
+ },
42
+ "pt-BR": {
43
+ "status.loaded": "Plugin Buffer Modified carregado",
44
+ "status.initialized": "Buffer Modified: inicializado para %{path}",
45
+ "status.cleared_on_save": "Buffer Modified: limpo ao salvar"
46
+ },
47
+ "ru": {
48
+ "status.loaded": "Плагин Buffer Modified загружен",
49
+ "status.initialized": "Buffer Modified: инициализирован для %{path}",
50
+ "status.cleared_on_save": "Buffer Modified: очищен при сохранении"
51
+ },
52
+ "th": {
53
+ "status.loaded": "โหลดปลั๊กอิน Buffer Modified แล้ว",
54
+ "status.initialized": "Buffer Modified: เริ่มต้นสำหรับ %{path}",
55
+ "status.cleared_on_save": "Buffer Modified: ล้างเมื่อบันทึก"
56
+ },
57
+ "uk": {
58
+ "status.loaded": "Плагін Buffer Modified завантажено",
59
+ "status.initialized": "Buffer Modified: ініціалізовано для %{path}",
60
+ "status.cleared_on_save": "Buffer Modified: очищено при збереженні"
61
+ },
62
+ "zh-CN": {
63
+ "status.loaded": "Buffer Modified插件已加载",
64
+ "status.initialized": "Buffer Modified: 已为%{path}初始化",
65
+ "status.cleared_on_save": "Buffer Modified: 保存时已清除"
66
+ }
67
+ }
@@ -0,0 +1,281 @@
1
+ /// <reference path="../types/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
4
+
5
+ /**
6
+ * Buffer Modified Plugin
7
+ *
8
+ * Shows indicators in the gutter for lines that have been modified since the last save.
9
+ * This tracks in-memory changes, not git changes.
10
+ *
11
+ * This plugin uses a simpler approach: it marks lines as modified when edits happen
12
+ * (after_insert/after_delete hooks), and clears all modified markers on save.
13
+ * It doesn't compare content - it just tracks which lines have been touched since save.
14
+ *
15
+ * Indicator symbols:
16
+ * - │ (blue): Line has been modified since last save
17
+ */
18
+
19
+ // =============================================================================
20
+ // Constants
21
+ // =============================================================================
22
+
23
+ const NAMESPACE = "buffer-modified";
24
+ const PRIORITY = 5; // Lower than git-gutter (10) and diagnostics
25
+
26
+ // Colors (RGB) - Blue to distinguish from git gutter (green/yellow/red)
27
+ const COLOR = [100, 149, 237] as [number, number, number]; // Cornflower blue
28
+
29
+ // Symbol
30
+ const SYMBOL = "│";
31
+
32
+ // =============================================================================
33
+ // Types
34
+ // =============================================================================
35
+
36
+ interface BufferState {
37
+ /** Whether we're tracking this buffer */
38
+ tracking: boolean;
39
+ }
40
+
41
+ // =============================================================================
42
+ // State
43
+ // =============================================================================
44
+
45
+ /** State per buffer */
46
+ const bufferStates: Map<number, BufferState> = new Map();
47
+
48
+ // =============================================================================
49
+ // Line Tracking
50
+ // =============================================================================
51
+
52
+ /**
53
+ * Initialize state for a buffer (on file open)
54
+ * Starts with no modified lines since file was just loaded
55
+ */
56
+ function initBufferState(bufferId: number): void {
57
+ bufferStates.set(bufferId, {
58
+ tracking: true,
59
+ });
60
+ // Clear any leftover indicators
61
+ editor.clearLineIndicators(bufferId, NAMESPACE);
62
+ }
63
+
64
+ /**
65
+ * Clear modified state for a buffer (on save)
66
+ * Removes all modified markers since buffer now matches disk
67
+ */
68
+ function clearModifiedState(bufferId: number): void {
69
+ editor.clearLineIndicators(bufferId, NAMESPACE);
70
+ }
71
+
72
+ /**
73
+ * Mark a range of lines as modified and set indicators
74
+ *
75
+ * Note: The indicator markers automatically track their byte positions,
76
+ * so we don't need to manually track which lines are modified - we just
77
+ * set indicators and they'll stay on the correct lines as edits happen.
78
+ */
79
+ function markLinesModified(bufferId: number, startLine: number, endLine: number): void {
80
+ const state = bufferStates.get(bufferId);
81
+ if (!state || !state.tracking) return;
82
+
83
+ // Add indicator for each affected line
84
+ // Note: If an indicator already exists at this position, it will be updated
85
+ for (let line = startLine; line <= endLine; line++) {
86
+ editor.setLineIndicator(
87
+ bufferId,
88
+ line,
89
+ NAMESPACE,
90
+ SYMBOL,
91
+ COLOR[0],
92
+ COLOR[1],
93
+ COLOR[2],
94
+ PRIORITY
95
+ );
96
+ }
97
+ }
98
+
99
+ function reapplyIndicatorsFromDiff(bufferId: number): void {
100
+ const diff = editor.getBufferSavedDiff(bufferId);
101
+ if (!diff) return;
102
+
103
+ // If buffer matches saved snapshot, clear everything.
104
+ if (diff.equal) {
105
+ editor.clearLineIndicators(bufferId, NAMESPACE);
106
+ return;
107
+ }
108
+
109
+ const ranges = diff.line_ranges;
110
+ // If line info is unavailable, leave existing indicators (best effort).
111
+ if (!ranges) return;
112
+
113
+ // Reset namespace to drop stale indicators outside the changed ranges.
114
+ editor.clearLineIndicators(bufferId, NAMESPACE);
115
+ for (const [start, end] of ranges) {
116
+ for (let line = start; line < end; line++) {
117
+ editor.setLineIndicator(
118
+ bufferId,
119
+ line,
120
+ NAMESPACE,
121
+ SYMBOL,
122
+ COLOR[0],
123
+ COLOR[1],
124
+ COLOR[2],
125
+ PRIORITY
126
+ );
127
+ }
128
+ }
129
+ }
130
+
131
+ // =============================================================================
132
+ // Event Handlers
133
+ // =============================================================================
134
+
135
+ /**
136
+ * Handle after file open - initialize state
137
+ */
138
+ globalThis.onBufferModifiedAfterFileOpen = function (args: {
139
+ buffer_id: number;
140
+ path: string;
141
+ }): boolean {
142
+ const bufferId = args.buffer_id;
143
+
144
+ if (!args.path || args.path === "") {
145
+ return true;
146
+ }
147
+
148
+ // Initialize tracking - file just loaded, no modifications yet
149
+ initBufferState(bufferId);
150
+ editor.debug(editor.t("status.initialized", { path: args.path }));
151
+
152
+ return true;
153
+ };
154
+
155
+ /**
156
+ * Handle buffer activation - ensure we're tracking
157
+ */
158
+ globalThis.onBufferModifiedBufferActivated = function (args: {
159
+ buffer_id: number;
160
+ }): boolean {
161
+ const bufferId = args.buffer_id;
162
+
163
+ // If we don't have state yet, initialize it
164
+ if (!bufferStates.has(bufferId)) {
165
+ const filePath = editor.getBufferPath(bufferId);
166
+ if (filePath && filePath !== "") {
167
+ initBufferState(bufferId);
168
+ }
169
+ }
170
+
171
+ return true;
172
+ };
173
+
174
+ /**
175
+ * Handle after file save - clear modified state
176
+ */
177
+ globalThis.onBufferModifiedAfterSave = function (args: {
178
+ buffer_id: number;
179
+ path: string;
180
+ }): boolean {
181
+ const bufferId = args.buffer_id;
182
+
183
+ // Clear all modified markers - buffer now matches disk
184
+ clearModifiedState(bufferId);
185
+ editor.debug(editor.t("status.cleared_on_save"));
186
+
187
+ return true;
188
+ };
189
+
190
+ /**
191
+ * Handle after insert - mark affected lines as modified
192
+ *
193
+ * Note: Line indicators automatically track position changes via byte-position markers.
194
+ * We only need to add new indicators for the modified lines; existing indicators
195
+ * will automatically shift to stay on the correct lines.
196
+ */
197
+ globalThis.onBufferModifiedAfterInsert = function (args: {
198
+ buffer_id: number;
199
+ position: number;
200
+ text: string;
201
+ affected_start: number;
202
+ affected_end: number;
203
+ start_line: number;
204
+ end_line: number;
205
+ lines_added: number;
206
+ }): boolean {
207
+ const bufferId = args.buffer_id;
208
+
209
+ if (!bufferStates.has(bufferId)) {
210
+ return true;
211
+ }
212
+
213
+ // Mark all affected lines (from start_line to end_line inclusive)
214
+ // The indicator markers will automatically track their positions
215
+ markLinesModified(bufferId, args.start_line, args.end_line);
216
+ reapplyIndicatorsFromDiff(bufferId);
217
+
218
+ return true;
219
+ };
220
+
221
+ /**
222
+ * Handle after delete - mark affected line as modified
223
+ *
224
+ * Note: Line indicators automatically track position changes via byte-position markers.
225
+ * Markers within deleted ranges are automatically removed. We only need to mark the
226
+ * line where the deletion occurred.
227
+ */
228
+ globalThis.onBufferModifiedAfterDelete = function (args: {
229
+ buffer_id: number;
230
+ range: { start: number; end: number };
231
+ deleted_text: string;
232
+ affected_start: number;
233
+ deleted_len: number;
234
+ start_line: number;
235
+ end_line: number;
236
+ lines_removed: number;
237
+ }): boolean {
238
+ const bufferId = args.buffer_id;
239
+
240
+ if (!bufferStates.has(bufferId)) {
241
+ return true;
242
+ }
243
+
244
+ // Mark the line where deletion occurred
245
+ // Markers for deleted lines are automatically cleaned up
246
+ markLinesModified(bufferId, args.start_line, args.start_line);
247
+ reapplyIndicatorsFromDiff(bufferId);
248
+
249
+ return true;
250
+ };
251
+
252
+ /**
253
+ * Handle buffer closed - cleanup state
254
+ */
255
+ globalThis.onBufferModifiedBufferClosed = function (args: {
256
+ buffer_id: number;
257
+ }): boolean {
258
+ bufferStates.delete(args.buffer_id);
259
+ return true;
260
+ };
261
+
262
+ // =============================================================================
263
+ // Registration
264
+ // =============================================================================
265
+
266
+ // Register event handlers
267
+ editor.on("after_file_open", "onBufferModifiedAfterFileOpen");
268
+ editor.on("buffer_activated", "onBufferModifiedBufferActivated");
269
+ editor.on("after_file_save", "onBufferModifiedAfterSave");
270
+ editor.on("after_insert", "onBufferModifiedAfterInsert");
271
+ editor.on("after_delete", "onBufferModifiedAfterDelete");
272
+ editor.on("buffer_closed", "onBufferModifiedBufferClosed");
273
+
274
+ // Initialize for the current buffer
275
+ const initBufferId = editor.getActiveBufferId();
276
+ const initPath = editor.getBufferPath(initBufferId);
277
+ if (initPath && initPath !== "") {
278
+ initBufferState(initBufferId);
279
+ }
280
+
281
+ editor.debug(editor.t("status.loaded"));
@@ -0,0 +1,93 @@
1
+ {
2
+ "en": {
3
+ "cmd.calculator": "Calculator",
4
+ "cmd.calculator_desc": "Open calculator",
5
+ "status.loaded": "Calculator plugin loaded",
6
+ "status.opened": "Calculator opened",
7
+ "status.copied": "Copied: {value}"
8
+ },
9
+ "cs": {
10
+ "cmd.calculator": "Kalkulacka",
11
+ "cmd.calculator_desc": "Otevrit kalkulacku",
12
+ "status.loaded": "Plugin kalkulacky nacten",
13
+ "status.opened": "Kalkulacka otevrena",
14
+ "status.copied": "Zkopirovano: {value}"
15
+ },
16
+ "de": {
17
+ "cmd.calculator": "Taschenrechner",
18
+ "cmd.calculator_desc": "Taschenrechner offnen",
19
+ "status.loaded": "Taschenrechner-Plugin geladen",
20
+ "status.opened": "Taschenrechner geoffnet",
21
+ "status.copied": "Kopiert: {value}"
22
+ },
23
+ "es": {
24
+ "cmd.calculator": "Calculadora",
25
+ "cmd.calculator_desc": "Abrir calculadora",
26
+ "status.loaded": "Plugin de calculadora cargado",
27
+ "status.opened": "Calculadora abierta",
28
+ "status.copied": "Copiado: {value}"
29
+ },
30
+ "fr": {
31
+ "cmd.calculator": "Calculatrice",
32
+ "cmd.calculator_desc": "Ouvrir la calculatrice",
33
+ "status.loaded": "Plugin calculatrice charge",
34
+ "status.opened": "Calculatrice ouverte",
35
+ "status.copied": "Copie: {value}"
36
+ },
37
+ "it": {
38
+ "cmd.calculator": "Calcolatrice",
39
+ "cmd.calculator_desc": "Apri calcolatrice",
40
+ "status.loaded": "Plugin calcolatrice caricato",
41
+ "status.opened": "Calcolatrice aperta",
42
+ "status.copied": "Copiato: {value}"
43
+ },
44
+ "ja": {
45
+ "cmd.calculator": "電卓",
46
+ "cmd.calculator_desc": "電卓を開く",
47
+ "status.loaded": "電卓プラグインが読み込まれました",
48
+ "status.opened": "電卓を開きました",
49
+ "status.copied": "コピーしました: {value}"
50
+ },
51
+ "ko": {
52
+ "cmd.calculator": "계산기",
53
+ "cmd.calculator_desc": "계산기 열기",
54
+ "status.loaded": "계산기 플러그인이 로드되었습니다",
55
+ "status.opened": "계산기가 열렸습니다",
56
+ "status.copied": "복사됨: {value}"
57
+ },
58
+ "pt-BR": {
59
+ "cmd.calculator": "Calculadora",
60
+ "cmd.calculator_desc": "Abrir calculadora",
61
+ "status.loaded": "Plugin de calculadora carregado",
62
+ "status.opened": "Calculadora aberta",
63
+ "status.copied": "Copiado: {value}"
64
+ },
65
+ "ru": {
66
+ "cmd.calculator": "Калькулятор",
67
+ "cmd.calculator_desc": "Открыть калькулятор",
68
+ "status.loaded": "Плагин калькулятора загружен",
69
+ "status.opened": "Калькулятор открыт",
70
+ "status.copied": "Скопировано: {value}"
71
+ },
72
+ "th": {
73
+ "cmd.calculator": "เครื่องคิดเลข",
74
+ "cmd.calculator_desc": "เปิดเครื่องคิดเลข",
75
+ "status.loaded": "โหลดปลั๊กอินเครื่องคิดเลขแล้ว",
76
+ "status.opened": "เปิดเครื่องคิดเลขแล้ว",
77
+ "status.copied": "คัดลอกแล้ว: {value}"
78
+ },
79
+ "uk": {
80
+ "cmd.calculator": "Калькулятор",
81
+ "cmd.calculator_desc": "Відкрити калькулятор",
82
+ "status.loaded": "Плагін калькулятора завантажено",
83
+ "status.opened": "Калькулятор відкрито",
84
+ "status.copied": "Скопійовано: {value}"
85
+ },
86
+ "zh-CN": {
87
+ "cmd.calculator": "计算器",
88
+ "cmd.calculator_desc": "打开计算器",
89
+ "status.loaded": "计算器插件已加载",
90
+ "status.opened": "计算器已打开",
91
+ "status.copied": "已复制: {value}"
92
+ }
93
+ }