@@ -423,20 +423,26 @@ Currently supported commands:
423423
424424 call {funcname} {argument}
425425
426- Call a user defined function with [argument] . The function is
427- called with the buffer number of the terminal and the decoded
428- argument. The user function must sanity check the argument.
426+ Call a user defined function with {argument} .
427+ The function is called with two arguments: the buffer number
428+ of the terminal and {argument} , the decoded JSON argument.
429+ The function name must start with "Tapi_" to avoid
430+ accidentally calling a function not meant to be used for the
431+ terminal API
432+ The user function should sanity check the argument.
429433 The function can use | term_sendkeys() | to send back a reply.
430434 Example in JSON: >
431- ["call", "Impression ", ["play", 14]]
435+ ["call", "Tapi_Impression ", ["play", 14]]
432436< Calls a function defined like this: >
433- function Impression (bufnum, arglist)
437+ function Tapi_Impression (bufnum, arglist)
434438 if len(a:arglist) == 2
435- echo "impression " . a:arglist[0]
436- echo "count " . a:arglist[1]
439+ echomsg "impression " . a:arglist[0]
440+ echomsg "count " . a:arglist[1]
437441 endif
438442 endfunc
439- <
443+ < Output from `:echo ` may be erased by a redraw, use `:echomsg `
444+ to be able to see it with `:messages ` .
445+
440446 drop {filename}
441447
442448 Let Vim open a file, like the `:drop ` command. If {filename}
@@ -447,7 +453,7 @@ Currently supported commands:
447453
448454 A trick to have Vim send this escape sequence: >
449455 exe "set t_ts=\<Esc>]51; t_fs=\x07"
450- let &titlestring = '["call","TryThis ",["hello",123]]'
456+ let &titlestring = '["call","Tapi_TryThis ",["hello",123]]'
451457 redraw
452458 set t_ts& t_fs&
453459
0 commit comments