Skip to content

Commit 5f03ad0

Browse files
author
Phil Hindman
committed
Rename functions/variables to reflect current usage
The name of the file that the current pane is logging to is stored in the variable, so name it (and the helper functions) accordingly.
1 parent 5fad487 commit 5f03ad0

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

scripts/toggle_logging.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,30 @@ start_pipe_pane() {
1010
local file=$(expand_tmux_format_path "${logging_full_filename}")
1111
"$CURRENT_DIR/start_logging.sh" "${file}"
1212
display_message "Started logging to ${file}"
13-
set_logging_variable "${file}"
13+
set_active_logging_filename "${file}"
1414
}
1515

1616
stop_pipe_pane() {
1717
tmux pipe-pane
18-
display_message "Ended logging to $(get_logging_variable)"
19-
unset_logging_variable
18+
display_message "Ended logging to $(get_active_logging_filename)"
19+
unset_active_logging_filename
2020
}
2121

22-
# saving 'logging' 'not logging' status in a variable unique to pane
23-
set_logging_variable() {
24-
tmux set-option -pq @logging-variable "$1"
22+
set_active_logging_filename() {
23+
tmux set-option -pq @active-logging-filename "$1"
2524
}
2625

27-
unset_logging_variable() {
28-
tmux set-option -pu @logging-variable
26+
unset_active_logging_filename() {
27+
tmux set-option -pu @active-logging-filename
2928
}
3029

31-
get_logging_variable() {
32-
tmux show-option -pqv @logging-variable
30+
get_active_logging_filename() {
31+
tmux show-option -pqv @active-logging-filename
3332
}
3433

3534
# this function checks if logging is happening for the current pane
3635
is_logging() {
37-
if [ -n "$(get_logging_variable)" ]; then
36+
if [ -n "$(get_active_logging_filename)" ]; then
3837
return 0
3938
else
4039
return 1

0 commit comments

Comments
 (0)