mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-07-31 13:36:28 +08:00
Compare commits
5 Commits
3637b5edc8
...
94a24b0973
Author | SHA1 | Date | |
---|---|---|---|
![]() |
94a24b0973 | ||
![]() |
f8907cf32b | ||
![]() |
a50468ef4b | ||
![]() |
9aceef9646 | ||
![]() |
4ccfdb2435 |
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v0.7.1
|
||||||
|
- Clear POSTDISPLAY instead of unsetting (#634)
|
||||||
|
- Always reset async file descriptor after consuming it (#630)
|
||||||
|
- Always use builtin `exec` (#628)
|
||||||
|
- Add `history-beginning-search-*-end` widgets to clear widget list (#619)
|
||||||
|
- Switch CI from Circle CI to GitHub Actions
|
||||||
|
|
||||||
## v0.7.0
|
## v0.7.0
|
||||||
- Enable asynchronous mode by default (#498)
|
- Enable asynchronous mode by default (#498)
|
||||||
- No longer wrap user widgets starting with `autosuggest-` prefix (#496)
|
- No longer wrap user widgets starting with `autosuggest-` prefix (#496)
|
||||||
|
@ -6,7 +6,6 @@ It suggests commands as you type based on history and completions.
|
|||||||
|
|
||||||
Requirements: Zsh v4.3.11 or later
|
Requirements: Zsh v4.3.11 or later
|
||||||
|
|
||||||
[](https://circleci.com/gh/zsh-users/zsh-autosuggestions)
|
|
||||||
[](https://gitter.im/zsh-users/zsh-autosuggestions)
|
[](https://gitter.im/zsh-users/zsh-autosuggestions)
|
||||||
|
|
||||||
<a href="https://asciinema.org/a/37390" target="_blank"><img src="https://asciinema.org/a/37390.png" width="400" /></a>
|
<a href="https://asciinema.org/a/37390" target="_blank"><img src="https://asciinema.org/a/37390.png" width="400" /></a>
|
||||||
|
@ -162,11 +162,13 @@ _zsh_autosuggest_execute() {
|
|||||||
_zsh_autosuggest_partial_accept() {
|
_zsh_autosuggest_partial_accept() {
|
||||||
local -i retval cursor_loc
|
local -i retval cursor_loc
|
||||||
|
|
||||||
# Save the contents of the buffer so we can restore later if needed
|
# Save the original buffer/postdisplay so we can restore later if needed
|
||||||
local original_buffer="$BUFFER"
|
local original_buffer="$BUFFER"
|
||||||
|
local original_postdisplay="$POSTDISPLAY"
|
||||||
|
|
||||||
# Temporarily accept the suggestion.
|
# Temporarily accept the suggestion.
|
||||||
BUFFER="$BUFFER$POSTDISPLAY"
|
BUFFER="$BUFFER$POSTDISPLAY"
|
||||||
|
unset POSTDISPLAY
|
||||||
|
|
||||||
# Original widget moves the cursor
|
# Original widget moves the cursor
|
||||||
_zsh_autosuggest_invoke_original_widget $@
|
_zsh_autosuggest_invoke_original_widget $@
|
||||||
@ -186,8 +188,9 @@ _zsh_autosuggest_partial_accept() {
|
|||||||
# Clip the buffer at the cursor
|
# Clip the buffer at the cursor
|
||||||
BUFFER="${BUFFER[1,$cursor_loc]}"
|
BUFFER="${BUFFER[1,$cursor_loc]}"
|
||||||
else
|
else
|
||||||
# Restore the original buffer
|
# Restore the original buffer/postdisplay
|
||||||
BUFFER="$original_buffer"
|
BUFFER="$original_buffer"
|
||||||
|
POSTDISPLAY="$original_postdisplay"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $retval
|
return $retval
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Fish-like fast/unobtrusive autosuggestions for zsh.
|
# Fish-like fast/unobtrusive autosuggestions for zsh.
|
||||||
# https://github.com/zsh-users/zsh-autosuggestions
|
# https://github.com/zsh-users/zsh-autosuggestions
|
||||||
# v0.7.0
|
# v0.7.1
|
||||||
# Copyright (c) 2013 Thiago de Arruda
|
# Copyright (c) 2013 Thiago de Arruda
|
||||||
# Copyright (c) 2016-2021 Eric Freese
|
# Copyright (c) 2016-2021 Eric Freese
|
||||||
#
|
#
|
||||||
@ -426,11 +426,13 @@ _zsh_autosuggest_execute() {
|
|||||||
_zsh_autosuggest_partial_accept() {
|
_zsh_autosuggest_partial_accept() {
|
||||||
local -i retval cursor_loc
|
local -i retval cursor_loc
|
||||||
|
|
||||||
# Save the contents of the buffer so we can restore later if needed
|
# Save the original buffer/postdisplay so we can restore later if needed
|
||||||
local original_buffer="$BUFFER"
|
local original_buffer="$BUFFER"
|
||||||
|
local original_postdisplay="$POSTDISPLAY"
|
||||||
|
|
||||||
# Temporarily accept the suggestion.
|
# Temporarily accept the suggestion.
|
||||||
BUFFER="$BUFFER$POSTDISPLAY"
|
BUFFER="$BUFFER$POSTDISPLAY"
|
||||||
|
unset POSTDISPLAY
|
||||||
|
|
||||||
# Original widget moves the cursor
|
# Original widget moves the cursor
|
||||||
_zsh_autosuggest_invoke_original_widget $@
|
_zsh_autosuggest_invoke_original_widget $@
|
||||||
@ -450,8 +452,9 @@ _zsh_autosuggest_partial_accept() {
|
|||||||
# Clip the buffer at the cursor
|
# Clip the buffer at the cursor
|
||||||
BUFFER="${BUFFER[1,$cursor_loc]}"
|
BUFFER="${BUFFER[1,$cursor_loc]}"
|
||||||
else
|
else
|
||||||
# Restore the original buffer
|
# Restore the original buffer/postdisplay
|
||||||
BUFFER="$original_buffer"
|
BUFFER="$original_buffer"
|
||||||
|
POSTDISPLAY="$original_postdisplay"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $retval
|
return $retval
|
||||||
|
Loading…
Reference in New Issue
Block a user