oae / gnome-shell-pano

Next-gen Clipboard Manager for Gnome Shell
https://extensions.gnome.org/extension/5278/pano/
GNU General Public License v2.0
1.04k stars 55 forks source link

Paste on selection had a wierd behavior on modal based editor #101

Closed azzamsa closed 1 year ago

azzamsa commented 1 year ago

Describe the bug Paste on selection had a weird behavior on modal-based editors such as nvim or Doom Emacs. It inserts ^ after the item selected on the clipboard, then inserts [ if the escape button is pressed.

If I remember correctly, on some occasions, CopyQ knows that I am in the modal-based editor. It pastes when I am in insert mode and it doesn't do anything if I am in command mode.

Expected behavior Pano shouldn't do anything and let the user do the manual paste.

Or better, it should be aware of whether the environment is pasteable (command mode) or not. If it is pasteable, do the automatic paste. Otherwise, go to insert mode, if failed, just let the user do the manual paste.

Screenshots

https://user-images.githubusercontent.com/17734314/192391951-54eaa0dc-7106-4738-aba2-3d18a6248132.mp4

https://user-images.githubusercontent.com/17734314/192391989-442e9a74-d9c3-4b66-b848-70f7ff4c69cb.mp4

To Reproduce

OS: Fedora Linux 36 (Workstation Edition) x86_64
Kernel: 5.19.9-200.fc36.x86_64
Shell: zsh 5.8.1
DE: GNOME 42.5
WM: Mutter
Terminal: WezTerm

Steps to reproduce, if applicable:

  1. Use any modal editor
  2. Go to insert mode
  3. Select the item from the clipboard
  4. Bug
oae commented 1 year ago

It is not possible for Pano to know if it can paste or not. Gnome-shell clipboard API doesn't expose much info. When you select an item, it will just trigger the ctrl+v keys. If you don't want this feature you can disable it in the settings;

image

mbeko commented 1 year ago

@azzamsa Just as an explanation in addition to what oae said, Ctrl+V doesn't work in general in the terminals that I know. You have to use e.g. Ctrl+Shift+V.

Likewise, Ctrl+V has a special meaning in Vim. In input and command mode, it is used to enter escape sequences for special characters, e.g. Ctrl+V followed by Tab inserts ^I which stands for the Tab character.