Skip to content

Commit

Permalink
Fix empty entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-McKinney committed Jul 27, 2024
1 parent 2743c7a commit f4ee208
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions open-file-nvim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ files=$(sanitize_pane_output "$captured_files")
if [ -z "$files" ]; then
echo "No files found."
else
# remove any empty or whitespace only entries before fzf
# sed script will match :number:number at the end of a string for
# supporting opening files at a target row, col location
tmux split-window -h -c "#{pane_current_path}" "echo \"$files\" |
sed '/^[[:space:]]*$/d' |
fzf -m |
sed -E 's/([^:]+):([0-9]+):([0-9]+)/-c e \1 \| normal \2G\3/g' |
xargs -I {} $EDITOR {}"
Expand Down

0 comments on commit f4ee208

Please sign in to comment.