From e19b7689e0fe3e45ed4a6364a70474cf22240d26 Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Wed, 3 Jun 2015 01:29:09 +0200 Subject: [PATCH] Permit leading whitespace with new plugin definition syntax --- CHANGELOG.md | 1 + scripts/shared_functions.sh | 4 ++-- tests/test_plugin_installation.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88b979..043d1c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - add uninstall/clean procedure and keybinding (prefix+alt+u) (@chilicuil) - add new `set @plugin 'repo'` plugin defintion syntax (@chilicuil) - revert back to using `-g` flag in new plugin definition syntax +- permit leading whitespace with new plugin definition syntax (thanks @chilicuil) ### v1.2.2, 2015-02-08 - set GIT_TERMINAL_PROMPT=0 when doing `git clone`, `pull` or `submodule update` diff --git a/scripts/shared_functions.sh b/scripts/shared_functions.sh index 8aac0fb..29aefb8 100644 --- a/scripts/shared_functions.sh +++ b/scripts/shared_functions.sh @@ -15,9 +15,9 @@ shared_get_tpm_plugins_list() { local plugins_list plugins_list="$(tmux show-option -gqv "$tpm_plugins_variable_name")" if [ -z "${plugins_list}" ]; then - #read set @plugin "tmux-plugins/tmux-example-plugin" entries + #read set -g @plugin "tmux-plugins/tmux-example-plugin" entries cat /etc/tmux.conf ~/.tmux.conf 2>/dev/null | - awk '/^set +-g +@plugin/ { gsub(/'\''/,""); gsub(/'\"'/,""); print $4 }' + awk '/^ +set +-g +@plugin/ { gsub(/'\''/,""); gsub(/'\"'/,""); print $4 }' else printf "%s\\n" "${plugins_list}" fi diff --git a/tests/test_plugin_installation.sh b/tests/test_plugin_installation.sh index 90603f5..d013972 100755 --- a/tests/test_plugin_installation.sh +++ b/tests/test_plugin_installation.sh @@ -24,7 +24,7 @@ test_plugin_installation() { test_multiple_plugins_installation() { set_tmux_conf_helper <<- HERE set -g @plugin "tmux-plugins/tmux-example-plugin" - set -g @plugin 'tmux-plugins/tmux-copycat' + set -g @plugin 'tmux-plugins/tmux-copycat' run-shell "$PWD/tpm" HERE