There is a list of things that are not allowed to do inside expression mappings (see :h :map-expression).
getcharstr() "blocks" the editor in the expression mapping state while allowing other scheduled functions to be executed. If those scheduled functions do something that is not allowed inside expression mapping, there is an error.
Error inside on_key() callback clears said callback (i.e. it stop being executed).
:h :map-expression
).getcharstr()
"blocks" the editor in the expression mapping state while allowing other scheduled functions to be executed. If those scheduled functions do something that is not allowed inside expression mapping, there is an error.on_key()
callback clears said callback (i.e. it stop being executed).