Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/strategies/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ _zsh_autosuggest_strategy_completion() {
# the second null byte, so trim those off the end.
# See http://www.zsh.org/mla/workers/2015/msg03290.html
suggestion="${${(@0)line}[2]}"

# If the suggestion is the same as the input, treat it as no suggestion
[[ "$suggestion" == "$1" ]] && unset suggestion
} always {
# Destroy the pty
zpty -d $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME
Expand Down
9 changes: 6 additions & 3 deletions zsh-autosuggestions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# v0.7.1
# Copyright (c) 2013 Thiago de Arruda
# Copyright (c) 2016-2021 Eric Freese
#
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
Expand All @@ -12,10 +12,10 @@
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Expand Down Expand Up @@ -625,6 +625,9 @@ _zsh_autosuggest_strategy_completion() {
# the second null byte, so trim those off the end.
# See http://www.zsh.org/mla/workers/2015/msg03290.html
suggestion="${${(@0)line}[2]}"

# If the suggestion is the same as the input, treat it as no suggestion
[[ "$suggestion" == "$1" ]] && unset suggestion
} always {
# Destroy the pty
zpty -d $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME
Expand Down