Allow sending exit code with BufDelete RPC message

A buffer managed by nvr sets the b:nvr variable. It contains the channel IDs of
all connected nvr clients.

nvr clients understand two RPC messages, BufDelete and Exit.

The latter always required the exit code as argument and the former optionally
takes one as well now.

  let exitcode = 1
  for chan in b:nvr
    call rpcnotify(chan, 'BufDelete', exitcode)
  endfor

Closes #89
pull/95/head v2.1.0
Marco Hinz 6 years ago
parent 5d83a59255
commit bd7bc4d9fc
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

@ -541,6 +541,7 @@ def main(argv=sys.argv, env=os.environ):
wait_for_n_buffers -= 1
if wait_for_n_buffers == 0:
nvr.server.stop_loop()
exitcode = 0 if len(args) == 0 else args[0]
elif msg == 'Exit':
nvr.server.stop_loop()
exitcode = args[0]

@ -19,7 +19,7 @@ setup(
'console_scripts': ['nvr = nvr.nvr:main']
},
packages = ['nvr'],
version = '2.0.10',
version = '2.1.0',
license = 'MIT',
keywords = 'neovim nvim nvr remote helper',
classifiers = [

Loading…
Cancel
Save