repl-ui.hx
Shared buffer and formatting functions for REPL-style Helix Steel plugins
- Stars: 3
- Last commit:
- Created:
Shared buffer and formatting functions for REPL-style Helix Steel plugins
Shared Helix/Steel machinery for REPL-style plugins. Extracted from nrepl.hx so other plugins can reuse the buffer and formatting code.
helix-context.scm (make-helix-context): a hash of Helix API functions
injected into the buffer helpers so they never call Helix directly.buffer.scm (repl-buffer struct, repl-buffer:ensure/create/append):
create and append to a named scratch buffer in a split, restoring focus and
mode. Handles the buffer being closed or hidden between appends.format.scm (format-result-common, format-output-list,
format-error-as-comment, take-first-line, whitespace-only?): render an
evaluation result hash ('value, 'output, 'error, 'ex, 'interrupted,
'ns) into REPL buffer text, with caller-supplied prompt and error
formatters.counter.scm (make-eval-counter, eval-counter-next!,
eval-counter-reset!): per-session repl:N:> numbering.coords.scm (char-offset->line-col): rope offset to 1-indexed
(line . column).selection.scm (selection:primary, selection:buffer, selection:ranges):
extract evaluable text and its source location from the focused document.forge pkg install --git https://github.com/waddie/repl-ui.hx
Then require the modules you need:
(require "repl-ui.hx/buffer.scm")
(require "repl-ui.hx/format.scm")
GNU AGPL v3 or later. See LICENSE.md.
README from waddie/repl-ui.hx · GNU Affero General Public License v3.0