editMessage function
Opens the interactive message editor with initialMessage and returns
what the user leaves in the buffer.
prompt labels the editor, subject and hint describe the prompt in the
error a headless run gets instead of hanging. do commit and
do configure-publish share this — they differ only in those three words.
Only initialText, no defaultValue: the message is already in the
editable buffer, so the "(…)" hint would just repeat it.
Implementation
// coverage:ignore-start
Future<String?> editMessage(
String initialMessage, {
required String prompt,
required String subject,
required String hint,
}) async {
gg.throwWhenNotATerminal(subject, hint);
return await gg.GgPrompts.current.input(
prompt: prompt,
initialText: initialMessage,
asMessageEditor: true,
);
}