Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add escape for string split #20

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions functions/__abbr_tips_init.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ function __abbr_tips_init -d "Initialize abbreviations variables for fish-abbr-t
set -l i 1
set -l abb (string replace -r '.*-- ' '' -- (abbr -s))
while test $i -le (count $abb)
set -l current_abb (string split -m1 ' ' "$abb[$i]")
set -l current_abb (string split -m1 -- ' ' "$abb[$i]")
set -a __ABBR_TIPS_KEYS "$current_abb[1]"
set -a __ABBR_TIPS_VALUES (string trim -c '\'' "$current_abb[2]")
set -a __ABBR_TIPS_VALUES (string trim -c -- '\'' "$current_abb[2]")
set i (math $i + 1)
end

set -l i 1
set -l abb (string replace -r '.*-- ' '' -- (alias -s))
while test $i -le (count $abb)
set -l current_abb (string split -m2 ' ' "$abb[$i]")
set -l current_abb (string split -m2 -- ' ' "$abb[$i]")
set -a __ABBR_TIPS_KEYS "a__$current_abb[2]"
set -a __ABBR_TIPS_VALUES (string trim -c '\'' "$current_abb[3]")
set -a __ABBR_TIPS_VALUES (string trim -c -- '\'' "$current_abb[3]")
set i (math $i + 1)
end
end