소스 검색

main: Remove quotes before tilde expansion

pull/503/head
Matthew Martin 6 년 전
부모
커밋
d08d5ef7c5
2개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. +5
    -2
      highlighters/main/main-highlighter.zsh
  2. +4
    -2
      highlighters/main/test-data/path-tilde-named.zsh

+ 5
- 2
highlighters/main/main-highlighter.zsh 파일 보기

@ -1235,8 +1235,11 @@ _zsh_highlight_main_highlighter_expand_path()
# The $~1 syntax normally performs filename generation, but not when it's on the right-hand side of ${x:=y}.
setopt localoptions nonomatch
unset REPLY
: ${REPLY:=${(Q)${~1}}}
if [[ ${1[1]} == '~' ]]; then
REPLY=${~${(Q)1}}
else
REPLY=${(Q)1}
fi
}
# -------------------------------------------------------------------------------------------------

+ 4
- 2
highlighters/main/test-data/path-tilde-named.zsh 파일 보기

@ -31,9 +31,11 @@ mkdir mydir
touch mydir/path-tilde-named.test
hash -d D=mydir
BUFFER='ls ~D/path-tilde-named.test'
BUFFER='ls ~D/path-tilde-named.test ~"D"'
expected_region_highlight=(
"1 2 command" # ls
"4 27 path" # ~D/path-tilde-named.test
"4 27 path" # ~D/path-tilde-named.test
"29 32 path" # ~"D"
"30 32 double-quoted-argument" # "D"
)

불러오는 중...
취소
저장