Skip to content

Commit eccb292

Browse files
committed
feat: add custom bracketed-paste handler to improve syntax highlighting after paste
1 parent 20342e7 commit eccb292

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

shell-plugin/forge.plugin.zsh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,16 @@ zle -N forge-accept-line
475475
# Register completions
476476
zle -N forge-completion
477477

478+
# Custom bracketed-paste handler to fix syntax highlighting after paste
479+
function forge-bracketed-paste() {
480+
zle .$WIDGET "$@"
481+
zle reset-prompt
482+
}
483+
484+
# Register the bracketed paste widget to fix highlighting on paste
485+
zle -N bracketed-paste forge-bracketed-paste
486+
487+
478488

479489
# Bind Enter to our custom accept-line that transforms :commands
480490
bindkey '^M' forge-accept-line

0 commit comments

Comments
 (0)