itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

cannot copy the link or paste the code for google-calendar #112

Closed debdeepbh closed 7 years ago

debdeepbh commented 7 years ago

After running for the first time with google calendar on, I'm unable to copy the link from vim command line with mouse. I'm using xterm and highlighting text from vim command line is not possible. However, I can use gvim to copy easily. Even with gvim, I am unable to paste the code in the command line. For some reason, it only pastes the first character. Even Crtl_R" pastes only the first character of the code. In what other ways can I paste the code in the command line? Maybe I can manually paste the code in some config file or a terminal-based (outside vim) input field?

itchyny commented 7 years ago

You don't integrate Vim with the system clipboard? set clipboard=unnamed and try CTRL_R *.

debdeepbh commented 7 years ago

Tried it and didn't work. I am able to paste the code in a typical vim insert mode using Ctrl_R *, Ctrl_R +, Ctrl_R " etc. I can paste in a typical command line (:) also. But in the command line area of Calendar.vim where is says "... CODE:" I cannot paste any of the buffers.

itchyny commented 7 years ago

I am unable to paste the code in the command line. For some reason, it only pastes the first character.

I can't still understand what's going on. OS's clipboard pasting (c-v) should work on many environment and terminals.

debdeepbh commented 7 years ago

If it helps, I am attaching a gif. Here, I am using lxterminal with a gui copy-pasting feature. Notice how pasting works everywhere except in the input area of code where only the first character shows up. cropepd

itchyny commented 7 years ago

Can you try with the following procedure?

vim -u NONE
:echo input('')
Edit->Paste

Here's my screenshot.

debdeepbh commented 7 years ago

If I follow your procedure I can paste properly in the input field.

itchyny commented 7 years ago

calendar.vim also uses input here https://github.com/itchyny/calendar.vim/blob/6cf60f08/autoload/calendar/google/client.vim#L53. I've got confused... Is it related to the multiline text?

let g:text = input("foo\nbar\nCODE:")
CTRL_R *
echo g:text
debdeepbh commented 7 years ago

I tried this and it properly outputs the value of the global variable 'text'. For the time being, I'm replacing https://github.com/itchyny/calendar.vim/blob/6cf60f08/autoload/calendar/google/client.vim#L53 by let code = 'my_actual_code_here_in_plaintext' temporarily to make it work and revert it back after the data from google are downloaded.

itchyny commented 7 years ago

I think it's a bug of the terminal but it's hard for me to reproduce and fix the problem.

sjoeboo commented 7 years ago

So I've got the exact same issue, clipboard is shared w/ OS, I'm on OSX, using iterm2 (also tried built in terminal), both just paste the first character of the code. Is there a file/config I can drop the code into?

itchyny commented 7 years ago

What is your version of Vim? Can you abort the CODE: prompt with <C-c>?

sjoeboo commented 7 years ago

I'm on Vim 8.0

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 25 2016 08:56:17)
MacOS X (unix) version

and yes, Ctrl-C totally gets me out of the CODE prompt.

itchyny commented 7 years ago

I think I've fixed this issue.

sudoFerraz commented 1 year ago

Being able to reproduce with iterm2 and neovim