Closed fogine closed 4 years ago
I will accept this pull request, however, I am planning to make active-entry trigger when an active entry changed, so it does not get confusing.
About custom entry format, I should have made it explicit that quotes in {{ }}
are reserved to prevent breaking changes. Its purpose is to allow easy parse for scripts that does not have json parser included out-of-the-box like bash, and creating a parser is no easy feat, while generating is simple enough, you only have to worry about escaping the text on dynamic content.
Currently
custom-key
event does not have many use cases as there is no way to get actively selected line/record with it.This fixes that, and basically emits 2 events when custom key is pressed.
First it emits
active-entry
with currently selected record followed bycustom-key
event which signalizes which key was pressed.This implementation is compatible with current design, that is, writes events in any user defined format (default json) delimited by
\n
(new line) control character.To parse the
custom key
event in default format, the user has to split incoming data with\n
and then parse individual segment as json messages. This is not ideal but its the only way how to not break to current design...In the future it would be good choice to drop custom event format feature and support only
json
. It would makerofi-blocks
more scalable and consistent.