try to treat inline strategy as alias for strategy

if strategy with that name exists apply it otherwise use it as inline
strategy

Closes #88
This commit is contained in:
Dmitry Motylev 2015-06-10 22:33:52 +01:00 committed by Bruno Sutic
parent 8af7aed9b3
commit ed6fb9b523
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C

View File

@ -20,6 +20,11 @@ restore_pane_process() {
local inline_strategy="$(_get_inline_strategy "$pane_full_command")" # might not be defined local inline_strategy="$(_get_inline_strategy "$pane_full_command")" # might not be defined
if [ -n "$inline_strategy" ]; then if [ -n "$inline_strategy" ]; then
# inline strategy exists # inline strategy exists
# check for additional "expansion" of inline strategy, e.g. `vim` to `vim -S`
if _strategy_exists "$inline_strategy"; then
local strategy_file="$(_get_strategy_file "$inline_strategy")"
local inline_strategy="$($strategy_file "$pane_full_command" "$dir")"
fi
tmux send-keys "$inline_strategy" "C-m" tmux send-keys "$inline_strategy" "C-m"
elif _strategy_exists "$pane_full_command"; then elif _strategy_exists "$pane_full_command"; then
local strategy_file="$(_get_strategy_file "$pane_full_command")" local strategy_file="$(_get_strategy_file "$pane_full_command")"