2
0
mirror of https://github.com/mhinz/neovim-remote synced 2024-11-11 13:10:34 +00:00

From all --remote* options, check the implicit --remote-silent last

References #43.
This commit is contained in:
Marco Hinz 2017-11-13 21:01:21 +01:00
parent 905bbb7dc3
commit f8250c0c38
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F
2 changed files with 10 additions and 5 deletions

View File

@ -334,6 +334,12 @@ def get_address_type(address):
def main(argv=sys.argv, env=os.environ):
options, arguments = parse_args(argv)
# `options` contains all options and their associated arguments.
# `arguments` contains all remaining arguments.
# If no option is given, set options.remote_silent to [] instead of None.
# This way, all remaining arguments will be handled as if they were given
# to --remote-silent.
if all(not x for x in vars(options).values()):
options.remote_silent = []
@ -366,8 +372,6 @@ def main(argv=sys.argv, env=os.environ):
nvim.execute(options.remote + arguments, 'edit')
elif options.remote_wait is not None:
nfiles = nvim.execute(options.remote_wait + arguments, 'edit', wait=True)
elif options.remote_silent is not None:
nvim.execute(options.remote_silent + arguments, 'edit', silent=True)
elif options.remote_wait_silent is not None:
nfiles = nvim.execute(options.remote_wait_silent + arguments, 'edit', silent=True, wait=True)
elif options.remote_tab is not None:
@ -378,8 +382,9 @@ def main(argv=sys.argv, env=os.environ):
nvim.execute(options.remote_tab_silent + arguments, 'tabedit', silent=True)
elif options.remote_tab_wait_silent is not None:
nfiles = nvim.execute(options.remote_tab_wait_silent + arguments, 'tabedit', silent=True, wait=True)
elif arguments:
nvim.execute(arguments, 'edit')
elif options.remote_silent is not None:
# This must be the last remote option being checked.
nvim.execute(options.remote_silent + arguments, 'edit', silent=True)
if options.remote_send and nvim.is_attached():
nvim.server.input(options.remote_send)

View File

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