Skip to content

Commit 200a7b7

Browse files
committed
Reformat with neovim using tabs.
1 parent 6a38e36 commit 200a7b7

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/Contents/Resources/neovide-project

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ target="$1"
44

55
# If no target, use HOME
66
if [ -z "$target" ]; then
7-
target="$HOME"
7+
target="$HOME"
88
fi
99

1010
# Get absolute path
1111
if [ -e "$target" ]; then
12-
target=$(cd "$(dirname "$target")" 2>/dev/null && pwd -P)/"$(basename "$target")"
12+
target=$(cd "$(dirname "$target")" 2>/dev/null && pwd -P)/"$(basename "$target")"
1313
fi
1414

1515
# Get git root or fallback to target directory - use dirname if target is a file
@@ -19,32 +19,32 @@ git_root=$(cd "$target_dir" 2>/dev/null && git rev-parse --show-toplevel 2>/dev/
1919

2020
# Determine socket name and working directory
2121
if [ -n "$git_root" ]; then
22-
# We're in a git repo
23-
socket_name="neovide-$(printf "%s" "$git_root" | md5 -q)"
24-
working_dir="$git_root"
22+
# We're in a git repo
23+
socket_name="neovide-$(printf "%s" "$git_root" | md5 -q)"
24+
working_dir="$git_root"
2525
elif [ "$target" = "$HOME" ]; then
26-
# We're in HOME
27-
socket_name="neovide-home"
28-
working_dir="$HOME"
26+
# We're in HOME
27+
socket_name="neovide-home"
28+
working_dir="$HOME"
2929
else
30-
# We're in a regular directory
31-
socket_name="neovide-$(printf "%s" "$target_dir" | md5 -q)"
32-
working_dir="$target_dir"
30+
# We're in a regular directory
31+
socket_name="neovide-$(printf "%s" "$target_dir" | md5 -q)"
32+
working_dir="$target_dir"
3333
fi
3434

3535
socket_path="/tmp/$socket_name.sock"
3636

3737
if [ -e "$socket_path" ] && nvim --server "$socket_path" --remote-expr '1' >/dev/null 2>&1; then
38-
if [ -f "$target" ]; then
39-
if [ -n "$git_root" ] && echo "$target" | grep -q "^$git_root/"; then
40-
rel_path="${target#$git_root/}"
41-
else
42-
rel_path="$target"
43-
fi
44-
nvim --server "$socket_path" --remote-send "<C-\\><C-N>:e $rel_path<CR>:NeovideFocus<CR>"
45-
else
46-
nvim --server "$socket_path" --remote-send "<C-\\><C-N>:cd $target<CR>:NeovideFocus<CR>"
47-
fi
38+
if [ -f "$target" ]; then
39+
if [ -n "$git_root" ] && echo "$target" | grep -q "^$git_root/"; then
40+
rel_path="${target#$git_root/}"
41+
else
42+
rel_path="$target"
43+
fi
44+
nvim --server "$socket_path" --remote-send "<C-\\><C-N>:e $rel_path<CR>:NeovideFocus<CR>"
45+
else
46+
nvim --server "$socket_path" --remote-send "<C-\\><C-N>:cd $target<CR>:NeovideFocus<CR>"
47+
fi
4848
else
49-
(cd "$working_dir" && NVIM_LISTEN_ADDRESS="$socket_path" neovide) &
49+
(cd "$working_dir" && NVIM_LISTEN_ADDRESS="$socket_path" neovide) &
5050
fi

0 commit comments

Comments
 (0)