terminal: hint first slash command on single slash

Triggers a ghost hint with the first matching slash command when the
user inputs a single `/` character.
This commit is contained in:
Adrià Arrufat
2026-06-09 10:29:57 +02:00
parent cd8192656b
commit 59fb13892e

View File

@@ -545,6 +545,8 @@ fn hintsCallback(input_c: [*c]const u8, arg: ?*anyopaque) callconv(.c) [*c]const
// Inside an open `'''…'''` body the buffer is script text, not kv args.
if (Schema.hasUnclosedTripleQuote(input)) return null;
if (std.mem.eql(u8, input, "/")) return ghostFirstMatch(&all_slash_names, "", "");
if (Schema.parseSlashCommand(input)) |parts| {
const ends_ws = input[input.len - 1] == ' ';
if (Schema.findByName(parts.name)) |schema| {