Group of 4 Use it now Notable
Plugins and hooks can fill the prompt input box in replace, append, or insert mode, with new APIs to read and stamp these actions
What
The internal system plugins and hooks use to put text into your input box (the "draft") has been extended.
- The
fillDraftAPI, used by plugins and hooks to populate the input box, now takes a mode:replace(the old default, replaces everything),append(adds text to the end of what's already there), orinsert(inserts text at your cursor position). - A companion
readDraftAPI (also exposed as the hook method$.prompt.read) lets a plugin read the current input box text and cursor position before deciding what to do. - Slash-command-triggered plugin actions of type
prompt.fill(defaulting toreplacemode) andprompt.suggestnow get the same default plugin-origin metadata thatcommand.runactions already had. - A new settings layer called
memorywas added alongside the existing managed/user/project/local layers, and the replace/append/insert modes are validated against an explicit list, with an error shown for invalid modes.
Why
This gives plugins finer control over how they interact with whatever you're already typing, instead of always overwriting it. A plugin can now add a suggestion after your text or insert something right where your cursor is, and it can check what's already in the box first.