Open ElementW opened 1 month ago
The ZSH manual describes region_highlight as being an array in https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting, therefore the previous strategy of removing as many characters as the last suggestion is not the way to do it, explaining why it broke on recent ZSH versions.
region_highlight
Replace this logic with a simple last-element delete. Keeps the _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT variable intact since there's no downside in tracking its content, as it still used as a marker for whether a suggestion highlight was applied.
_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT
Fixes #789.
The ZSH manual describes
region_highlight
as being an array in https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting, therefore the previous strategy of removing as many characters as the last suggestion is not the way to do it, explaining why it broke on recent ZSH versions.Replace this logic with a simple last-element delete. Keeps the
_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT
variable intact since there's no downside in tracking its content, as it still used as a marker for whether a suggestion highlight was applied.Fixes #789.