Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: "No such widget" when activating too early when the shell loads #11

Open
ShinyZero0 opened this issue Jul 23, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ShinyZero0
Copy link

ShinyZero0 commented Jul 23, 2024

Describe the bug

If i press C-r to activate hsmw just after the shell starts, and then return to normal shell, i'll get .No such widget '.hsmw-saved-self-insert' on any printable key press. I'm using zinit and loading it with light-mode (before i used wait but thought light could fix it).
I tried to paste these lines from readme after loading the plugin but that did nothing, except i now also get No such widget '.hsmw-saved-reset-prompt' every second.

zstyle :plugin:history-search-multi-word reset-prompt-protect 1

schedprompt() {
	zle && zle reset-prompt
	sched +1 schedprompt
}

zmodload -i zsh/sched
schedprompt

Steps to reproduce

Activate hsmw too fast when the shell starts. Need fast fingers and slow CPU

Expected behavior

Wait until everything loads instead of letting me break the shell

Screenshots and recordings

No response

Operating System & Version

linux-gnu | unknown | x86_64 | x86_64 | x86_64 unknown
actually void linux, zsh installed from guix

Zsh version

zsh 5.9 (x86_64-unknown-linux-gnu)

Terminal emulator

st

If using WSL on Windows, which version of WSL

None

Additional context

zshrc:

if [[ ! -r $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
	command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
	command git clone --depth 1 https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
		print -P "%F{33} %F{34}Installation successful.%f%b" || \
		print -P "%F{160} The clone has failed.%f%b"
fi

typeset -U fpath path

source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

zstyle ':completion:*' rehash true
zstyle ':completion:*' completer _complete _ignored _approximate 
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
zstyle ':completion:*' max-errors 3
# zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle :compinstall filename "$HOME/.zshrc"

bindkey -e
export KEYTIMEOUT=1
zle-line-init() {
	print -n "\e[5 q"
}
zle -N zle-line-init
print -n '\e[5 q' # Use beam shape cursor on startup.
preexec() { print -n '\e[5 q' ;} # Use beam shape cursor for each new prompt.

autoload -Uz edit-command-line
zle -N edit-command-line
bindkey "^O" edit-command-line

autoload -Uz expand-absolute-path
zle -N expand-absolute-path
bindkey "^w" vi-backward-kill-word
bindkey "^U" backward-kill-line
bindkey "[1~" beginning-of-line # home
bindkey "[4~" end-of-line # end
for key ("^[[1;5C" "^[f"); do
	bindkey $key vi-forward-word
done
for key ("^[[1;5D" "^[b"); do
	bindkey $key vi-backward-word
done
bindkey "^R" history-incremental-search-backward
bindkey "^S" history-incremental-search-forward

# TURBO MODE
zinit wait lucid depth="1" for \
	peterhurford/git-it-on.zsh \
	blockf olets/zsh-abbr \
	blockf Aloxaf/fzf-tab \
	OMZL::git.zsh \
	# RobSis/zsh-completion-generator \

zinit light-mode depth="1" for \
	romkatv/powerlevel10k \
	zdharma-continuum/history-search-multi-word \

zstyle :plugin:history-search-multi-word reset-prompt-protect 1

schedprompt() {
	zle && zle reset-prompt
	sched +1 schedprompt
}

zmodload -i zsh/sched
schedprompt

zinit wait depth="1" lucid blockf completions for \
	zsh-users/zsh-completions \
	https://github.com/TheLocehiliosan/yadm/raw/master/completion/zsh/_yadm

zmodload zsh/complist

zle_highlight+=(paste:none)

setopt autocd
setopt HIST_EXPIRE_DUPS_FIRST HIST_IGNORE_DUPS HIST_IGNORE_ALL_DUPS HIST_IGNORE_SPACE HIST_FIND_NO_DUPS HIST_SAVE_NO_DUPS SHARE_HISTORY
# INC_APPEND_HISTORY

HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000

# Help command
unalias run-help
autoload run-help
alias help=run-help

# RUN LAST

zinit wait"0b" lucid for \
	zdharma-continuum/fast-syntax-highlighting

zinit wait"0c" lucid atinit:"zicompinit; zicdreplay" for zdharma-continuum/null
@ShinyZero0 ShinyZero0 added the bug Something isn't working label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant