Experimental modal text editor built for extensibility and flexibility

feat(runtime): manual :multibuffer command to stitch chosen buffers #2

Open amartin.beer
Open opened by amartin.beer

Summary #

A user-facing way to build a multibuffer from a chosen set of open buffers, not just :grep results.

Motivation #

:grep command is the only producer of multibuffers right now, but buf/new-multibuffer API is already general (arbitrary {:id :start :end} excerpts). A manual command lets users merge a few files into one linear editing surface.

Current behavior #

  • buf/new-multibuffer (buffer.janet) builds a multibuffer from excerpts; edit routing, :save-all, :open-excerpt, context, and syntax highlighting all work.
  • The prompt engine (prompt.janet) is single-select only.

Proposed approach #

  • Add a multi-select mechanism: either a prompt.janet multi-select view (mark/unmark candidates, accept the marked set, generic + reusable) or a two-step mark/stitch flow (:bmark then :multibuffer).
  • The command collects the chosen buffers and calls buf/new-multibuffer with an excerpt per buffer (whole file, first N lines, or a picked range).

Scope / notes #

Smaller than per-cursor selections; mostly prompt UI. Reconsider whether window splits (once done) are the better answer for "see/edit several files at once".

Sign up or Sign in to add to the discussion.