registers.nvim icon indicating copy to clipboard operation
registers.nvim copied to clipboard

visual map not work in quickfix or floaterm window

Open aceforeverd opened this issue 3 years ago • 5 comments
trafficstars

Hi, here is my experience with visual map in quickfix or floaterm window that I feel not right.

vimrc

if empty(glob('~/.config/nvim/autoload/plug.vim'))
    silent execute '!curl -fLo '.s:home.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
    autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.config/nvim/bundle/pkgs/')

Plug 'tversteeg/registers.nvim'

call plug#end()

filetype plugin on
filetype indent on

reproduce

  1. vim open a file
  2. :grep something in a file
  3. :copen
  4. visually select a line then "+
  5. after hitting + the cursor jump to editing file from quickfix window.

some problem happen from a floaterm window, it go the insert mode instead yank the text

env

I test with nvim-0.7.0 but it should also reproduce with nvim 0.6

aceforeverd avatar Jan 12 '22 14:01 aceforeverd

I've added a change that won't open the registers window when the buffer is not modifiable. This should fix this issue, can you verify that that's the case?

tversteeg avatar Jan 30 '22 11:01 tversteeg

thanks for the fix and I test with the same vimrc, but It seems not work

aceforeverd avatar Feb 08 '22 05:02 aceforeverd

Do you get the exact same problem? Where the cursor jumps back? Is this only in the :copen window?

tversteeg avatar Feb 08 '22 10:02 tversteeg

Do you get the exact same problem? Where the cursor jumps back? Is this only in the :copen window?

slightly different. the problem exists still in :copen or floterm window, but this time I press " after visually select a few lines, it quit and switch back to normal mode immediately

aceforeverd avatar Feb 17 '22 01:02 aceforeverd

Hi I just investigated a little, and here is I found

  1. floaterm and quickfix may have different reason
  2. for floaterm, my steps is <C-\><C-n> -> Vjjjj -> " -> +y, the reason is it go back to terminal mode instead of terminal normal mode, just as vim.api.nvim_win_close will go back to terminal mode directly, that's why I finally got gv"+y in the terminal prompt. Cuz the problem does not exist in native nvim terminal, I don't know if it's floterm's problem.
  3. for quickfix, I don't have a collusion yet. The main issue is it will jump back to edit buffer from qf, with 2 situation
    • one is during Vjjjj -> ", after press ", the cursor jump to edit buffer and popup appear there. It seems open window with height = 25 in my environment, when I manually change the height option to 10, the popup window appear on top of quick window.
    • after change height to 10, the cursor still jump above, but just after press the specific register key, like Vjjj -> "" -> *`

aceforeverd avatar Feb 20 '22 07:02 aceforeverd

I've rewritten the plugin in #68, and also the logic for opening the window. Could you verify if this is still an issue there?

tversteeg avatar Sep 18 '22 11:09 tversteeg

I can't reproduce this in the newest version, so it should be fixed. If that isn't the case please re-open the issue.

tversteeg avatar Oct 01 '22 12:10 tversteeg