You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
When drawing a prompt, (say, multi select), a go template is used to determine what to render. Currently, the template string as well as additional template functions are exposed as global variables (here and here respectively). This is quite convenient as it allows for customization of the output, but the data passed into the template is internally specified, and can't be configured. It would be great if template data could be brought in line with the other template components and made to be configurable externally.
Currently, to get around this, it’s possible to use for.Sprintf to format the template with the data we want every time we want to draw it on the screen. This works, but is inefficient and can cause problems because the templates are cached.
Naively, this could be achieved by having a wrapper around the data passed to the template, and a configurable map[string]any:
When drawing a prompt, (say, multi select), a go template is used to determine what to render. Currently, the template string as well as additional template functions are exposed as global variables (here and here respectively). This is quite convenient as it allows for customization of the output, but the data passed into the template is internally specified, and can't be configured. It would be great if template data could be brought in line with the other template components and made to be configurable externally.
Currently, to get around this, it’s possible to use
for.Sprintf
to format the template with the data we want every time we want to draw it on the screen. This works, but is inefficient and can cause problems because the templates are cached.Naively, this could be achieved by having a wrapper around the data passed to the template, and a configurable
map[string]any
:Any customization to the template can then be included in the global variable, without affecting the existing data to the template.
The text was updated successfully, but these errors were encountered: