I was having problem with nvim opening multiple not existing files after the first one so i fixed the script
#!/usr/bin/env bash
# CHANGE IF NEEDED:
# - replace with your Terminal Emulator executable
term_exec="alacritty"
# - replace with your Neovim executable
nvim_exec="nvim"
# - replace with other path for the Neovim server pipe
server_path="$HOME/.cache/nvim/godot-server.pipe"
start_server() {
"$term_exec" -e "$nvim_exec" --listen "$server_path"
}
open_file_in_server() {
# - escape stuff because nvim will not
filename=$(printf %q "$1")
"$term_exec" -e "$nvim_exec" --server "$server_path" --remote-send "<C-\><C-n>:n $filename<CR>:call cursor($2)<CR>"
}
if ! [ -e "$server_path" ]; then
# - start server FIRST then open the file
start_server &
sleep 200ms # - wait for the server to start
open_file_in_server "$1" "$2"
else
open_file_in_server "$1" "$2"
fi
the original version of the script would work if your file paths had no spaces in them
there is one more problem and it is with the {line} param in godot is that if the bug is at line 10 godot will send line 9 to the nvim-server i can't test the {col} param but it might have the same problem or my nvim config reads 1 as the first line not 0 as the first line for cursor cmd (didn't fix it)
I was having problem with nvim opening multiple not existing files after the first one so i fixed the script
the original version of the script would work if your file paths had no spaces in them there is one more problem and it is with the {line} param in godot is that if the bug is at line 10 godot will send line 9 to the nvim-server i can't test the {col} param but it might have the same problem or my nvim config reads 1 as the first line not 0 as the first line for cursor cmd (didn't fix it)