Skip to content

Commit 1fcc17f

Browse files
committed
improve message for out-of-thread requests
1 parent e51a310 commit 1fcc17f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

neovim/api/nvim.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def request(self, name, *args, **kwargs):
169169
if (self._session._loop_thread is not None and
170170
threading.current_thread() != self._session._loop_thread):
171171

172-
msg = ("request from non-main thread:\n{}\n"
172+
msg = ("Request from non-main thread.\n"
173+
"Requests from different threads should be wrapped "
174+
"with nvim.async_call(cb, ...) \n{}\n"
173175
.format('\n'.join(format_stack(None, 5)[:-1])))
174176

175177
self.async_call(self._err_cb, msg)

0 commit comments

Comments
 (0)