handle case where no @fingers-* option is defined
This commit is contained in:
parent
c192edb6c3
commit
2d9029183a
|
@ -147,7 +147,10 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def fingers_options_names
|
def fingers_options_names
|
||||||
@fingers_options_names ||= `tmux show-options -g | grep ^@fingers`.chomp.split("\n").map { |line| line.split(" ")[0] }
|
@fingers_options_names ||= `tmux show-options -g | grep ^@fingers`
|
||||||
|
.chomp.split("\n")
|
||||||
|
.map { |line| line.split(" ")[0] }
|
||||||
|
.reject { |option| option.empty? }
|
||||||
end
|
end
|
||||||
|
|
||||||
def unset_tmux_option!(option)
|
def unset_tmux_option!(option)
|
||||||
|
@ -169,7 +172,7 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
|
||||||
|
|
||||||
fingers_options_names.each do |option|
|
fingers_options_names.each do |option|
|
||||||
unless valid_option?(option)
|
unless valid_option?(option)
|
||||||
errors << "#{option} is not a valid option"
|
errors << "'#{option}' is not a valid option"
|
||||||
unset_tmux_option!(option)
|
unset_tmux_option!(option)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue