From d8de4826ff4f0efd9597e30011d3e8fee1056fc9 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Wed, 14 Dec 2022 10:06:42 +0100 Subject: [PATCH] tmux: fix nvim edit helper behavior --- bin/tmux-edit-helper | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/tmux-edit-helper b/bin/tmux-edit-helper index f9c06c0..6a3644e 100755 --- a/bin/tmux-edit-helper +++ b/bin/tmux-edit-helper @@ -11,8 +11,9 @@ else fre --store_name "$_store" --add "$_file" fi -tmux new-window -S -n nvim \ - -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ - nvim --listen "$XDG_RUNTIME_DIR/nvim.sock" +tmux select-window -t nvim 2>/dev/null || + tmux new-window -S -n nvim \ + -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ + nvim --listen "$XDG_RUNTIME_DIR/nvim.sock" nvim --server "$XDG_RUNTIME_DIR/nvim.sock" --remote "$_file"