mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
[zsh] Fix issues with unicode characters
This commit is contained in:
parent
095f31b316
commit
988c9bd9be
@ -54,7 +54,7 @@ __fzf_generic_path_completion() {
|
|||||||
[ "$dir" != "/" ] && dir="${dir/%\//}"
|
[ "$dir" != "/" ] && dir="${dir/%\//}"
|
||||||
dir=${~dir}
|
dir=${~dir}
|
||||||
matches=$(eval "$compgen $(printf %q "$dir")" | ${=fzf} ${=FZF_COMPLETION_OPTS} ${=fzf_opts} -q "$leftover" | while read item; do
|
matches=$(eval "$compgen $(printf %q "$dir")" | ${=fzf} ${=FZF_COMPLETION_OPTS} ${=fzf_opts} -q "$leftover" | while read item; do
|
||||||
printf "%q$suffix " "$item"
|
echo -n "${(q)item}$suffix "
|
||||||
done)
|
done)
|
||||||
matches=${matches% }
|
matches=${matches% }
|
||||||
if [ -n "$matches" ]; then
|
if [ -n "$matches" ]; then
|
||||||
|
@ -9,7 +9,7 @@ __fsel() {
|
|||||||
-o -type d -print \
|
-o -type d -print \
|
||||||
-o -type l -print 2> /dev/null | sed 1d | cut -b3-"}"
|
-o -type l -print 2> /dev/null | sed 1d | cut -b3-"}"
|
||||||
eval "$cmd" | $(__fzfcmd) -m | while read item; do
|
eval "$cmd" | $(__fzfcmd) -m | while read item; do
|
||||||
printf '%q ' "$item"
|
echo -n "${(q)item} "
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
@ -1218,6 +1218,22 @@ module TestShell
|
|||||||
tmux.until(0) { |lines| lines[-1].include? '1 2 3' }
|
tmux.until(0) { |lines| lines[-1].include? '1 2 3' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_ctrl_t_unicode
|
||||||
|
FileUtils.mkdir_p '/tmp/fzf-test'
|
||||||
|
tmux.send_keys 'cd /tmp/fzf-test; echo -n test1 > "fzf-unicode 테스트1"; echo -n test2 > "fzf-unicode 테스트2"', :Enter
|
||||||
|
tmux.prepare
|
||||||
|
tmux.send_keys 'cat ', 'C-t', pane: 0
|
||||||
|
tmux.until(1) { |lines| lines.item_count >= 1 }
|
||||||
|
tmux.send_keys 'fzf-unicode', pane: 1
|
||||||
|
tmux.until(1) { |lines| lines[-2].start_with? ' 2/' }
|
||||||
|
tmux.send_keys :BTab, :BTab, pane: 1
|
||||||
|
tmux.until(1) { |lines| lines[-2].include? '(2)' }
|
||||||
|
tmux.send_keys :Enter, pane: 1
|
||||||
|
tmux.until { |lines| lines[-1].include? 'cat' }
|
||||||
|
tmux.send_keys :Enter
|
||||||
|
tmux.until { |lines| lines[-1].include? 'test1test2' }
|
||||||
|
end
|
||||||
|
|
||||||
def test_alt_c
|
def test_alt_c
|
||||||
tmux.prepare
|
tmux.prepare
|
||||||
tmux.send_keys :Escape, :c, pane: 0
|
tmux.send_keys :Escape, :c, pane: 0
|
||||||
@ -1418,6 +1434,20 @@ module CompletionTest
|
|||||||
tmux.send_keys :Enter
|
tmux.send_keys :Enter
|
||||||
tmux.until { |lines| lines[-1] == 'unset FOO' }
|
tmux.until { |lines| lines[-1] == 'unset FOO' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_file_completion_unicode
|
||||||
|
FileUtils.mkdir_p '/tmp/fzf-test'
|
||||||
|
tmux.send_keys 'cd /tmp/fzf-test; echo -n test3 > "fzf-unicode 테스트1"; echo -n test4 > "fzf-unicode 테스트2"', :Enter
|
||||||
|
tmux.prepare
|
||||||
|
tmux.send_keys 'cat fzf-unicode**', :Tab, pane: 0
|
||||||
|
tmux.until(1) { |lines| lines[-2].start_with? ' 2/' }
|
||||||
|
tmux.send_keys :BTab, :BTab, pane: 1
|
||||||
|
tmux.until(1) { |lines| lines[-2].include? '(2)' }
|
||||||
|
tmux.send_keys :Enter, pane: 1
|
||||||
|
tmux.until { |lines| lines[-1].include? 'cat' }
|
||||||
|
tmux.send_keys :Enter
|
||||||
|
tmux.until { |lines| lines[-1].include? 'test3test4' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestBash < TestBase
|
class TestBash < TestBase
|
||||||
|
Loading…
Reference in New Issue
Block a user