@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.
Files changed (64) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +4 -2
  3. package/package.json +1 -1
  4. package/plugins/audit_mode.i18n.json +380 -0
  5. package/plugins/audit_mode.ts +1813 -0
  6. package/plugins/buffer_modified.i18n.json +32 -0
  7. package/plugins/buffer_modified.ts +5 -3
  8. package/plugins/calculator.i18n.json +44 -0
  9. package/plugins/calculator.ts +6 -4
  10. package/plugins/clangd-lsp.ts +168 -0
  11. package/plugins/clangd_support.i18n.json +104 -0
  12. package/plugins/clangd_support.ts +18 -16
  13. package/plugins/color_highlighter.i18n.json +68 -0
  14. package/plugins/color_highlighter.ts +12 -10
  15. package/plugins/config-schema.json +79 -141
  16. package/plugins/csharp-lsp.ts +147 -0
  17. package/plugins/csharp_support.i18n.json +38 -0
  18. package/plugins/csharp_support.ts +6 -4
  19. package/plugins/css-lsp.ts +143 -0
  20. package/plugins/diagnostics_panel.i18n.json +110 -0
  21. package/plugins/diagnostics_panel.ts +19 -17
  22. package/plugins/find_references.i18n.json +128 -0
  23. package/plugins/find_references.ts +22 -20
  24. package/plugins/git_blame.i18n.json +230 -0
  25. package/plugins/git_blame.ts +39 -37
  26. package/plugins/git_find_file.i18n.json +146 -0
  27. package/plugins/git_find_file.ts +24 -22
  28. package/plugins/git_grep.i18n.json +80 -0
  29. package/plugins/git_grep.ts +15 -13
  30. package/plugins/git_gutter.i18n.json +44 -0
  31. package/plugins/git_gutter.ts +7 -5
  32. package/plugins/git_log.i18n.json +224 -0
  33. package/plugins/git_log.ts +41 -39
  34. package/plugins/go-lsp.ts +143 -0
  35. package/plugins/html-lsp.ts +145 -0
  36. package/plugins/json-lsp.ts +145 -0
  37. package/plugins/lib/fresh.d.ts +150 -14
  38. package/plugins/lib/index.ts +1 -1
  39. package/plugins/lib/navigation-controller.ts +3 -3
  40. package/plugins/lib/panel-manager.ts +15 -13
  41. package/plugins/lib/virtual-buffer-factory.ts +84 -112
  42. package/plugins/live_grep.i18n.json +80 -0
  43. package/plugins/live_grep.ts +15 -13
  44. package/plugins/markdown_compose.i18n.json +104 -0
  45. package/plugins/markdown_compose.ts +17 -15
  46. package/plugins/merge_conflict.i18n.json +380 -0
  47. package/plugins/merge_conflict.ts +72 -73
  48. package/plugins/path_complete.i18n.json +38 -0
  49. package/plugins/path_complete.ts +6 -4
  50. package/plugins/python-lsp.ts +162 -0
  51. package/plugins/rust-lsp.ts +166 -0
  52. package/plugins/search_replace.i18n.json +188 -0
  53. package/plugins/search_replace.ts +31 -29
  54. package/plugins/test_i18n.i18n.json +12 -0
  55. package/plugins/test_i18n.ts +18 -0
  56. package/plugins/theme_editor.i18n.json +1417 -0
  57. package/plugins/theme_editor.ts +73 -69
  58. package/plugins/todo_highlighter.i18n.json +86 -0
  59. package/plugins/todo_highlighter.ts +15 -13
  60. package/plugins/typescript-lsp.ts +167 -0
  61. package/plugins/vi_mode.i18n.json +716 -0
  62. package/plugins/vi_mode.ts +2747 -0
  63. package/plugins/welcome.i18n.json +110 -0
  64. package/plugins/welcome.ts +18 -16
@@ -1,4 +1,6 @@
1
1
  /// <reference path="../types/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
2
4
 
3
5
  /**
4
6
  * Theme Editor Plugin - Interactive color theme editor
@@ -500,8 +502,8 @@ function buildVisibleFields(): ThemeField[] {
500
502
  fields.push({
501
503
  def: {
502
504
  key: section.name,
503
- displayName: section.displayName,
504
- description: section.description,
505
+ displayName: editor.t(`section.${section.name}`),
506
+ description: editor.t(`section.${section.name}_desc`),
505
507
  section: section.name,
506
508
  },
507
509
  value: [0, 0, 0], // Placeholder
@@ -518,7 +520,11 @@ function buildVisibleFields(): ThemeField[] {
518
520
  const value = getNestedValue(state.themeData, path) as ColorValue || [128, 128, 128];
519
521
 
520
522
  fields.push({
521
- def: fieldDef,
523
+ def: {
524
+ ...fieldDef,
525
+ displayName: editor.t(`field.${fieldDef.key}`),
526
+ description: editor.t(`field.${fieldDef.key}_desc`),
527
+ },
522
528
  value,
523
529
  path,
524
530
  depth: 1,
@@ -542,20 +548,20 @@ function buildDisplayEntries(): TextPropertyEntry[] {
542
548
  const entries: TextPropertyEntry[] = [];
543
549
 
544
550
  // Title
545
- const modifiedMarker = state.hasChanges ? " [modified]" : "";
551
+ const modifiedMarker = state.hasChanges ? " " + editor.t("panel.modified") : "";
546
552
  entries.push({
547
- text: `━━━ Theme Editor: ${state.themeName}${modifiedMarker} ━━━\n`,
553
+ text: `━━━ ${editor.t("panel.title", { name: state.themeName })}${modifiedMarker} ━━━\n`,
548
554
  properties: { type: "title" },
549
555
  });
550
556
 
551
557
  if (state.themePath) {
552
558
  entries.push({
553
- text: `File: ${state.themePath}\n`,
559
+ text: `${editor.t("panel.file", { path: state.themePath })}\n`,
554
560
  properties: { type: "file-path" },
555
561
  });
556
562
  } else {
557
563
  entries.push({
558
- text: "New theme (not yet saved)\n",
564
+ text: editor.t("panel.new_theme") + "\n",
559
565
  properties: { type: "file-path" },
560
566
  });
561
567
  }
@@ -623,11 +629,11 @@ function buildDisplayEntries(): TextPropertyEntry[] {
623
629
  properties: { type: "separator" },
624
630
  });
625
631
  entries.push({
626
- text: "↑/↓: navigate | RET/SPC: edit color | TAB: expand/collapse\n",
632
+ text: editor.t("panel.nav_hint") + "\n",
627
633
  properties: { type: "footer" },
628
634
  });
629
635
  entries.push({
630
- text: "c: copy from builtin | n: set name | s: save | S: save as | d: set as default | q: quit\n",
636
+ text: editor.t("panel.action_hint") + "\n",
631
637
  properties: { type: "footer" },
632
638
  });
633
639
 
@@ -814,13 +820,13 @@ function editColorField(field: ThemeField): void {
814
820
  const currentValue = formatColorValue(field.value);
815
821
 
816
822
  // Use startPromptWithInitial to pre-fill with current value
817
- editor.startPromptWithInitial(`${field.def.displayName} (#RRGGBB or named): `, `theme-color-${field.path}`, currentValue);
823
+ editor.startPromptWithInitial(editor.t("prompt.color_input", { field: field.def.displayName }), `theme-color-${field.path}`, currentValue);
818
824
 
819
825
  // Build suggestions with named colors and current value
820
826
  const suggestions: PromptSuggestion[] = [
821
827
  {
822
828
  text: currentValue,
823
- description: "(current)",
829
+ description: editor.t("suggestion.current"),
824
830
  value: currentValue,
825
831
  },
826
832
  ];
@@ -829,7 +835,7 @@ function editColorField(field: ThemeField): void {
829
835
  for (const name of SPECIAL_COLORS) {
830
836
  suggestions.push({
831
837
  text: name,
832
- description: "Use terminal's native color",
838
+ description: editor.t("suggestion.terminal_native"),
833
839
  value: name,
834
840
  });
835
841
  }
@@ -906,9 +912,9 @@ globalThis.onThemeColorPromptConfirmed = function(args: {
906
912
  setNestedValue(state.themeData, path, newValue);
907
913
  state.hasChanges = !deepEqual(state.themeData, state.originalThemeData);
908
914
  updateDisplay();
909
- editor.setStatus(`Updated ${path}`);
915
+ editor.setStatus(editor.t("status.updated", { path }));
910
916
  } else {
911
- editor.setStatus("Invalid color format. Use #RRGGBB, [r,g,b], or named color.");
917
+ editor.setStatus(editor.t("status.invalid_color"));
912
918
  }
913
919
 
914
920
  return true;
@@ -930,7 +936,7 @@ globalThis.onThemeNamePromptConfirmed = function(args: {
930
936
  state.themeData.name = name;
931
937
  state.hasChanges = true;
932
938
  updateDisplay();
933
- editor.setStatus(`Theme name set to: ${name}`);
939
+ editor.setStatus(editor.t("status.name_set", { name }));
934
940
  }
935
941
 
936
942
  return true;
@@ -956,9 +962,9 @@ globalThis.onThemeCopyPromptConfirmed = async function(args: {
956
962
  state.themePath = null; // New theme, not saved yet
957
963
  state.hasChanges = true;
958
964
  updateDisplay();
959
- editor.setStatus(`Copied from ${themeName}. Edit and save as new theme.`);
965
+ editor.setStatus(editor.t("status.copied", { theme: themeName }));
960
966
  } else {
961
- editor.setStatus(`Failed to load theme: ${themeName}`);
967
+ editor.setStatus(editor.t("status.load_failed", { name: themeName }));
962
968
  }
963
969
 
964
970
  return true;
@@ -1007,7 +1013,7 @@ globalThis.onThemeSetDefaultPromptConfirmed = async function(args: {
1007
1013
  */
1008
1014
  globalThis.onThemePromptCancelled = function(args: { prompt_type: string }): boolean {
1009
1015
  if (!args.prompt_type.startsWith("theme-")) return true;
1010
- editor.setStatus("Cancelled");
1016
+ editor.setStatus(editor.t("status.cancelled"));
1011
1017
  return true;
1012
1018
  };
1013
1019
 
@@ -1036,7 +1042,7 @@ async function saveTheme(name?: string): Promise<boolean> {
1036
1042
  // Create directory via shell command
1037
1043
  await editor.spawnProcess("mkdir", ["-p", userThemesDir]);
1038
1044
  } catch (e) {
1039
- editor.setStatus(`Failed to create themes directory: ${e}`);
1045
+ editor.setStatus(editor.t("status.mkdir_failed", { error: String(e) }));
1040
1046
  return false;
1041
1047
  }
1042
1048
  }
@@ -1054,10 +1060,10 @@ async function saveTheme(name?: string): Promise<boolean> {
1054
1060
  state.hasChanges = false;
1055
1061
  updateDisplay();
1056
1062
 
1057
- editor.setStatus(`Theme saved to ${themePath}`);
1063
+ editor.setStatus(editor.t("status.saved", { path: themePath }));
1058
1064
  return true;
1059
1065
  } catch (e) {
1060
- editor.setStatus(`Failed to save theme: ${e}`);
1066
+ editor.setStatus(editor.t("status.save_failed", { error: String(e) }));
1061
1067
  return false;
1062
1068
  }
1063
1069
  }
@@ -1069,9 +1075,9 @@ async function setThemeAsDefault(themeName: string): Promise<void> {
1069
1075
  try {
1070
1076
  // Use the editor API to apply and persist the theme
1071
1077
  editor.applyTheme(themeName);
1072
- editor.setStatus(`Theme "${themeName}" applied and saved as default.`);
1078
+ editor.setStatus(editor.t("status.default_set", { name: themeName }));
1073
1079
  } catch (e) {
1074
- editor.setStatus(`Failed to apply theme: ${e}`);
1080
+ editor.setStatus(editor.t("status.apply_failed", { error: String(e) }));
1075
1081
  }
1076
1082
  }
1077
1083
 
@@ -1177,11 +1183,11 @@ editor.on("cursor_moved", "onThemeEditorCursorMoved");
1177
1183
  */
1178
1184
  globalThis.open_theme_editor = async function(): Promise<void> {
1179
1185
  if (state.isOpen) {
1180
- editor.setStatus("Theme editor already open");
1186
+ editor.setStatus(editor.t("status.already_open"));
1181
1187
  return;
1182
1188
  }
1183
1189
 
1184
- editor.setStatus("Loading theme editor...");
1190
+ editor.setStatus(editor.t("status.loading"));
1185
1191
 
1186
1192
  // Save context
1187
1193
  state.sourceSplitId = editor.getActiveSplitId();
@@ -1219,9 +1225,9 @@ globalThis.open_theme_editor = async function(): Promise<void> {
1219
1225
  editor.setContext("theme-editor", true);
1220
1226
 
1221
1227
  applyHighlighting();
1222
- editor.setStatus("Theme Editor | c: copy from builtin | s: save | d: set as default | q: quit");
1228
+ editor.setStatus(editor.t("status.ready"));
1223
1229
  } else {
1224
- editor.setStatus("Failed to open theme editor");
1230
+ editor.setStatus(editor.t("status.open_failed"));
1225
1231
  }
1226
1232
  };
1227
1233
 
@@ -1232,7 +1238,7 @@ globalThis.theme_editor_close = function(): void {
1232
1238
  if (!state.isOpen) return;
1233
1239
 
1234
1240
  if (state.hasChanges) {
1235
- editor.setStatus("Warning: Unsaved changes discarded");
1241
+ editor.setStatus(editor.t("status.unsaved_discarded"));
1236
1242
  }
1237
1243
 
1238
1244
  editor.setContext("theme-editor", false);
@@ -1250,7 +1256,7 @@ globalThis.theme_editor_close = function(): void {
1250
1256
  state.originalThemeData = {};
1251
1257
  state.hasChanges = false;
1252
1258
 
1253
- editor.setStatus("Theme editor closed");
1259
+ editor.setStatus(editor.t("status.closed"));
1254
1260
  };
1255
1261
 
1256
1262
  /**
@@ -1259,7 +1265,7 @@ globalThis.theme_editor_close = function(): void {
1259
1265
  globalThis.theme_editor_edit_color = function(): void {
1260
1266
  const field = getFieldAtCursor();
1261
1267
  if (!field) {
1262
- editor.setStatus("No field selected");
1268
+ editor.setStatus(editor.t("status.no_field"));
1263
1269
  return;
1264
1270
  }
1265
1271
 
@@ -1277,7 +1283,7 @@ globalThis.theme_editor_edit_color = function(): void {
1277
1283
  globalThis.theme_editor_toggle_section = function(): void {
1278
1284
  const field = getFieldAtCursor();
1279
1285
  if (!field || !field.isSection) {
1280
- editor.setStatus("Not a section");
1286
+ editor.setStatus(editor.t("status.not_section"));
1281
1287
  return;
1282
1288
  }
1283
1289
 
@@ -1294,11 +1300,11 @@ globalThis.theme_editor_toggle_section = function(): void {
1294
1300
  * Copy from a built-in theme
1295
1301
  */
1296
1302
  globalThis.theme_editor_copy_from_builtin = function(): void {
1297
- editor.startPrompt("Copy from theme: ", "theme-copy-builtin");
1303
+ editor.startPrompt(editor.t("prompt.copy_theme"), "theme-copy-builtin");
1298
1304
 
1299
1305
  const suggestions: PromptSuggestion[] = state.builtinThemes.map(name => ({
1300
1306
  text: name,
1301
- description: "Built-in theme",
1307
+ description: editor.t("suggestion.builtin_theme"),
1302
1308
  value: name,
1303
1309
  }));
1304
1310
 
@@ -1309,11 +1315,11 @@ globalThis.theme_editor_copy_from_builtin = function(): void {
1309
1315
  * Set theme name
1310
1316
  */
1311
1317
  globalThis.theme_editor_set_name = function(): void {
1312
- editor.startPrompt("Theme name: ", "theme-name");
1318
+ editor.startPrompt(editor.t("prompt.theme_name"), "theme-name");
1313
1319
 
1314
1320
  editor.setPromptSuggestions([{
1315
1321
  text: state.themeName,
1316
- description: "(current)",
1322
+ description: editor.t("suggestion.current"),
1317
1323
  value: state.themeName,
1318
1324
  }]);
1319
1325
  };
@@ -1323,7 +1329,7 @@ globalThis.theme_editor_set_name = function(): void {
1323
1329
  */
1324
1330
  globalThis.theme_editor_save = async function(): Promise<void> {
1325
1331
  if (!state.hasChanges && state.themePath) {
1326
- editor.setStatus("No changes to save");
1332
+ editor.setStatus(editor.t("status.no_changes"));
1327
1333
  return;
1328
1334
  }
1329
1335
 
@@ -1334,11 +1340,11 @@ globalThis.theme_editor_save = async function(): Promise<void> {
1334
1340
  * Save theme as (new name)
1335
1341
  */
1336
1342
  globalThis.theme_editor_save_as = function(): void {
1337
- editor.startPrompt("Save theme as: ", "theme-save-as");
1343
+ editor.startPrompt(editor.t("prompt.save_as"), "theme-save-as");
1338
1344
 
1339
1345
  editor.setPromptSuggestions([{
1340
1346
  text: state.themeName,
1341
- description: "(current)",
1347
+ description: editor.t("suggestion.current"),
1342
1348
  value: state.themeName,
1343
1349
  }]);
1344
1350
  };
@@ -1347,7 +1353,7 @@ globalThis.theme_editor_save_as = function(): void {
1347
1353
  * Set current theme as default
1348
1354
  */
1349
1355
  globalThis.theme_editor_set_as_default = function(): void {
1350
- editor.startPrompt("Set default theme: ", "theme-set-default");
1356
+ editor.startPrompt(editor.t("prompt.set_default"), "theme-set-default");
1351
1357
 
1352
1358
  // Suggest current theme and all builtins
1353
1359
  const suggestions: PromptSuggestion[] = [];
@@ -1355,7 +1361,7 @@ globalThis.theme_editor_set_as_default = function(): void {
1355
1361
  if (state.themeName && state.themePath) {
1356
1362
  suggestions.push({
1357
1363
  text: state.themeName,
1358
- description: "(current)",
1364
+ description: editor.t("suggestion.current"),
1359
1365
  value: state.themeName,
1360
1366
  });
1361
1367
  }
@@ -1363,7 +1369,7 @@ globalThis.theme_editor_set_as_default = function(): void {
1363
1369
  for (const name of state.builtinThemes) {
1364
1370
  suggestions.push({
1365
1371
  text: name,
1366
- description: "Built-in",
1372
+ description: editor.t("suggestion.builtin"),
1367
1373
  value: name,
1368
1374
  });
1369
1375
  }
@@ -1383,14 +1389,14 @@ globalThis.theme_editor_reload = async function(): Promise<void> {
1383
1389
  state.originalThemeData = deepClone(themeData);
1384
1390
  state.hasChanges = false;
1385
1391
  updateDisplay();
1386
- editor.setStatus("Theme reloaded from file");
1392
+ editor.setStatus(editor.t("status.reloaded"));
1387
1393
  }
1388
1394
  } else {
1389
1395
  state.themeData = createDefaultTheme();
1390
1396
  state.originalThemeData = deepClone(state.themeData);
1391
1397
  state.hasChanges = false;
1392
1398
  updateDisplay();
1393
- editor.setStatus("Theme reset to defaults");
1399
+ editor.setStatus(editor.t("status.reset"));
1394
1400
  }
1395
1401
  };
1396
1402
 
@@ -1398,9 +1404,7 @@ globalThis.theme_editor_reload = async function(): Promise<void> {
1398
1404
  * Show help
1399
1405
  */
1400
1406
  globalThis.theme_editor_show_help = function(): void {
1401
- editor.setStatus(
1402
- "Keys: ↑/↓ navigate | RET/SPC edit | TAB expand | c copy | n name | s save | S save-as | d default | q quit"
1403
- );
1407
+ editor.setStatus(editor.t("status.help"));
1404
1408
  };
1405
1409
 
1406
1410
  // =============================================================================
@@ -1409,79 +1413,79 @@ globalThis.theme_editor_show_help = function(): void {
1409
1413
 
1410
1414
  // Main command to open theme editor
1411
1415
  editor.registerCommand(
1412
- "Edit Theme",
1413
- "Open the theme color editor",
1416
+ "%cmd.edit_theme",
1417
+ "%cmd.edit_theme_desc",
1414
1418
  "open_theme_editor",
1415
1419
  "normal"
1416
1420
  );
1417
1421
 
1418
1422
  // Context-specific commands
1419
1423
  editor.registerCommand(
1420
- "Theme: Close Editor",
1421
- "Close the theme editor",
1424
+ "%cmd.close_editor",
1425
+ "%cmd.close_editor_desc",
1422
1426
  "theme_editor_close",
1423
1427
  "normal,theme-editor"
1424
1428
  );
1425
1429
 
1426
1430
  editor.registerCommand(
1427
- "Theme: Edit Color",
1428
- "Edit the selected color",
1431
+ "%cmd.edit_color",
1432
+ "%cmd.edit_color_desc",
1429
1433
  "theme_editor_edit_color",
1430
1434
  "normal,theme-editor"
1431
1435
  );
1432
1436
 
1433
1437
  editor.registerCommand(
1434
- "Theme: Toggle Section",
1435
- "Expand or collapse section",
1438
+ "%cmd.toggle_section",
1439
+ "%cmd.toggle_section_desc",
1436
1440
  "theme_editor_toggle_section",
1437
1441
  "normal,theme-editor"
1438
1442
  );
1439
1443
 
1440
1444
  editor.registerCommand(
1441
- "Theme: Copy From Built-in",
1442
- "Copy colors from a built-in theme",
1445
+ "%cmd.copy_builtin",
1446
+ "%cmd.copy_builtin_desc",
1443
1447
  "theme_editor_copy_from_builtin",
1444
1448
  "normal,theme-editor"
1445
1449
  );
1446
1450
 
1447
1451
  editor.registerCommand(
1448
- "Theme: Set Name",
1449
- "Set the theme name",
1452
+ "%cmd.set_name",
1453
+ "%cmd.set_name_desc",
1450
1454
  "theme_editor_set_name",
1451
1455
  "normal,theme-editor"
1452
1456
  );
1453
1457
 
1454
1458
  editor.registerCommand(
1455
- "Theme: Save",
1456
- "Save the theme",
1459
+ "%cmd.save",
1460
+ "%cmd.save_desc",
1457
1461
  "theme_editor_save",
1458
1462
  "normal,theme-editor"
1459
1463
  );
1460
1464
 
1461
1465
  editor.registerCommand(
1462
- "Theme: Save As",
1463
- "Save theme with a new name",
1466
+ "%cmd.save_as",
1467
+ "%cmd.save_as_desc",
1464
1468
  "theme_editor_save_as",
1465
1469
  "normal,theme-editor"
1466
1470
  );
1467
1471
 
1468
1472
  editor.registerCommand(
1469
- "Theme: Set As Default",
1470
- "Set a theme as the default",
1473
+ "%cmd.set_default",
1474
+ "%cmd.set_default_desc",
1471
1475
  "theme_editor_set_as_default",
1472
1476
  "normal,theme-editor"
1473
1477
  );
1474
1478
 
1475
1479
  editor.registerCommand(
1476
- "Theme: Reload",
1477
- "Reload theme from file",
1480
+ "%cmd.reload",
1481
+ "%cmd.reload_desc",
1478
1482
  "theme_editor_reload",
1479
1483
  "normal,theme-editor"
1480
1484
  );
1481
1485
 
1482
1486
  editor.registerCommand(
1483
- "Theme: Show Help",
1484
- "Show theme editor help",
1487
+ "%cmd.show_help",
1488
+ "%cmd.show_help_desc",
1485
1489
  "theme_editor_show_help",
1486
1490
  "normal,theme-editor"
1487
1491
  );
@@ -1490,5 +1494,5 @@ editor.registerCommand(
1490
1494
  // Plugin Initialization
1491
1495
  // =============================================================================
1492
1496
 
1493
- editor.setStatus("Theme Editor plugin loaded");
1497
+ editor.setStatus(editor.t("status.plugin_loaded"));
1494
1498
  editor.debug("Theme Editor plugin initialized - Use 'Edit Theme' command to open");
@@ -0,0 +1,86 @@
1
+ {
2
+ "en": {
3
+ "cmd.enable": "TODO Highlighter: Enable",
4
+ "cmd.enable_desc": "Enable TODO keyword highlighting",
5
+ "cmd.disable": "TODO Highlighter: Disable",
6
+ "cmd.disable_desc": "Disable TODO keyword highlighting",
7
+ "cmd.toggle": "TODO Highlighter: Toggle",
8
+ "cmd.toggle_desc": "Toggle TODO keyword highlighting",
9
+ "cmd.show_keywords": "TODO Highlighter: Show Keywords",
10
+ "cmd.show_keywords_desc": "Show currently tracked keywords",
11
+ "status.enabled": "TODO Highlighter: Enabled",
12
+ "status.disabled": "TODO Highlighter: Disabled",
13
+ "status.loaded": "TODO Highlighter plugin loaded (TypeScript)",
14
+ "status.keywords": "TODO Keywords: %{keywords}"
15
+ },
16
+ "es": {
17
+ "cmd.enable": "Resaltador TODO: Activar",
18
+ "cmd.enable_desc": "Activar resaltado de palabras clave TODO",
19
+ "cmd.disable": "Resaltador TODO: Desactivar",
20
+ "cmd.disable_desc": "Desactivar resaltado de palabras clave TODO",
21
+ "cmd.toggle": "Resaltador TODO: Alternar",
22
+ "cmd.toggle_desc": "Alternar resaltado de palabras clave TODO",
23
+ "cmd.show_keywords": "Resaltador TODO: Mostrar Palabras Clave",
24
+ "cmd.show_keywords_desc": "Mostrar palabras clave rastreadas actualmente",
25
+ "status.enabled": "Resaltador TODO: Activado",
26
+ "status.disabled": "Resaltador TODO: Desactivado",
27
+ "status.loaded": "Plugin Resaltador TODO cargado (TypeScript)",
28
+ "status.keywords": "Palabras Clave TODO: %{keywords}"
29
+ },
30
+ "de": {
31
+ "cmd.enable": "TODO-Hervorhebung: Aktivieren",
32
+ "cmd.enable_desc": "TODO-Schlüsselwort-Hervorhebung aktivieren",
33
+ "cmd.disable": "TODO-Hervorhebung: Deaktivieren",
34
+ "cmd.disable_desc": "TODO-Schlüsselwort-Hervorhebung deaktivieren",
35
+ "cmd.toggle": "TODO-Hervorhebung: Umschalten",
36
+ "cmd.toggle_desc": "TODO-Schlüsselwort-Hervorhebung umschalten",
37
+ "cmd.show_keywords": "TODO-Hervorhebung: Schlüsselwörter Anzeigen",
38
+ "cmd.show_keywords_desc": "Aktuell verfolgte Schlüsselwörter anzeigen",
39
+ "status.enabled": "TODO-Hervorhebung: Aktiviert",
40
+ "status.disabled": "TODO-Hervorhebung: Deaktiviert",
41
+ "status.loaded": "TODO-Hervorhebung-Plugin geladen (TypeScript)",
42
+ "status.keywords": "TODO-Schlüsselwörter: %{keywords}"
43
+ },
44
+ "fr": {
45
+ "cmd.enable": "Surligneur TODO: Activer",
46
+ "cmd.enable_desc": "Activer le surlignage des mots-clés TODO",
47
+ "cmd.disable": "Surligneur TODO: Désactiver",
48
+ "cmd.disable_desc": "Désactiver le surlignage des mots-clés TODO",
49
+ "cmd.toggle": "Surligneur TODO: Basculer",
50
+ "cmd.toggle_desc": "Basculer le surlignage des mots-clés TODO",
51
+ "cmd.show_keywords": "Surligneur TODO: Afficher les Mots-clés",
52
+ "cmd.show_keywords_desc": "Afficher les mots-clés actuellement suivis",
53
+ "status.enabled": "Surligneur TODO: Activé",
54
+ "status.disabled": "Surligneur TODO: Désactivé",
55
+ "status.loaded": "Plugin Surligneur TODO chargé (TypeScript)",
56
+ "status.keywords": "Mots-clés TODO: %{keywords}"
57
+ },
58
+ "ja": {
59
+ "cmd.enable": "TODOハイライター: 有効化",
60
+ "cmd.enable_desc": "TODOキーワードのハイライトを有効化",
61
+ "cmd.disable": "TODOハイライター: 無効化",
62
+ "cmd.disable_desc": "TODOキーワードのハイライトを無効化",
63
+ "cmd.toggle": "TODOハイライター: 切り替え",
64
+ "cmd.toggle_desc": "TODOキーワードのハイライトを切り替え",
65
+ "cmd.show_keywords": "TODOハイライター: キーワード表示",
66
+ "cmd.show_keywords_desc": "現在追跡中のキーワードを表示",
67
+ "status.enabled": "TODOハイライター: 有効",
68
+ "status.disabled": "TODOハイライター: 無効",
69
+ "status.loaded": "TODOハイライタープラグインを読み込みました (TypeScript)",
70
+ "status.keywords": "TODOキーワード: %{keywords}"
71
+ },
72
+ "zh-CN": {
73
+ "cmd.enable": "TODO高亮器: 启用",
74
+ "cmd.enable_desc": "启用TODO关键字高亮显示",
75
+ "cmd.disable": "TODO高亮器: 禁用",
76
+ "cmd.disable_desc": "禁用TODO关键字高亮显示",
77
+ "cmd.toggle": "TODO高亮器: 切换",
78
+ "cmd.toggle_desc": "切换TODO关键字高亮显示",
79
+ "cmd.show_keywords": "TODO高亮器: 显示关键字",
80
+ "cmd.show_keywords_desc": "显示当前跟踪的关键字",
81
+ "status.enabled": "TODO高亮器: 已启用",
82
+ "status.disabled": "TODO高亮器: 已禁用",
83
+ "status.loaded": "TODO高亮器插件已加载 (TypeScript)",
84
+ "status.keywords": "TODO关键字: %{keywords}"
85
+ }
86
+ }
@@ -1,6 +1,8 @@
1
1
  // TypeScript TODO Highlighter Plugin
2
2
  // Highlights TODO, FIXME, XXX keywords in source code
3
3
  // Uses targeted overlay invalidation for efficient updates on edits
4
+ const editor = getEditor();
5
+
4
6
 
5
7
  interface HighlightConfig {
6
8
  enabled: boolean;
@@ -143,14 +145,14 @@ globalThis.todoHighlighterEnable = function(): void {
143
145
  // Refresh lines so next render processes all visible lines
144
146
  const bufferId = editor.getActiveBufferId();
145
147
  editor.refreshLines(bufferId);
146
- editor.setStatus("TODO Highlighter: Enabled");
148
+ editor.setStatus(editor.t("status.enabled"));
147
149
  };
148
150
 
149
151
  globalThis.todoHighlighterDisable = function(): void {
150
152
  config.enabled = false;
151
153
  const bufferId = editor.getActiveBufferId();
152
154
  clearHighlights(bufferId);
153
- editor.setStatus("TODO Highlighter: Disabled");
155
+ editor.setStatus(editor.t("status.disabled"));
154
156
  };
155
157
 
156
158
  globalThis.todoHighlighterToggle = function(): void {
@@ -162,43 +164,43 @@ globalThis.todoHighlighterToggle = function(): void {
162
164
  } else {
163
165
  clearHighlights(bufferId);
164
166
  }
165
- editor.setStatus(`TODO Highlighter: ${config.enabled ? "Enabled" : "Disabled"}`);
167
+ editor.setStatus(config.enabled ? editor.t("status.enabled") : editor.t("status.disabled"));
166
168
  };
167
169
 
168
170
  globalThis.todoHighlighterShowKeywords = function(): void {
169
171
  const keywords = config.keywords.map(k => k.word).join(", ");
170
- editor.setStatus(`TODO Keywords: ${keywords}`);
172
+ editor.setStatus(editor.t("status.keywords", { keywords }));
171
173
  };
172
174
 
173
175
  // Register commands
174
176
  editor.registerCommand(
175
- "TODO Highlighter: Enable",
176
- "Enable TODO keyword highlighting",
177
+ "%cmd.enable",
178
+ "%cmd.enable_desc",
177
179
  "todoHighlighterEnable",
178
180
  "normal"
179
181
  );
180
182
 
181
183
  editor.registerCommand(
182
- "TODO Highlighter: Disable",
183
- "Disable TODO keyword highlighting",
184
+ "%cmd.disable",
185
+ "%cmd.disable_desc",
184
186
  "todoHighlighterDisable",
185
187
  "normal"
186
188
  );
187
189
 
188
190
  editor.registerCommand(
189
- "TODO Highlighter: Toggle",
190
- "Toggle TODO keyword highlighting",
191
+ "%cmd.toggle",
192
+ "%cmd.toggle_desc",
191
193
  "todoHighlighterToggle",
192
194
  "normal"
193
195
  );
194
196
 
195
197
  editor.registerCommand(
196
- "TODO Highlighter: Show Keywords",
197
- "Show currently tracked keywords",
198
+ "%cmd.show_keywords",
199
+ "%cmd.show_keywords_desc",
198
200
  "todoHighlighterShowKeywords",
199
201
  "normal"
200
202
  );
201
203
 
202
204
  // Initialization
203
- editor.setStatus("TODO Highlighter plugin loaded (TypeScript)");
205
+ editor.setStatus(editor.t("status.loaded"));
204
206
  editor.debug("TODO Highlighter initialized with keywords: " + config.keywords.map(k => k.word).join(", "));