folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
4.75k stars 154 forks source link

Added check for OSC 52 to disable related register previews - Fixes nvim hanging issue #604

Closed nikfp closed 1 month ago

nikfp commented 1 month ago

When building the register preview, Which-Key tries to paste from the + and * registers, which normally works as expected. However when OSC-52 is set up per :help osc-52 this causes whick-key to try and paste from those registers and a subsequent hang in nvim.

This PR closes that loop by avoiding the paste operation for the 2 registers in question when OSC 52 is detected. Note that this assumes OSC 52 is set up per the nvim docs, and any other setups might not properly trigger the check conditions I set up.

EDIT - a table is used with keys to avoid as a possible extension mechanism - this works for now but could be renamed / extended as needed and possibly read in from a config as desired.

Closes #584

folke commented 1 month ago

Thanks!