mirror of
https://github.com/Morantron/tmux-fingers.git
synced 2026-09-10 07:26:32 -04:00
Merge branch 'develop'
This commit is contained in:
commit
fc3c750b8d
|
|
@ -1,3 +1,9 @@
|
|||
## 2.7.1 - 09 Jun 2026
|
||||
|
||||
* fix parsing of @fingers-enabled-builtin-patterns ( Fixes #176 )
|
||||
* update install-wizard and readme to show that shards is required
|
||||
* relax parsing of --patterns flag in cli
|
||||
|
||||
## 2.7.0 - 31 May 2026
|
||||
|
||||
* improved performance: ~30% faster
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ trap finish EXIT
|
|||
function install_from_source() {
|
||||
echo "Installing from source..."
|
||||
|
||||
# check if shards is installed
|
||||
if ! command -v shards >/dev/null 2>&1; then
|
||||
# check if crystal is installed
|
||||
if ! command -v crystal >/dev/null 2>&1; then
|
||||
echo "crystal is not installed. Please install it first."
|
||||
echo ""
|
||||
echo " https://crystal-lang.org/install/"
|
||||
|
|
@ -40,6 +40,15 @@ function install_from_source() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# check if shards is installed
|
||||
if ! command -v shards >/dev/null 2>&1; then
|
||||
echo "shards is not installed. Please install it first."
|
||||
echo ""
|
||||
echo " https://crystal-lang.org/reference/latest/man/shards/index.html"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd $CURRENT_DIR > /dev/null
|
||||
WIZARD_INSTALLATION_METHOD=build-from-source shards build --production
|
||||
popd > /dev/null
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
version: 2.7.0
|
||||
version: 2.7.1
|
||||
name: fingers
|
||||
authors:
|
||||
- Jorge Morante <jorge@morante.eu>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ define_bool_option :skip_wizard, false
|
|||
|
||||
define_enum_option :hint_position, %w(left right), "left"
|
||||
define_enum_option :keyboard_layout, Fingers::ALPHABET_MAP.keys, "qwerty"
|
||||
define_enum_option :enabled_builtin_patterns, ["all", *Fingers::BUILTIN_PATTERNS.keys], "all"
|
||||
define_multi_enum_option :enabled_builtin_patterns, ["all", *Fingers::BUILTIN_PATTERNS.keys], "all"
|
||||
|
||||
define_action_option :main, ":copy:"
|
||||
define_action_option :ctrl, ":open:"
|
||||
|
|
|
|||
|
|
@ -76,6 +76,20 @@ macro define_enum_option(name, possible_values, default)
|
|||
end
|
||||
end
|
||||
|
||||
macro define_multi_enum_option(name, possible_values, default)
|
||||
module Fingers::Options
|
||||
class {{name.camelcase.id}} < Base
|
||||
include ::Fingers::Options::Parsers::MultiEnumParser
|
||||
DEFAULT = {{ default }}
|
||||
alias Type = String
|
||||
|
||||
def possible_values
|
||||
{{ possible_values }}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
macro define_key_option(name, default)
|
||||
module Fingers::Options
|
||||
class {{name.camelcase.id}} < Base
|
||||
|
|
|
|||
19
src/fingers/options/parsers/multi_enum_parser.cr
Normal file
19
src/fingers/options/parsers/multi_enum_parser.cr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module Fingers::Options::Parsers::MultiEnumParser
|
||||
def valid?(value : String) : Tuple(Bool, String)
|
||||
invalid = value.split(",").reject { |name| possible_values_as_strings.includes?(name) }
|
||||
|
||||
if invalid.empty?
|
||||
{ true, "ok" }
|
||||
else
|
||||
{ false, "Invalid value(s) '#{invalid.join(",")}'. Possible values are: #{possible_values.join(", ")}" }
|
||||
end
|
||||
end
|
||||
|
||||
def possible_values
|
||||
[] of String
|
||||
end
|
||||
|
||||
def possible_values_as_strings
|
||||
possible_values.map { |value| value.to_s }
|
||||
end
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@ module Fingers::Options
|
|||
|
||||
def parse(raw_value : String, option_name : String)
|
||||
val = {} of String => String
|
||||
val[option_name.gsub(/^pattern-/, "")] = raw_value
|
||||
val[option_name.gsub(/^pattern[-_]/, "")] = raw_value
|
||||
val
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue