From 0221c3ec0076ab2d7305daee6244e8508a9fb94e Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Thu, 21 Sep 2023 11:23:53 +0200 Subject: [PATCH] tmux-edit-helper: open file directly on first launch --- bin/tmux-edit-helper | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/tmux-edit-helper b/bin/tmux-edit-helper index 2a12394..da98fa3 100755 --- a/bin/tmux-edit-helper +++ b/bin/tmux-edit-helper @@ -18,11 +18,11 @@ fi _nvim_socket="$XDG_RUNTIME_DIR/nvim-persistent.sock" -tmux select-window -t nvim 2>/dev/null || - tmux new-window -S -n nvim \ - -e "BUILD_COMMAND=$BUILD_COMMAND" \ - -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ - -e "GOFLAGS=$GOFLAGS" \ - nvim --listen "$_nvim_socket" +tmux select-window -t nvim 2>/dev/null && exec nvim --server "$_nvim_socket" --remote "$_file" -nvim --server "$_nvim_socket" --remote "$_file" +# nvim is not running/listening on remote socket, so start it. +tmux new-window -S -n nvim \ + -e "BUILD_COMMAND=$BUILD_COMMAND" \ + -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ + -e "GOFLAGS=$GOFLAGS" \ + nvim --listen "$_nvim_socket" "$_file"