Open zhengyu-yang opened 4 years ago
I have also submitted this bug here
I'm not able to reproduce this either. What are you using to trigger ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS
? What version of z-sy-h?
@elony314 I was able to reproduce this and put up PR #507 to fix. Give that branch (fixes/partial-accept-duplicate-word
) a shot and let me know if it looks good to you.
Hi folks, first of all, amazing work that you guys are doing.
I came across this issue, but I don't know for sure If is the same.
I record a gif to show what is happening.
What I did, typed cd
, pasted something and then pressed the right arrow key.
The suggestion was duplicated because was the last command that I used.
UPDATE: I gave I try to the branch fixes/partial-accept-duplicate-word
and is not working for me 😞
@weslley39 I think the original poster was describing the issue from this gif:
I've opened a related issue (https://github.com/zdharma/fast-syntax-highlighting/issues/177) on the plugin I use for syntax highlighting.
Weirdly I haven't been able to repro the same bug you're seeing on my machine but I have a coworker with a very similar setup who has reproed - http://g.recordit.co/Z7NTQJ0lp4.gif
In the meantime, a temporary workaround that seems fine so far on my machine is to use fast-syntax-highlighting
without the asynchronous loading.
@elony314 would be curious if switching to https://github.com/zdharma/fast-syntax-highlighting fixes the issue for you
(Or try zsh-syntax-highlighting's feature/redrawhook
branch)
(See https://github.com/zsh-users/zsh-syntax-highlighting/issues/579, though; tl;dr: there's a known issue, but it has a known fix)
@ericfreese
I was or wasn't able to reproduce it, depending on how many times I sourced my ~/.zshrc
file:
if I source it xxx times, it gives me xxx times too me xxx extra times the last word of the command.
Note: in my example, I cancelled with which pip
command each time so that I didn't changed the history
@ewen-goisot source ~/.zshrc
isn't doing what you expect it's doing. source ~/.zshrc
doesn't reload your zsh configuration and actually is a way to break your shell in multiple ways, with or without zsh-asug and z-syhl. In order to reload your zsh configuration do exec zsh
. It's unreasonable to expect that plugins would continue working as expected after source ~/.zshrc
.
source ~/.zshrc
doesn't reload your zsh configuration and actually is a way to break your shell in multiple ways, with or without zsh-asug and z-syhl. In order to reload your zsh configuration doexec zsh
.
Whether source ~/.zshrc
is or isn't a good idea isn't an absolute truth; it's a function of how the zshrc itself is written. (And exec zsh
has its downsides too)
It's unreasonable to expect that plugins would continue working as expected after
source ~/.zshrc
.
FWIW, in z-sy-h's case, sourcing zsh-syntax-highlighting.zsh
multiple times should work just fine, though highlighting would be computed multiple times, which would result in slowness.
Separately, the z-sy-h redrawhook branch was merged this week, so anyone who saw z-asug issues that were related to z-sy-h should update z-sy-h to latest master and see if the problems persist.
@ewen-goisot
source ~/.zshrc
isn't doing what you expect it's doing.source ~/.zshrc
doesn't reload your zsh configuration and actually is a way to break your shell in multiple ways, with or without zsh-asug and z-syhl. In order to reload your zsh configuration doexec zsh
. It's unreasonable to expect that plugins would continue working as expected aftersource ~/.zshrc
.
exec zsh
works better (I don't get the last word repeated), you are perfectly right about this.
But source ~/.zshrc
is the only way for me to get this bug (the last word repeated).
though highlighting would be computed multiple times, which would result in slowness
it can become very slow, because the sourcing time does not increase linearly (it's something between quadratic and exponential: if I run it 50 times, the last one needs 111.55 seconds for me.
though highlighting would be computed multiple times, which would result in slowness
it can become very slow, because the sourcing time does not increase linearly (it's something between quadratic and exponential: if I run it 50 times, the last one needs 111.55 seconds for me.
Replied to that over on https://github.com/zsh-users/zsh-syntax-highlighting/issues/625.
Describe the bug
There are conflicted between
zsh-users/zsh-syntax-highlighting
andzsh-users/zsh-autosuggestions
. With both plugins activated, if one continuously usesZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS
, the last word of the suggestion will be duplicated.To Reproduce
Steps to reproduce the behavior:
Now, input
cd
and continuously useZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS
until the end of the line. Instead of get the completeTest1/Test2
, theTest2
part will be duplicated.Expected behavior
Actual behavior
Desktop