Skip to content

Commit 990737d

Browse files
author
Bruno Sutic
committed
Fix status-right, status-left whitespace issue
1 parent 6b80ca6 commit 990737d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### master
44
- to speed up the "online test" ping uses only 1 packet
5+
- fix issue with status-right and status-left whitespace being cut out
56

67
### v1.0.0, 2014-10-26
78
- README updates

online_status.tmux

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ online_status_interpolation_string="\#{online_status}"
88
source $CURRENT_DIR/scripts/shared.sh
99

1010
do_interpolation() {
11-
local string=$1
12-
local interpolated=${string/$online_status_interpolation_string/$online_status_icon}
11+
local string="$1"
12+
local interpolated="${string/$online_status_interpolation_string/$online_status_icon}"
1313
echo "$interpolated"
1414
}
1515

1616
update_tmux_option() {
17-
local option=$1
18-
local option_value=$(get_tmux_option "$option")
19-
local new_option_value=$(do_interpolation "$option_value")
17+
local option="$1"
18+
local option_value="$(get_tmux_option "$option")"
19+
local new_option_value="$(do_interpolation "$option_value")"
2020
set_tmux_option "$option" "$new_option_value"
2121
}
2222

scripts/shared.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ get_tmux_option() {
33
local default_value=$2
44
local option_value=$(tmux show-option -gqv "$option")
55
if [ -z "$option_value" ]; then
6-
echo $default_value
6+
echo "$default_value"
77
else
8-
echo $option_value
8+
echo "$option_value"
99
fi
1010
}
1111

1212
set_tmux_option() {
13-
local option=$1
14-
local value=$2
13+
local option="$1"
14+
local value="$2"
1515
tmux set-option -gq "$option" "$value"
1616
}

0 commit comments

Comments
 (0)