1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-30 05:40:58 +01:00

bracketed-paste-url-magic: Handle magnet links too, and allow for schemes without //

This commit is contained in:
Mikael Magnusson 2016-09-15 20:13:29 +02:00
parent f0c804879b
commit c3fbd97f9b
2 changed files with 7 additions and 2 deletions

View file

@ -19,7 +19,7 @@
# The default can be seen just below.
local -a schema
zstyle -a :bracketed-paste-url-magic schema schema || schema=(http https ftp ftps file ssh sftp)
zstyle -a :bracketed-paste-url-magic schema schema || schema=(http:// https:// ftp:// ftps:// file:// ssh:// sftp:// magnet:)
local wantquote=${NUMERIC:-0}
local content
@ -28,7 +28,7 @@ local start=$#LBUFFER
zle .$WIDGET -N content
if (( $wantquote == 0 )); then
if [[ $content = (${(~j:|:)schema})://* ]]; then
if [[ $content = (${(~j:|:)schema})* ]]; then
wantquote=1
fi
fi