@fresh-editor/fresh-editor 0.3.0 → 0.3.1

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 (76) hide show
  1. package/CHANGELOG.md +66 -2
  2. package/package.json +1 -1
  3. package/plugins/astro-lsp.ts +6 -12
  4. package/plugins/audit_mode.ts +106 -113
  5. package/plugins/bash-lsp.ts +15 -22
  6. package/plugins/clangd-lsp.ts +15 -24
  7. package/plugins/clojure-lsp.ts +9 -12
  8. package/plugins/cmake-lsp.ts +9 -12
  9. package/plugins/code-tour.ts +15 -16
  10. package/plugins/config-schema.json +10 -0
  11. package/plugins/csharp_support.ts +25 -30
  12. package/plugins/css-lsp.ts +15 -22
  13. package/plugins/dart-lsp.ts +9 -12
  14. package/plugins/dashboard.ts +118 -0
  15. package/plugins/devcontainer.i18n.json +84 -28
  16. package/plugins/devcontainer.ts +897 -170
  17. package/plugins/diagnostics_panel.ts +10 -17
  18. package/plugins/elixir-lsp.ts +9 -12
  19. package/plugins/erlang-lsp.ts +9 -12
  20. package/plugins/examples/bookmarks.ts +10 -16
  21. package/plugins/find_references.ts +5 -9
  22. package/plugins/flash.ts +577 -0
  23. package/plugins/fsharp-lsp.ts +9 -12
  24. package/plugins/git_explorer.ts +16 -20
  25. package/plugins/git_gutter.ts +65 -79
  26. package/plugins/git_log.ts +8 -8
  27. package/plugins/gleam-lsp.ts +9 -12
  28. package/plugins/go-lsp.ts +15 -22
  29. package/plugins/graphql-lsp.ts +9 -12
  30. package/plugins/haskell-lsp.ts +9 -12
  31. package/plugins/html-lsp.ts +15 -24
  32. package/plugins/java-lsp.ts +9 -12
  33. package/plugins/json-lsp.ts +15 -24
  34. package/plugins/julia-lsp.ts +9 -12
  35. package/plugins/kotlin-lsp.ts +15 -22
  36. package/plugins/latex-lsp.ts +9 -12
  37. package/plugins/lib/fresh.d.ts +378 -0
  38. package/plugins/lua-lsp.ts +15 -22
  39. package/plugins/markdown_compose.ts +78 -122
  40. package/plugins/markdown_source.ts +8 -10
  41. package/plugins/marksman-lsp.ts +9 -12
  42. package/plugins/merge_conflict.ts +15 -17
  43. package/plugins/nim-lsp.ts +9 -12
  44. package/plugins/nix-lsp.ts +9 -12
  45. package/plugins/nushell-lsp.ts +9 -12
  46. package/plugins/ocaml-lsp.ts +9 -12
  47. package/plugins/odin-lsp.ts +15 -22
  48. package/plugins/path_complete.ts +5 -6
  49. package/plugins/perl-lsp.ts +9 -12
  50. package/plugins/php-lsp.ts +15 -22
  51. package/plugins/pkg.ts +10 -21
  52. package/plugins/protobuf-lsp.ts +9 -12
  53. package/plugins/python-lsp.ts +15 -24
  54. package/plugins/r-lsp.ts +9 -12
  55. package/plugins/ruby-lsp.ts +15 -22
  56. package/plugins/rust-lsp.ts +18 -28
  57. package/plugins/scala-lsp.ts +9 -12
  58. package/plugins/schemas/theme.schema.json +18 -0
  59. package/plugins/search_replace.ts +10 -13
  60. package/plugins/solidity-lsp.ts +9 -12
  61. package/plugins/sql-lsp.ts +9 -12
  62. package/plugins/svelte-lsp.ts +9 -12
  63. package/plugins/swift-lsp.ts +9 -12
  64. package/plugins/tailwindcss-lsp.ts +9 -12
  65. package/plugins/templ-lsp.ts +9 -12
  66. package/plugins/terraform-lsp.ts +9 -12
  67. package/plugins/theme_editor.i18n.json +70 -14
  68. package/plugins/theme_editor.ts +152 -208
  69. package/plugins/toml-lsp.ts +15 -22
  70. package/plugins/tsconfig.json +100 -0
  71. package/plugins/typescript-lsp.ts +15 -24
  72. package/plugins/typst-lsp.ts +15 -22
  73. package/plugins/vi_mode.ts +77 -290
  74. package/plugins/vue-lsp.ts +9 -12
  75. package/plugins/yaml-lsp.ts +15 -22
  76. package/plugins/zig-lsp.ts +9 -12
@@ -35,7 +35,8 @@ const INSTALL_COMMANDS = {
35
35
 
36
36
  let perlLspError: { serverCommand: string; message: string } | null = null;
37
37
 
38
- function on_perl_lsp_server_error(data: LspServerErrorData): void {
38
+
39
+ editor.on("lsp_server_error", (data) => {
39
40
  if (data.language !== "perl") {
40
41
  return;
41
42
  }
@@ -54,11 +55,10 @@ function on_perl_lsp_server_error(data: LspServerErrorData): void {
54
55
  } else {
55
56
  editor.setStatus(`Perl LSP error: ${data.message}`);
56
57
  }
57
- }
58
- registerHandler("on_perl_lsp_server_error", on_perl_lsp_server_error);
59
- editor.on("lsp_server_error", "on_perl_lsp_server_error");
58
+ });
59
+
60
60
 
61
- function on_perl_lsp_status_clicked(data: LspStatusClickedData): void {
61
+ editor.on("lsp_status_clicked", (data) => {
62
62
  if (data.language !== "perl" || !perlLspError) {
63
63
  return;
64
64
  }
@@ -76,11 +76,10 @@ function on_perl_lsp_status_clicked(data: LspStatusClickedData): void {
76
76
  { id: "dismiss", label: "Dismiss (ESC)" },
77
77
  ],
78
78
  });
79
- }
80
- registerHandler("on_perl_lsp_status_clicked", on_perl_lsp_status_clicked);
81
- editor.on("lsp_status_clicked", "on_perl_lsp_status_clicked");
79
+ });
80
+
82
81
 
83
- function on_perl_lsp_action_result(data: ActionPopupResultData): void {
82
+ editor.on("action_popup_result", (data) => {
84
83
  if (data.popup_id !== "perl-lsp-help") {
85
84
  return;
86
85
  }
@@ -111,8 +110,6 @@ function on_perl_lsp_action_result(data: ActionPopupResultData): void {
111
110
  default:
112
111
  editor.debug(`perl-lsp: Unknown action: ${data.action_id}`);
113
112
  }
114
- }
115
- registerHandler("on_perl_lsp_action_result", on_perl_lsp_action_result);
116
- editor.on("action_popup_result", "on_perl_lsp_action_result");
113
+ });
117
114
 
118
115
  editor.debug("perl-lsp: Plugin loaded");
@@ -53,7 +53,10 @@ let phpLspError: { serverCommand: string; message: string } | null = null;
53
53
  /**
54
54
  * Handle LSP server errors for PHP
55
55
  */
56
- function on_php_lsp_server_error(data: LspServerErrorData): void {
56
+
57
+
58
+ // Register hook for LSP server errors
59
+ editor.on("lsp_server_error", (data) => {
57
60
  // Only handle PHP language errors
58
61
  if (data.language !== "php") {
59
62
  return;
@@ -75,18 +78,15 @@ function on_php_lsp_server_error(data: LspServerErrorData): void {
75
78
  } else {
76
79
  editor.setStatus(`PHP LSP error: ${data.message}`);
77
80
  }
78
- }
79
- registerHandler("on_php_lsp_server_error", on_php_lsp_server_error);
80
-
81
- // Register hook for LSP server errors
82
- editor.on("lsp_server_error", "on_php_lsp_server_error");
81
+ });
83
82
 
84
83
  /**
85
84
  * Handle status bar click when there's a PHP LSP error
86
85
  */
87
- function on_php_lsp_status_clicked(
88
- data: LspStatusClickedData
89
- ): void {
86
+
87
+
88
+ // Register hook for status bar clicks
89
+ editor.on("lsp_status_clicked", (data) => {
90
90
  // Only handle PHP language clicks when there's an error
91
91
  if (data.language !== "php" || !phpLspError) {
92
92
  return;
@@ -107,18 +107,15 @@ function on_php_lsp_status_clicked(
107
107
  { id: "dismiss", label: "Dismiss (ESC)" },
108
108
  ],
109
109
  });
110
- }
111
- registerHandler("on_php_lsp_status_clicked", on_php_lsp_status_clicked);
112
-
113
- // Register hook for status bar clicks
114
- editor.on("lsp_status_clicked", "on_php_lsp_status_clicked");
110
+ });
115
111
 
116
112
  /**
117
113
  * Handle action popup results for PHP LSP help
118
114
  */
119
- function on_php_lsp_action_result(
120
- data: ActionPopupResultData
121
- ): void {
115
+
116
+
117
+ // Register hook for action popup results
118
+ editor.on("action_popup_result", (data) => {
122
119
  // Only handle our popup
123
120
  if (data.popup_id !== "php-lsp-help") {
124
121
  return;
@@ -156,10 +153,6 @@ function on_php_lsp_action_result(
156
153
  default:
157
154
  editor.debug(`php-lsp: Unknown action: ${data.action_id}`);
158
155
  }
159
- }
160
- registerHandler("on_php_lsp_action_result", on_php_lsp_action_result);
161
-
162
- // Register hook for action popup results
163
- editor.on("action_popup_result", "on_php_lsp_action_result");
156
+ });
164
157
 
165
158
  editor.debug("php-lsp: Plugin loaded");
package/plugins/pkg.ts CHANGED
@@ -2456,11 +2456,9 @@ function pkg_search() : void {
2456
2456
  }
2457
2457
  registerHandler("pkg_search", pkg_search);
2458
2458
 
2459
- function onPkgSearchConfirmed(args: {
2460
- prompt_type: string;
2461
- selected_index: number | null;
2462
- input: string;
2463
- }): boolean {
2459
+
2460
+
2461
+ editor.on("prompt_confirmed", (args) => {
2464
2462
  if (args.prompt_type !== "pkg-search") return true;
2465
2463
 
2466
2464
  pkgState.searchQuery = args.input.trim();
@@ -2469,21 +2467,17 @@ function onPkgSearchConfirmed(args: {
2469
2467
  updatePkgManagerView();
2470
2468
 
2471
2469
  return true;
2472
- }
2473
- registerHandler("onPkgSearchConfirmed", onPkgSearchConfirmed);
2470
+ });
2474
2471
 
2475
- editor.on("prompt_confirmed", "onPkgSearchConfirmed");
2476
2472
 
2477
- function on_pkg_resize(): void {
2473
+ editor.on("resize", () => {
2478
2474
  if (!pkgState.isOpen) return;
2479
2475
  const viewport = editor.getViewport();
2480
2476
  if (viewport) {
2481
2477
  pkgState.viewportHeight = viewport.height;
2482
2478
  }
2483
2479
  updatePkgManagerView();
2484
- }
2485
- registerHandler("on_pkg_resize", on_pkg_resize);
2486
- editor.on("resize", "on_pkg_resize");
2480
+ });
2487
2481
 
2488
2482
  // Legacy Finder-based UI (kept for backwards compatibility)
2489
2483
  const registryFinder = new Finder<[string, RegistryEntry]>(editor, {
@@ -2580,11 +2574,9 @@ function pkg_install_url() : void {
2580
2574
  }
2581
2575
  registerHandler("pkg_install_url", pkg_install_url);
2582
2576
 
2583
- async function onPkgInstallUrlConfirmed(args: {
2584
- prompt_type: string;
2585
- selected_index: number | null;
2586
- input: string;
2587
- }): Promise<boolean> {
2577
+
2578
+
2579
+ editor.on("prompt_confirmed", async (args) => {
2588
2580
  if (args.prompt_type !== "pkg-install-url") return true;
2589
2581
 
2590
2582
  const url = args.input.trim();
@@ -2595,10 +2587,7 @@ async function onPkgInstallUrlConfirmed(args: {
2595
2587
  }
2596
2588
 
2597
2589
  return true;
2598
- }
2599
- registerHandler("onPkgInstallUrlConfirmed", onPkgInstallUrlConfirmed);
2600
-
2601
- editor.on("prompt_confirmed", "onPkgInstallUrlConfirmed");
2590
+ });
2602
2591
 
2603
2592
  /**
2604
2593
  * Open the package manager UI
@@ -49,7 +49,8 @@ let protobufLspError: { serverCommand: string; message: string } | null = null;
49
49
  /**
50
50
  * Handle LSP server errors for Protobuf
51
51
  */
52
- function on_protobuf_lsp_server_error(data: LspServerErrorData): void {
52
+
53
+ editor.on("lsp_server_error", (data) => {
53
54
  if (data.language !== "protobuf") {
54
55
  return;
55
56
  }
@@ -68,14 +69,13 @@ function on_protobuf_lsp_server_error(data: LspServerErrorData): void {
68
69
  } else {
69
70
  editor.setStatus(`Protobuf LSP error: ${data.message}`);
70
71
  }
71
- }
72
- registerHandler("on_protobuf_lsp_server_error", on_protobuf_lsp_server_error);
73
- editor.on("lsp_server_error", "on_protobuf_lsp_server_error");
72
+ });
74
73
 
75
74
  /**
76
75
  * Handle status bar click when there's a Protobuf LSP error
77
76
  */
78
- function on_protobuf_lsp_status_clicked(data: LspStatusClickedData): void {
77
+
78
+ editor.on("lsp_status_clicked", (data) => {
79
79
  if (data.language !== "protobuf" || !protobufLspError) {
80
80
  return;
81
81
  }
@@ -94,14 +94,13 @@ function on_protobuf_lsp_status_clicked(data: LspStatusClickedData): void {
94
94
  { id: "dismiss", label: "Dismiss (ESC)" },
95
95
  ],
96
96
  });
97
- }
98
- registerHandler("on_protobuf_lsp_status_clicked", on_protobuf_lsp_status_clicked);
99
- editor.on("lsp_status_clicked", "on_protobuf_lsp_status_clicked");
97
+ });
100
98
 
101
99
  /**
102
100
  * Handle action popup results for Protobuf LSP help
103
101
  */
104
- function on_protobuf_lsp_action_result(data: ActionPopupResultData): void {
102
+
103
+ editor.on("action_popup_result", (data) => {
105
104
  if (data.popup_id !== "protobuf-lsp-help") {
106
105
  return;
107
106
  }
@@ -137,8 +136,6 @@ function on_protobuf_lsp_action_result(data: ActionPopupResultData): void {
137
136
  default:
138
137
  editor.debug(`protobuf-lsp: Unknown action: ${data.action_id}`);
139
138
  }
140
- }
141
- registerHandler("on_protobuf_lsp_action_result", on_protobuf_lsp_action_result);
142
- editor.on("action_popup_result", "on_protobuf_lsp_action_result");
139
+ });
143
140
 
144
141
  editor.debug("protobuf-lsp: Plugin loaded");
@@ -49,9 +49,10 @@ let pythonLspError: { serverCommand: string; message: string } | null = null;
49
49
  /**
50
50
  * Handle LSP server errors for Python
51
51
  */
52
- function on_python_lsp_server_error(
53
- data: LspServerErrorData
54
- ): void {
52
+
53
+
54
+ // Register hook for LSP server errors
55
+ editor.on("lsp_server_error", (data) => {
55
56
  // Only handle Python language errors
56
57
  if (data.language !== "python") {
57
58
  return;
@@ -75,18 +76,15 @@ function on_python_lsp_server_error(
75
76
  } else {
76
77
  editor.setStatus(`Python LSP error: ${data.message}`);
77
78
  }
78
- }
79
- registerHandler("on_python_lsp_server_error", on_python_lsp_server_error);
80
-
81
- // Register hook for LSP server errors
82
- editor.on("lsp_server_error", "on_python_lsp_server_error");
79
+ });
83
80
 
84
81
  /**
85
82
  * Handle status bar click when there's a Python LSP error
86
83
  */
87
- function on_python_lsp_status_clicked(
88
- data: LspStatusClickedData
89
- ): void {
84
+
85
+
86
+ // Register hook for status bar clicks
87
+ editor.on("lsp_status_clicked", (data) => {
90
88
  // Only handle Python language clicks when there's an error
91
89
  if (data.language !== "python" || !pythonLspError) {
92
90
  return;
@@ -107,18 +105,15 @@ function on_python_lsp_status_clicked(
107
105
  { id: "dismiss", label: "Dismiss (ESC)" },
108
106
  ],
109
107
  });
110
- }
111
- registerHandler("on_python_lsp_status_clicked", on_python_lsp_status_clicked);
112
-
113
- // Register hook for status bar clicks
114
- editor.on("lsp_status_clicked", "on_python_lsp_status_clicked");
108
+ });
115
109
 
116
110
  /**
117
111
  * Handle action popup results for Python LSP help
118
112
  */
119
- function on_python_lsp_action_result(
120
- data: ActionPopupResultData
121
- ): void {
113
+
114
+
115
+ // Register hook for action popup results
116
+ editor.on("action_popup_result", (data) => {
122
117
  // Only handle our popup
123
118
  if (data.popup_id !== "python-lsp-help") {
124
119
  return;
@@ -156,10 +151,6 @@ function on_python_lsp_action_result(
156
151
  default:
157
152
  editor.debug(`python-lsp: Unknown action: ${data.action_id}`);
158
153
  }
159
- }
160
- registerHandler("on_python_lsp_action_result", on_python_lsp_action_result);
161
-
162
- // Register hook for action popup results
163
- editor.on("action_popup_result", "on_python_lsp_action_result");
154
+ });
164
155
 
165
156
  editor.debug("python-lsp: Plugin loaded");
package/plugins/r-lsp.ts CHANGED
@@ -35,7 +35,8 @@ const INSTALL_COMMANDS = {
35
35
 
36
36
  let rLspError: { serverCommand: string; message: string } | null = null;
37
37
 
38
- function on_r_lsp_server_error(data: LspServerErrorData): void {
38
+
39
+ editor.on("lsp_server_error", (data) => {
39
40
  if (data.language !== "r") {
40
41
  return;
41
42
  }
@@ -54,11 +55,10 @@ function on_r_lsp_server_error(data: LspServerErrorData): void {
54
55
  } else {
55
56
  editor.setStatus(`R LSP error: ${data.message}`);
56
57
  }
57
- }
58
- registerHandler("on_r_lsp_server_error", on_r_lsp_server_error);
59
- editor.on("lsp_server_error", "on_r_lsp_server_error");
58
+ });
59
+
60
60
 
61
- function on_r_lsp_status_clicked(data: LspStatusClickedData): void {
61
+ editor.on("lsp_status_clicked", (data) => {
62
62
  if (data.language !== "r" || !rLspError) {
63
63
  return;
64
64
  }
@@ -76,11 +76,10 @@ function on_r_lsp_status_clicked(data: LspStatusClickedData): void {
76
76
  { id: "dismiss", label: "Dismiss (ESC)" },
77
77
  ],
78
78
  });
79
- }
80
- registerHandler("on_r_lsp_status_clicked", on_r_lsp_status_clicked);
81
- editor.on("lsp_status_clicked", "on_r_lsp_status_clicked");
79
+ });
80
+
82
81
 
83
- function on_r_lsp_action_result(data: ActionPopupResultData): void {
82
+ editor.on("action_popup_result", (data) => {
84
83
  if (data.popup_id !== "r-lsp-help") {
85
84
  return;
86
85
  }
@@ -111,8 +110,6 @@ function on_r_lsp_action_result(data: ActionPopupResultData): void {
111
110
  default:
112
111
  editor.debug(`r-lsp: Unknown action: ${data.action_id}`);
113
112
  }
114
- }
115
- registerHandler("on_r_lsp_action_result", on_r_lsp_action_result);
116
- editor.on("action_popup_result", "on_r_lsp_action_result");
113
+ });
117
114
 
118
115
  editor.debug("r-lsp: Plugin loaded");
@@ -53,7 +53,10 @@ let rubyLspError: { serverCommand: string; message: string } | null = null;
53
53
  /**
54
54
  * Handle LSP server errors for Ruby
55
55
  */
56
- function on_ruby_lsp_server_error(data: LspServerErrorData): void {
56
+
57
+
58
+ // Register hook for LSP server errors
59
+ editor.on("lsp_server_error", (data) => {
57
60
  // Only handle Ruby language errors
58
61
  if (data.language !== "ruby") {
59
62
  return;
@@ -75,18 +78,15 @@ function on_ruby_lsp_server_error(data: LspServerErrorData): void {
75
78
  } else {
76
79
  editor.setStatus(`Ruby LSP error: ${data.message}`);
77
80
  }
78
- }
79
- registerHandler("on_ruby_lsp_server_error", on_ruby_lsp_server_error);
80
-
81
- // Register hook for LSP server errors
82
- editor.on("lsp_server_error", "on_ruby_lsp_server_error");
81
+ });
83
82
 
84
83
  /**
85
84
  * Handle status bar click when there's a Ruby LSP error
86
85
  */
87
- function on_ruby_lsp_status_clicked(
88
- data: LspStatusClickedData
89
- ): void {
86
+
87
+
88
+ // Register hook for status bar clicks
89
+ editor.on("lsp_status_clicked", (data) => {
90
90
  // Only handle Ruby language clicks when there's an error
91
91
  if (data.language !== "ruby" || !rubyLspError) {
92
92
  return;
@@ -107,18 +107,15 @@ function on_ruby_lsp_status_clicked(
107
107
  { id: "dismiss", label: "Dismiss (ESC)" },
108
108
  ],
109
109
  });
110
- }
111
- registerHandler("on_ruby_lsp_status_clicked", on_ruby_lsp_status_clicked);
112
-
113
- // Register hook for status bar clicks
114
- editor.on("lsp_status_clicked", "on_ruby_lsp_status_clicked");
110
+ });
115
111
 
116
112
  /**
117
113
  * Handle action popup results for Ruby LSP help
118
114
  */
119
- function on_ruby_lsp_action_result(
120
- data: ActionPopupResultData
121
- ): void {
115
+
116
+
117
+ // Register hook for action popup results
118
+ editor.on("action_popup_result", (data) => {
122
119
  // Only handle our popup
123
120
  if (data.popup_id !== "ruby-lsp-help") {
124
121
  return;
@@ -156,10 +153,6 @@ function on_ruby_lsp_action_result(
156
153
  default:
157
154
  editor.debug(`ruby-lsp: Unknown action: ${data.action_id}`);
158
155
  }
159
- }
160
- registerHandler("on_ruby_lsp_action_result", on_ruby_lsp_action_result);
161
-
162
- // Register hook for action popup results
163
- editor.on("action_popup_result", "on_ruby_lsp_action_result");
156
+ });
164
157
 
165
158
  editor.debug("ruby-lsp: Plugin loaded");
@@ -48,9 +48,10 @@ let rustLspError: { serverCommand: string; message: string } | null = null;
48
48
  /**
49
49
  * Handle LSP server errors for Rust
50
50
  */
51
- function on_rust_lsp_server_error(
52
- data: LspServerErrorData
53
- ): void {
51
+
52
+
53
+ // Register hook for LSP server errors
54
+ editor.on("lsp_server_error", (data) => {
54
55
  // Only handle Rust language errors
55
56
  if (data.language !== "rust") {
56
57
  return;
@@ -72,18 +73,15 @@ function on_rust_lsp_server_error(
72
73
  } else {
73
74
  editor.setStatus(`Rust LSP error: ${data.message}`);
74
75
  }
75
- }
76
- registerHandler("on_rust_lsp_server_error", on_rust_lsp_server_error);
77
-
78
- // Register hook for LSP server errors
79
- editor.on("lsp_server_error", "on_rust_lsp_server_error");
76
+ });
80
77
 
81
78
  /**
82
79
  * Handle status bar click when there's a Rust LSP error
83
80
  */
84
- function on_rust_lsp_status_clicked(
85
- data: LspStatusClickedData
86
- ): void {
81
+
82
+
83
+ // Register hook for status bar clicks
84
+ editor.on("lsp_status_clicked", (data) => {
87
85
  editor.debug(
88
86
  `rust-lsp: lsp_status_clicked hook received - language=${data.language}, has_error=${data.has_error}, rustLspError=${rustLspError ? "SET" : "NULL"}`
89
87
  );
@@ -111,18 +109,15 @@ function on_rust_lsp_status_clicked(
111
109
  ],
112
110
  });
113
111
  editor.debug(`rust-lsp: showActionPopup returned ${result}`);
114
- }
115
- registerHandler("on_rust_lsp_status_clicked", on_rust_lsp_status_clicked);
116
-
117
- // Register hook for status bar clicks
118
- editor.on("lsp_status_clicked", "on_rust_lsp_status_clicked");
112
+ });
119
113
 
120
114
  /**
121
115
  * Handle action popup results for Rust LSP help
122
116
  */
123
- function on_rust_lsp_action_result(
124
- data: ActionPopupResultData
125
- ): void {
117
+
118
+
119
+ // Register hook for action popup results
120
+ editor.on("action_popup_result", (data) => {
126
121
  editor.debug(
127
122
  `rust-lsp: action_popup_result received - popup_id=${data.popup_id}, action_id=${data.action_id}`
128
123
  );
@@ -160,11 +155,7 @@ function on_rust_lsp_action_result(
160
155
  default:
161
156
  editor.debug(`rust-lsp: Unknown action: ${data.action_id}`);
162
157
  }
163
- }
164
- registerHandler("on_rust_lsp_action_result", on_rust_lsp_action_result);
165
-
166
- // Register hook for action popup results
167
- editor.on("action_popup_result", "on_rust_lsp_action_result");
158
+ });
168
159
 
169
160
  // =====================================================================
170
161
  // Rust LSP mode switching (Full vs Reduced Memory)
@@ -221,7 +212,8 @@ editor.registerCommand(
221
212
  null
222
213
  );
223
214
 
224
- function on_rust_lsp_mode_selected(data: ActionPopupResultData): void {
215
+
216
+ editor.on("action_popup_result", (data) => {
225
217
  if (data.popup_id !== "rust-lsp-mode") {
226
218
  return;
227
219
  }
@@ -255,8 +247,6 @@ function on_rust_lsp_mode_selected(data: ActionPopupResultData): void {
255
247
  case "dismissed":
256
248
  break;
257
249
  }
258
- }
259
- registerHandler("on_rust_lsp_mode_selected", on_rust_lsp_mode_selected);
260
- editor.on("action_popup_result", "on_rust_lsp_mode_selected");
250
+ });
261
251
 
262
252
  editor.debug("rust-lsp: Plugin loaded");
@@ -36,7 +36,8 @@ const INSTALL_COMMANDS = {
36
36
 
37
37
  let scalaLspError: { serverCommand: string; message: string } | null = null;
38
38
 
39
- function on_scala_lsp_server_error(data: LspServerErrorData): void {
39
+
40
+ editor.on("lsp_server_error", (data) => {
40
41
  if (data.language !== "scala") {
41
42
  return;
42
43
  }
@@ -55,11 +56,10 @@ function on_scala_lsp_server_error(data: LspServerErrorData): void {
55
56
  } else {
56
57
  editor.setStatus(`Scala LSP error: ${data.message}`);
57
58
  }
58
- }
59
- registerHandler("on_scala_lsp_server_error", on_scala_lsp_server_error);
60
- editor.on("lsp_server_error", "on_scala_lsp_server_error");
59
+ });
60
+
61
61
 
62
- function on_scala_lsp_status_clicked(data: LspStatusClickedData): void {
62
+ editor.on("lsp_status_clicked", (data) => {
63
63
  if (data.language !== "scala" || !scalaLspError) {
64
64
  return;
65
65
  }
@@ -77,11 +77,10 @@ function on_scala_lsp_status_clicked(data: LspStatusClickedData): void {
77
77
  { id: "dismiss", label: "Dismiss (ESC)" },
78
78
  ],
79
79
  });
80
- }
81
- registerHandler("on_scala_lsp_status_clicked", on_scala_lsp_status_clicked);
82
- editor.on("lsp_status_clicked", "on_scala_lsp_status_clicked");
80
+ });
81
+
83
82
 
84
- function on_scala_lsp_action_result(data: ActionPopupResultData): void {
83
+ editor.on("action_popup_result", (data) => {
85
84
  if (data.popup_id !== "scala-lsp-help") {
86
85
  return;
87
86
  }
@@ -112,8 +111,6 @@ function on_scala_lsp_action_result(data: ActionPopupResultData): void {
112
111
  default:
113
112
  editor.debug(`scala-lsp: Unknown action: ${data.action_id}`);
114
113
  }
115
- }
116
- registerHandler("on_scala_lsp_action_result", on_scala_lsp_action_result);
117
- editor.on("action_popup_result", "on_scala_lsp_action_result");
114
+ });
118
115
 
119
116
  editor.debug("scala-lsp: Plugin loaded");
@@ -794,6 +794,24 @@
794
794
  255,
795
795
  255
796
796
  ]
797
+ },
798
+ "label_bg": {
799
+ "description": "Background color for jump labels (e.g. flash plugin labels).\nShould be visually distinct from `match_bg` so labels stand\nout against highlighted matches. Default: bright magenta.",
800
+ "$ref": "#/$defs/ColorDef",
801
+ "default": [
802
+ 199,
803
+ 78,
804
+ 189
805
+ ]
806
+ },
807
+ "label_fg": {
808
+ "description": "Foreground color for jump labels. Should be high contrast\nagainst `label_bg` so the single label letter is unambiguous\neven on small terminal cells. Default: white.",
809
+ "$ref": "#/$defs/ColorDef",
810
+ "default": [
811
+ 255,
812
+ 255,
813
+ 255
814
+ ]
797
815
  }
798
816
  }
799
817
  },
@@ -1255,7 +1255,9 @@ registerHandler("start_search_replace", start_search_replace);
1255
1255
  // Event handlers (resize updates width)
1256
1256
  // =============================================================================
1257
1257
 
1258
- function onSearchReplaceResize(data: { width: number; height: number }): void {
1258
+
1259
+
1260
+ editor.on("resize", (data) => {
1259
1261
  if (!panel) return;
1260
1262
  // Try viewport first (gives actual split width), fall back to terminal width estimate
1261
1263
  const vp = editor.getViewport();
@@ -1266,31 +1268,26 @@ function onSearchReplaceResize(data: { width: number; height: number }): void {
1266
1268
  panel.viewportWidth = Math.floor(data.width * 0.4);
1267
1269
  }
1268
1270
  updatePanelContent();
1269
- }
1270
- registerHandler("onSearchReplaceResize", onSearchReplaceResize);
1271
-
1272
- editor.on("resize", "onSearchReplaceResize");
1271
+ });
1273
1272
 
1274
1273
  // Prompt handlers (in case prompts are opened externally for this panel - gracefully handle)
1275
- function onSearchReplacePromptCancelled(args: { prompt_type: string }): boolean {
1274
+
1275
+ editor.on("prompt_cancelled", (args) => {
1276
1276
  if (!args.prompt_type.startsWith("search-replace-")) return true;
1277
1277
  return true;
1278
- }
1279
- registerHandler("onSearchReplacePromptCancelled", onSearchReplacePromptCancelled);
1280
- editor.on("prompt_cancelled", "onSearchReplacePromptCancelled");
1278
+ });
1281
1279
 
1282
1280
  // If the panel's virtual buffer is closed externally (via the × button,
1283
1281
  // the Close Buffer/Close Tab commands, or anything else), reset the
1284
1282
  // plugin's internal state so the next invocation of `openPanel` creates
1285
1283
  // a fresh buffer/split instead of trying to update a buffer that no
1286
1284
  // longer exists (which silently no-ops and leaves the user with no UI).
1287
- function onSearchReplaceBufferClosed(args: { buffer_id: number }): void {
1285
+
1286
+ editor.on("buffer_closed", (args) => {
1288
1287
  if (panel && args.buffer_id === panel.resultsBufferId) {
1289
1288
  panel = null;
1290
1289
  }
1291
- }
1292
- registerHandler("onSearchReplaceBufferClosed", onSearchReplaceBufferClosed);
1293
- editor.on("buffer_closed", "onSearchReplaceBufferClosed");
1290
+ });
1294
1291
 
1295
1292
  editor.registerCommand(
1296
1293
  "%cmd.search_replace",