mirror of
https://github.com/mhinz/neovim-remote
synced 2024-11-11 13:10:34 +00:00
Improve check for IPv4 address
If the address contains only one colon followed by a number, assume TCPv4 and a Unix domain otherwise. Closes #60.
This commit is contained in:
parent
dac335752a
commit
ec612dc16c
@ -46,8 +46,11 @@ class Neovim():
|
||||
def attach(self):
|
||||
try:
|
||||
if ':' in self.address:
|
||||
ip, port = self.address.split(':')
|
||||
self.server = neovim.attach('tcp', address=ip, port=int(port))
|
||||
ip, port = self.address.split(':', 1)
|
||||
if port.isdigit():
|
||||
self.server = neovim.attach('tcp', address=ip, port=int(port))
|
||||
else:
|
||||
self.server = neovim.attach('socket', path=self.address)
|
||||
else:
|
||||
self.server = neovim.attach('socket', path=self.address)
|
||||
except OSError:
|
||||
|
Loading…
Reference in New Issue
Block a user