voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.47k stars 78 forks source link

yank error in vim9.0's popup windows #378

Open leoatchina opened 1 year ago

leoatchina commented 1 year ago

Before reporting

Environment

If you are using vim(not neovim), fill in the following blanks

If you are using neovim, just run :checkhealth floaterm and post the content

below.

not happened  in neovim

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

if has('patch-8.1.1')
    set termwinkey=<C-_>
    let g:has_terminal=2
endif
tnoremap <expr> <C-r> '<C-\><C-n>"'.nr2char(getchar()).'pi'
tnoremap <M-q> <C-\><C-n>:q!<CR>
tnoremap <M-w> <C-\><C-n>:ChooseWin<CR>
tnoremap <C-v> <C-\><C-n>
tnoremap <C-g> <C-\><C-n>
" --------------------------
" XXX: cannot paste in floaterm when using [vim9.0]
" --------------------------
if g:has_terminal == 1
    tnoremap <M-'> <C-\><C-n>""pa
else
    tnoremap <M-'> <C-_>""
endif
if has('clipboard')
    if g:has_terminal == 1
        tnoremap <M-v> <C-\><C-n>"*pa
    else
        tnoremap <M-v> <C-_>"*
    endif
else
    if has('nvim')
        tnoremap <M-v> <C-\><C-n>""pa
    else
        tnoremap <M-v> <C-_>""
    endif
endif

Describe your question, feature request, or bug.

Steps to reproduce

Using the minimal vimrc

You can see what I have mapped and configured to yank from " or * into terminal, I am sure it is floaterm's  bug related `only`  with vim's `popup window`.

1. In `vim-terminal-help` when vim , the paste map takes effects,  g:has_terminal==2
2. In `floterm` in the right half screen(not popup) when vim , the paste map takes effects, g:has_terminal==2
3. In `neovim`,the paste map takes effects,  g:has_terminal==1
4. In `terminal` created in  next tab ,the paste map takes effects,   g:has_terminal==1 or 2

Steps to reproduce the behavior:

Actual behaviour

Just do M-'or M-* , give me""or"*`

Expected behaviour

Paste from register " or *

Screenshots(Optional, GIF is better)