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

55 Commits

Author SHA1 Message Date
Marco Hinz
282aa12fb4
Check if Unix domain socket is connectable before attaching 2017-09-30 14:13:15 +02:00
Marco Hinz
d28c9c00bf
Remove useless level of indentation 2017-09-30 12:59:01 +02:00
Marco Hinz
538e18be6d
Move address type detection logic into own function 2017-09-30 12:58:51 +02:00
Marco Hinz
ec612dc16c
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.
2017-09-29 17:20:20 +02:00
Marco Hinz
d138b98bde
Ignore "E37: No write since last change" in --remote*
References https://github.com/mhinz/neovim-remote/issues/54
2017-08-07 02:02:29 +02:00
Marco Hinz
64e9f486a1
Revert "Temporarily reset &modified when opening files"
This reverts commit 6845b8b5a6.
2017-08-07 01:58:31 +02:00
Marco Hinz
6845b8b5a6
Temporarily reset &modified when opening files
:edit and similar commands used by the --remote* options throw an exception if
the buffer is modified:

    E37: No write since last change (add ! to override)

Using :enew! doesn't work, since it reverts all changes. Thus we simply reset
&modified temporarily.

References https://github.com/mhinz/neovim-remote/issues/54
2017-08-07 00:35:33 +02:00
Marco Hinz
c1fedb4de8
Redirect stdout to stdin when forking
This is needed so the new nvim process ignores the data in stdin, because it
comes from a TTY now.
2017-08-04 02:41:54 +02:00
Marco Hinz
4b8c384462
Only process + at the beginning of --remote*
nvr +1 +2 3 +4 5

The above will do the following in the given order:

  - open file "5"
  - open file "+4"
  - open file "3"
  - execute :2
  - execute :1

That's how Vim does it.
2017-08-02 15:42:02 +02:00
Marco Hinz
957082771b
Ignore OSError instead of FileNotFoundError 2017-08-02 12:10:03 +02:00
Marco Hinz
13808fd5ec
Ignore only invalid addresses 2017-08-02 11:52:11 +02:00
Harm te Hennepe
a85aa94321 Support multiple + commands and let empty + go to the last line 2017-08-02 11:46:35 +02:00
Drew Neil
ee9a6c4f39 Document -p flag independent of --remote-tab flag 2017-08-01 16:40:59 +02:00
Marco Hinz
a973424000
Make -s overwrite all other options
References https://github.com/mhinz/neovim-remote/issues/48#issuecomment-318163612
2017-07-27 00:29:08 +02:00
Marco Hinz
625b8ddf45
Change command to run using $NVR_CMD
References https://github.com/mhinz/neovim-remote/issues/48
2017-07-26 01:07:10 +02:00
Marco Hinz
4e827d4d7d
Process all options before waiting
References https://github.com/mhinz/neovim-remote/issues/46
2017-07-11 15:46:44 +02:00
Marco Hinz
fa9ecbcc71
--serverlist: don't print empty lines 2017-06-30 02:18:58 +02:00
Marco Hinz
af4103a16a
Sort short options in help output 2017-06-30 02:09:42 +02:00
Marco Hinz
5df48bbf2c
Add -s option 2017-06-30 02:06:35 +02:00
Marco Hinz
031c7a911f
Rename variable "flags" to "options" 2017-06-20 21:15:25 +02:00
Marco Hinz
70f8bf86d7
Docs: add nvr/git example to help message 2017-06-20 21:13:15 +02:00
Marco Hinz
1e9be0473f
Docs: instance -> process 2017-06-20 20:50:55 +02:00
Marco Hinz
2111ea9d0a
Consider the possibility that "nvim" is not in $PATH 2017-06-20 20:26:56 +02:00
Marco Hinz
6e1fe04456
Make forked child try attaching multiple times
This most likely makes it attach faster than the previous fixed 1 second
timeout.
2017-06-20 15:11:32 +02:00
Marco Hinz
58d56cba6b
More robust socket handling 2017-06-20 15:03:06 +02:00
Marco Hinz
8f8fa3ed27
Improve the start of a new instance
If the given instance is not found, we fork nvr.

The parent process gets replaced by a new nvim instance.

The child waits for one second and then tries attaching to the newly started
nvim instance.

Advantage: All options passed to nvr are now correctly handled even by new nvim
instances that were started by nvr.

References https://github.com/mhinz/neovim-remote/issues/44
2017-06-20 13:47:59 +02:00
Marco Hinz
7422ee6d90
Handle files beginning with - for --remote options
Small tradeoff: You get no error anymore when you provide no arguments to
--remote and friends.

Internally this results in an empty list instead of None. This is important,
because otherwise you'd get an error with `--remote -- foo`, because `--` and
`foo` would be parsed into the remaining arguments and --remote had no argument.

In return it's now possible to provide files beginning with a dash to any
--remote option. Leading -- before those files is not needed.

Equivalent:

    --remote --file
    --remote -- --file

Fixes https://github.com/mhinz/neovim-remote/issues/43
2017-06-19 15:01:05 +02:00
Marco Hinz
39519a7b00
Make main() take optional environment 2017-05-24 20:40:40 +02:00
Marco Hinz
aee0fa049c
Rename package to "nvr" 2017-05-24 14:37:11 +02:00
Marco Hinz
c405bf48de Upload to PyPI
You can now install "nvr" via:

    pip3 install neovim-remote

References #8.
2016-02-15 03:44:03 +01:00
Marco Hinz
f12722e8b3 Make --serverlist work again
Refactoring gone wrong. *cough*

Closes #7.
2016-02-12 03:46:09 +01:00
Marco Hinz
06d9297d3e Add --remote-tab-{wait,silent,wait-silent} 2016-01-28 19:29:42 +01:00
Marco Hinz
69a42753a5 Make --remote-tab take +{cmd} 2016-01-28 19:18:49 +01:00
Marco Hinz
beba805d9a Improve option descriptions 2016-01-28 19:12:12 +01:00
Marco Hinz
1eaf77cfce Make --remote{,-silent,-wait,-wait-silent} take +{cmd}
This is done to stay compatible to Vim, see ":h --remote".

References #5.
2016-01-28 18:14:54 +01:00
Marco Hinz
d56e137bc7 Simplify TCP/Unix socket distinction 2016-01-28 11:54:50 +01:00
Marco Hinz
994229d97c Make license future-proof 2016-01-28 11:43:06 +01:00
Anmol Sethi
abbead4ba1 Support both Unix domain and TCP sockets 2016-01-28 11:41:27 +01:00
Marco Hinz
00252f6195 Implement -c 2016-01-10 03:27:27 +01:00
Marco Hinz
a863309db1 Print usage when no arguments are given 2016-01-08 21:54:07 +01:00
ohle
a308d2d0c0 Use absolute file paths for opening files
Otherwise, filenames are interpreted as relative to neovim's cwd, which is not
necessarily that of the shell executing nvr.
2016-01-08 15:42:13 +01:00
Marco Hinz
87024b711f Remove obsolete run_nvim() 2015-12-18 12:23:41 +01:00
Marco Hinz
3871822bbb Process unused arguments first 2015-12-17 00:34:15 +01:00
Marco Hinz
8e7d5ff995 Catch --remote-expr failures 2015-12-16 23:25:20 +01:00
Marco Hinz
d69792bcc6 Implement -l 2015-12-16 22:03:40 +01:00
Marco Hinz
f6395b720b Implement --serverlist.. again 2015-12-16 19:47:37 +01:00
Marco Hinz
dc41ddec88 Clean up --help 2015-12-16 19:32:36 +01:00
Marco Hinz
8e649507b3 Implement -O and -p 2015-12-16 18:25:58 +01:00
Marco Hinz
2f35681794 Code style: some align and spacing changes 2015-12-16 18:19:31 +01:00
Marco Hinz
7abbe9618e Implement -o 2015-12-16 18:16:02 +01:00