[zsh] Fix issues with unicode characters
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Junegunn Choi · committed by Junegunn Choi · parent 095f31b · Browse files · 3 files·+32 added−2 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+32 added−2 removed
- tests:+30 added−0 removed
- other:+2 added−2 removed
Provenance
- Commit
988c9bd- Tree
ae2bd59- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
095f31b
3 files changed+32 added−2 removed
modified:shell/completion.zsh+1 added-1 removed
52 unmodified lines53545556575758596061130 unmodified linesExpand all52 unmodified lines [ -z "$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 printf "%q$suffix " "$item" echo -n "${(q)item}$suffix " done) matches=${matches% } if [ -n "$matches" ]; then LBUFFER="$lbuf$matches$tail"130 unmodified linesExpand allmodified:shell/key-bindings.zsh+1 added-1 removed
7 unmodified lines8 -o -type f -print \9 -o -type d -print \10 -o -type l -print 2> /dev/null | sed 1d | cut -b3-"}"11 eval "$cmd" | $(__fzfcmd) -m | while read item; do12- printf '%q ' "$item"12+ echo -n "${(q)item} "13 done14 echo15 }16 38 unmodified linesmodified:test/test_go.rb+30 added
1216 unmodified lines1217 tmux.send_keys :Enter, pane: 11218 tmux.until(0) { |lines| lines[-1].include? '1 2 3' }1219 end1220 1221+ def test_ctrl_t_unicode1222+ FileUtils.mkdir_p '/tmp/fzf-test'1223+ tmux.send_keys 'cd /tmp/fzf-test; echo -n test1 > "fzf-unicode 테스트1"; echo -n test2 > "fzf-unicode 테스트2"', :Enter1224+ tmux.prepare1225+ tmux.send_keys 'cat ', 'C-t', pane: 01226+ tmux.until(1) { |lines| lines.item_count >= 1 }1227+ tmux.send_keys 'fzf-unicode', pane: 11228+ tmux.until(1) { |lines| lines[-2].start_with? ' 2/' }1229+ tmux.send_keys :BTab, :BTab, pane: 11230+ tmux.until(1) { |lines| lines[-2].include? '(2)' }1231+ tmux.send_keys :Enter, pane: 11232+ tmux.until { |lines| lines[-1].include? 'cat' }1233+ tmux.send_keys :Enter1234+ tmux.until { |lines| lines[-1].include? 'test1test2' }1235+ end1236+1237 def test_alt_c1238 tmux.prepare1239 tmux.send_keys :Escape, :c, pane: 01240 lines = tmux.until(1) { |lines| lines.item_count > 0 && lines[-3][2..-1] }192 unmodified lines1433 tmux.until { |lines| lines[-2].include? ' 1/' }1434 tmux.send_keys :Enter1435 tmux.until { |lines| lines[-1] == 'unset FOO' }1436 end1437+1438+ def test_file_completion_unicode1439+ FileUtils.mkdir_p '/tmp/fzf-test'1440+ tmux.send_keys 'cd /tmp/fzf-test; echo -n test3 > "fzf-unicode 테스트1"; echo -n test4 > "fzf-unicode 테스트2"', :Enter1441+ tmux.prepare1442+ tmux.send_keys 'cat fzf-unicode**', :Tab, pane: 01443+ tmux.until(1) { |lines| lines[-2].start_with? ' 2/' }1444+ tmux.send_keys :BTab, :BTab, pane: 11445+ tmux.until(1) { |lines| lines[-2].include? '(2)' }1446+ tmux.send_keys :Enter, pane: 11447+ tmux.until { |lines| lines[-1].include? 'cat' }1448+ tmux.send_keys :Enter1449+ tmux.until { |lines| lines[-1].include? 'test3test4' }1450+ end1451 end1452 1453 class TestBash < TestBase1454 include TestShell50 unmodified lines