replace __fish_urlencode with string escape

We now have a builtin that can do URL escaping so use it. I can't find
any uses of our private `__fish_urlencode` function in any Oh-My-Fish or
Fisherman code so remove it.
This commit is contained in:
Kurtis Rader 2017-06-22 22:24:24 -07:00
parent f3cb625802
commit bb29f9f990
12 changed files with 2 additions and 66 deletions

View file

@ -167,7 +167,7 @@ In general, special characters are special by default, so `a+` matches one or mo
\endfish
\fish{cli-dark}
>_ string escape --style=var 'a1 b2'\u6161
>_ string escape --style=var 'a1 b2'\\u6161
<bs>a1_20b2__c_E6_85_A1</bs>
\endfish

View file

@ -61324,11 +61324,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr "Befehlsspezifische Erweiterungen bearbeiten"
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
#, fuzzy
msgid "URL-encode stdin"
msgstr "Standardeingabe umbenennen"
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
#, fuzzy
msgid "Test if a non-switch argument has been given in the current commandline"

View file

@ -8114,10 +8114,6 @@ msgstr "Show current path"
msgid "Test if the token under the cursor matches the specified wildcard"
msgstr "Test if the token under the cursor matches the specified wildcard"
#: share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr "URL-encode stdin"
#: share/functions/__terlar_git_prompt.fish:23
msgid "Write out the git prompt"
msgstr "Write out the git prompt"

View file

@ -60024,10 +60024,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr "Éditer les complétions spécifiques aux commandes"
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
#, fuzzy
msgid "Test if a non-switch argument has been given in the current commandline"

View file

@ -56722,10 +56722,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
msgid "Test if a non-switch argument has been given in the current commandline"
msgstr ""

View file

@ -56722,10 +56722,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
msgid "Test if a non-switch argument has been given in the current commandline"
msgstr ""

View file

@ -57143,10 +57143,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr "Edytuj sugestie do określonej komendy"
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
msgid "Test if a non-switch argument has been given in the current commandline"
msgstr ""

View file

@ -61774,11 +61774,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr "Edit command specific completions"
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
#, fuzzy
msgid "URL-encode stdin"
msgstr "Rename stdin"
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
#, fuzzy
msgid "Test if a non-switch argument has been given in the current commandline"

View file

@ -53577,10 +53577,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
msgid "Test if a non-switch argument has been given in the current commandline"
msgstr ""

View file

@ -57099,10 +57099,6 @@ msgstr ""
msgid "Update man-page based completions"
msgstr "编辑命令相关的补全"
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
msgid "URL-encode stdin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
msgid "Test if a non-switch argument has been given in the current commandline"
msgstr ""

View file

@ -262,7 +262,7 @@ function __fish_config_interactive -d "Initializations that should be performed
status --is-command-substitution
or test -n "$INSIDE_EMACS"
and return
printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode)
printf \e\]7\;file://\%s\%s\a (hostname) (string escape --style=url $PWD)
end
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
end

View file

@ -1,26 +0,0 @@
function __fish_urlencode --description "URL-encode stdin"
set -l join ''
set -l chars
# Set locale to C and IFS to "" in order to split a line into bytes.
while begin
set -lx LC_ALL C
set -lx IFS ''
read -az chars
end
printf '%s' $join
# chomp off a trailing newline
if test "$chars[-1]" = \n
set -e chars[-1]
set join '%0A%00'
else
set join '%00'
end
for c in $chars
if string match -q -r '[/._~A-Za-z0-9-]' $c
printf '%s' $c
else
printf '%%%02X' "'$c"
end
end
end
end