Zsh-autosuggestions: Cursor won't jump at the end of line

Created on 23 Jun 2019  路  7Comments  路  Source: zsh-users/zsh-autosuggestions

If I write following command:

systemctl lis<cursor>(t-unit-files)

, then after pressing right arrow I will get following behavior:

systemctl list<cursor>-unit-files

, but expected behavior is following:

systemctl list-unit-files<cursor>

This bug occurs only in 0.6.2-1. Version 0.6.1-1 works as expected.

bug reproduced

Most helpful comment

Ok please try branch fixes/move-cursor-on-accept (PR #453). It should fix this issue and maintain the fixed behavior for #302 as well.

All 7 comments

I got the same problem.

The issue was introduced in commit 676aebd by setting the cursor to max_cursor_pos instead of #BUFFER.

- CURSOR=${#BUFFER}
+ CURSOR=${max_cursor_pos}

where max_cursor_pos is equal to the length of the buffer before the suggestion is appended.
Hence the cursor stays where it is.

The problem also exists when using vi-keybindings.

Thanks guys, major oversight on my part. Will get this fixed soon. And will get a test written up for this so it should never happen again.

Ok please try branch fixes/move-cursor-on-accept (PR #453). It should fix this issue and maintain the fixed behavior for #302 as well.

I also encountered the same problem, please fix it as soon as possible.:rose:

fixes/move-cursor-on-accept works for me. The cursor jumps to the end and dl works as intended.

fixes/move-cursor-on-accept works for me. The cursor jumps to the end and dl works as intended.

I second that.

@ericfreese Thanks for resolving this so quickly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kenmmm picture Kenmmm  路  4Comments

dipam7 picture dipam7  路  3Comments

mindyourlifeguide picture mindyourlifeguide  路  6Comments

kergoth picture kergoth  路  3Comments

sebw picture sebw  路  6Comments