Skip to content

Commit

Permalink
Merge pull request #54 from Freed-Wu/master
Browse files Browse the repository at this point in the history
Fix #53
  • Loading branch information
bruno- committed Aug 22, 2022
2 parents de290b3 + e0d9d1c commit 763d0a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions open.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ get_editor_from_the_env_var() {
fi
}

preserve_url_hash() {
echo "sed s/##/####/g"
}

command_generator() {
local command_string="$1"
echo "xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string \"{}\" > /dev/null'"
echo "$(preserve_url_hash) | xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string \"{}\" > /dev/null'"
}

search_command_generator() {
local command_string="$1"
local engine="$2"

echo "sed 's/\ /+/g' | xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string $engine\"{}\" > /dev/null'"
echo "$(preserve_url_hash) | sed 's/\ /+/g' | xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string $engine\"{}\" > /dev/null'"
}

generate_open_command() {
Expand Down Expand Up @@ -80,7 +84,7 @@ generate_editor_command() {
local editor=$(get_tmux_option "$open_editor_override" "$environment_editor")
# vim freezes terminal unless there's the '--' argument. Other editors seem
# to be fine with it (textmate [mate], light table [table]).
echo "xargs -I {} tmux send-keys '$editor -- \"{}\"'; tmux send-keys 'C-m'"
echo "$(preserve_url_hash) | xargs -I {} tmux send-keys '$editor -- \"{}\"'; tmux send-keys 'C-m'"
}

set_copy_mode_open_bindings() {
Expand Down

0 comments on commit 763d0a8

Please sign in to comment.