Skip to content

Commit 112dd3e

Browse files
authored
Merge pull request #446 from zsh-users/develop
v0.6.1
2 parents b3b34ea + 8a812bd commit 112dd3e

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v0.6.1
4+
- Fixed bug occurring when `_complete` had been aliased (#443)
5+
36
## v0.6.0
47
- Added `completion` suggestion strategy powered by completion system (#111)
58
- Allow setting `ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE` to an empty string (#422)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.6.0
1+
v0.6.1

spec/strategies/completion_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@
2020
wait_for { session.content }.to eq("baz \\\nbar")
2121
end
2222

23+
context 'when `_complete` is aliased' do
24+
let(:before_sourcing) do
25+
-> do
26+
session.
27+
run_command('autoload compinit && compinit').
28+
run_command('_foo() { compadd bar; compadd bat }').
29+
run_command('compdef _foo baz').
30+
run_command('alias _complete=_complete')
31+
end
32+
end
33+
34+
it 'suggests the first completion result' do
35+
session.send_string('baz ')
36+
wait_for { session.content }.to eq('baz bar')
37+
end
38+
end
39+
2340
context 'when async mode is enabled' do
2441
let(:options) { ['ZSH_AUTOSUGGEST_USE_ASYNC=true', 'ZSH_AUTOSUGGEST_STRATEGY=completion'] }
2542

src/strategies/completion.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ _zsh_autosuggest_capture_completion_async() {
8686
# https://stackoverflow.com/a/7057118/154703
8787
autoload +X _complete
8888
functions[_original_complete]=$functions[_complete]
89-
_complete () {
89+
function _complete() {
9090
unset 'compstate[vared]'
9191
_original_complete "$@"
9292
}

zsh-autosuggestions.zsh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fish-like fast/unobtrusive autosuggestions for zsh.
22
# https://github.com/zsh-users/zsh-autosuggestions
3-
# v0.6.0
3+
# v0.6.1
44
# Copyright (c) 2013 Thiago de Arruda
5-
# Copyright (c) 2016-2018 Eric Freese
5+
# Copyright (c) 2016-2019 Eric Freese
66
#
77
# Permission is hereby granted, free of charge, to any person
88
# obtaining a copy of this software and associated documentation
@@ -568,7 +568,7 @@ _zsh_autosuggest_capture_completion_async() {
568568
# https://stackoverflow.com/a/7057118/154703
569569
autoload +X _complete
570570
functions[_original_complete]=$functions[_complete]
571-
_complete () {
571+
function _complete() {
572572
unset 'compstate[vared]'
573573
_original_complete "$@"
574574
}

0 commit comments

Comments
 (0)