We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70dfc84 commit 2a0cb3cCopy full SHA for 2a0cb3c
neovim/api/buffer.py
@@ -98,17 +98,17 @@ def range(self, start, end):
98
return Range(self, start, end)
99
100
def add_highlight(self, hl_group, line, col_start=0,
101
- col_end=-1, src_id=-1, async=None):
+ col_end=-1, src_id=-1, async_=None):
102
"""Add a highlight to the buffer."""
103
- if async is None:
104
- async = (src_id != 0)
+ if async_ is None:
+ async_ = (src_id != 0)
105
return self.request('nvim_buf_add_highlight', src_id, hl_group,
106
- line, col_start, col_end, async=async)
+ line, col_start, col_end, async_=async_)
107
108
- def clear_highlight(self, src_id, line_start=0, line_end=-1, async=True):
+ def clear_highlight(self, src_id, line_start=0, line_end=-1, async_=True):
109
"""Clear highlights from the buffer."""
110
self.request('nvim_buf_clear_highlight', src_id,
111
- line_start, line_end, async=async)
+ line_start, line_end, async_=async_)
112
113
@property
114
def name(self):
neovim/api/nvim.py
@@ -122,16 +122,16 @@ def request(self, name, *args, **kwargs):
122
functions have python wrapper functions. The `api` object can
123
be also be used to call API functions as methods:
124
125
- vim.api.err_write('ERROR\n', async=True)
+ vim.api.err_write('ERROR\n', async_=True)
126
vim.current.buffer.api.get_mark('.')
127
128
is equivalent to
129
130
- vim.request('nvim_err_write', 'ERROR\n', async=True)
+ vim.request('nvim_err_write', 'ERROR\n', async_=True)
131
vim.request('nvim_buf_get_mark', vim.current.buffer, '.')
132
133
134
- Normally a blocking request will be sent. If the `async` flag is
+ Normally a blocking request will be sent. If the `async_` flag is
135
present and True, a asynchronous notification is sent instead. This
136
will never block, and the return value or error is ignored.
137
"""
neovim/msgpack_rpc/session.py
@@ -72,12 +72,12 @@ def request(self, method, *args, **kwargs):
72
- Run the loop until the response is available
73
- Put requests/notifications received while waiting into a queue
74
75
- If the `async` flag is present and True, a asynchronous notification is
76
- sent instead. This will never block, and the return value or error is
77
- ignored.
+ If the `async_` flag is present and True, a asynchronous notification
+ is sent instead. This will never block, and the return value or error
+ is ignored.
78
79
- async = kwargs.pop('async', False)
80
- if async:
+ async_ = kwargs.pop('async_', False)
+ if async_:
81
self._async_session.notify(method, args)
82
return
83
neovim/plugin/host.py
@@ -46,7 +46,7 @@ def __init__(self, nvim):
46
self._decode_default = IS_PYTHON3
47
48
def _on_async_err(self, msg):
49
- self.nvim.err_write(msg, async=True)
+ self.nvim.err_write(msg, async_=True)
50
51
def start(self, plugins):
52
"""Start listening for msgpack-rpc requests and notifications."""
test/test_client_rpc.py
@@ -44,7 +44,7 @@ def request_cb(name, args):
44
vim.stop_loop()
45
# this would have dead-locked if not async
- vim.funcs.rpcrequest(vim.channel_id, "test-event", async=True)
+ vim.funcs.rpcrequest(vim.channel_id, "test-event", async_=True)
vim.run_loop(request_cb, None, None)
eq(vim.vars['result'], 17)
test/test_events.py
@@ -19,15 +19,15 @@ def test_receiving_events():
19
@with_setup(setup=cleanup)
20
def test_sending_notify():
21
# notify after notify
22
- vim.command("let g:test = 3", async=True)
+ vim.command("let g:test = 3", async_=True)
23
cmd = 'call rpcnotify(%d, "test-event", g:test)' % vim.channel_id
24
- vim.command(cmd, async=True)
+ vim.command(cmd, async_=True)
25
event = vim.next_message()
26
eq(event[1], 'test-event')
27
eq(event[2], [3])
28
29
# request after notify
30
- vim.command("let g:data = 'xyz'", async=True)
+ vim.command("let g:data = 'xyz'", async_=True)
31
eq(vim.eval('g:data'), 'xyz')
32
33
0 commit comments