This will allow you to reference the value in the unnamed (yank) register in your prompts. I made it throw an error if that value is empty, not sure if this kind of error reported is desired in the project. Feel free to change the name of the variable as well.
The idea here is that you have three sources of input:
The register with data to reference
The visual selection with text to modify
The prompt for instructions to perform
Here's an example of how it might be used with a custom prompt I made:
Modify_With_Reference = {
prompt = table.concat({
"Referencing the following:",
"$register",
"Modify the following text, $input, just output the final text without additional quotes around it:",
"$text",
}, "\n"),
replace = true
}
This will allow you to reference the value in the unnamed (yank) register in your prompts. I made it throw an error if that value is empty, not sure if this kind of error reported is desired in the project. Feel free to change the name of the variable as well.
The idea here is that you have three sources of input:
Here's an example of how it might be used with a custom prompt I made:
https://github.com/David-Kunz/gen.nvim/assets/15198/394448c5-a248-469c-91bc-2908005fd617