-*builtin.txt* For Vim version 9.2. Last change: 2026 Apr 26
+*builtin.txt* For Vim version 9.2. Last change: 2026 Apr 27
VIM REFERENCE MANUAL by Bram Moolenaar
second argument: >
GetBuffer()->listener_add(callback)
<
+ This function is not available in the |sandbox|.
+
Return type: |Number|
Can also be used as a |method|: >
GetBuffer()->listener_flush()
<
+ This function is not available in the |sandbox|.
+
Return type: void
Can also be used as a |method|: >
GetListenerId()->listener_remove()
<
+ This function is not available in the |sandbox|.
+
Return type: |Number|
Can also be used as a |method|: >
GetOpts()->redraw_listener_add()
<
+ This function is not available in the |sandbox|.
+
Return type: |Number|
bwipe!
endfunc
+func Test_listener_add_in_sandbox()
+ call assert_fails(
+ \ 'sandbox call redraw_listener_add({"on_start": function("tr")})',
+ \ 'E48:')
+ call assert_fails(
+ \ 'sandbox call listener_add({"on_start": function("tr")})',
+ \ 'E48:')
+ call assert_fails('sandbox call listener_flush()', 'E48:')
+ call assert_fails('sandbox call listener_remove(1)', 'E48:')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab