浏览代码

Merge pull request #454 from zsh-users/develop

v0.6.3
experiments/strategies-by-pattern v0.6.3
Eric Freese 5 年前
提交者 GitHub
父节点
当前提交
146020d9b2
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 5 个文件被更改,包括 17 次插入5 次删除
  1. +3
    -0
      CHANGELOG.md
  2. +1
    -1
      VERSION
  3. +2
    -1
      spec/options/widget_lists_spec.rb
  4. +5
    -1
      src/widgets.zsh
  5. +6
    -2
      zsh-autosuggestions.zsh

+ 3
- 0
CHANGELOG.md 查看文件

@ -1,5 +1,8 @@
# Changelog
## v0.6.3
- Fixed bug moving cursor to end of buffer after accepting suggestion (#453)
## v0.6.2
- Fixed bug deleting the last character in the buffer in vi mode (#450)
- Degrade gracefully when user doesn't have `zsh/system` module installed (#447)

+ 1
- 1
VERSION 查看文件

@ -1 +1 @@
v0.6.2
v0.6.3

+ 2
- 1
spec/options/widget_lists_spec.rb 查看文件

@ -5,12 +5,13 @@ describe 'a zle widget' do
context 'when added to ZSH_AUTOSUGGEST_ACCEPT_WIDGETS' do
let(:options) { ["ZSH_AUTOSUGGEST_ACCEPT_WIDGETS+=(#{widget})"] }
it 'accepts the suggestion when invoked' do
it 'accepts the suggestion and moves the cursor to the end of the buffer when invoked' do
with_history('echo hello') do
session.send_string('e')
wait_for { session.content }.to eq('echo hello')
session.send_keys('C-b')
wait_for { session.content(esc_seqs: true) }.to eq('echo hello')
wait_for { session.cursor }.to eq([10, 0])
end
end
end

+ 5
- 1
src/widgets.zsh 查看文件

@ -136,7 +136,11 @@ _zsh_autosuggest_accept() {
unset POSTDISPLAY
# Move the cursor to the end of the buffer
CURSOR=${max_cursor_pos}
if [[ "$KEYMAP" = "vicmd" ]]; then
CURSOR=$(($#BUFFER - 1))
else
CURSOR=$#BUFFER
fi
fi
_zsh_autosuggest_invoke_original_widget $@

+ 6
- 2
zsh-autosuggestions.zsh 查看文件

@ -1,6 +1,6 @@
# Fish-like fast/unobtrusive autosuggestions for zsh.
# https://github.com/zsh-users/zsh-autosuggestions
# v0.6.2
# v0.6.3
# Copyright (c) 2013 Thiago de Arruda
# Copyright (c) 2016-2019 Eric Freese
#
@ -398,7 +398,11 @@ _zsh_autosuggest_accept() {
unset POSTDISPLAY
# Move the cursor to the end of the buffer
CURSOR=${max_cursor_pos}
if [[ "$KEYMAP" = "vicmd" ]]; then
CURSOR=$(($#BUFFER - 1))
else
CURSOR=$#BUFFER
fi
fi
_zsh_autosuggest_invoke_original_widget $@

正在加载...
取消
保存