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

Cannot paste text to enter cookie

Open 28jb11 opened this issue 1 year ago • 13 comments

I select Sign in (By Cookie) which takes me to the Enter cookie prompt. I then go to my browser and find the cookie from the graphql requests. I copy it to my clipboard. Then, when I move back to neovim to paste in the text, it simply enters nothing. I have tried ctrl-shift-v (this is what i usually use with neovim, and works fine everywhere else), shift-insert and the neovim command "*. None of these are working for pasting text into the prompt. I am on neovim 0.9.5 and have the latest version of leetcode.nvim installed.

28jb11 avatar Apr 22 '24 02:04 28jb11

Have you tried pasting and pressing enter? Sometimes the prompt behaves weirdly and doesn't show that the text is pasted yet it's there

kawre avatar Apr 22 '24 21:04 kawre

Have you tried pasting and pressing enter? Sometimes the prompt behaves weirdly and doesn't show that the text is pasted yet it's there

Yes.

28jb11 avatar Apr 22 '24 22:04 28jb11

Then you can try creating the cookie file manually. Create a file named cookie (cookie_cn for chinese version) inside vim.fn.stdpath("cache") + "leetcode" and paste it there

kawre avatar Apr 22 '24 22:04 kawre

Same problem with me.

 Expected Lua number
stack traceback:
^I[C]: in function 'nvim_win_is_valid'
^I...k/.local/share/nvim/lazy/nui.nvim/lua/nui/input/init.lua:134: in function 'unmount'
^I...k/.local/share/nvim/lazy/nui.nvim/lua/nui/input/init.lua:111: in function <...k/.local/share/nvim/lazy/nui.nvim/lua/nui/input/init.lua:109>

I tried creating the cookie file at that file, now show notification "http error 499"

Deshdeepak1 avatar May 04 '24 18:05 Deshdeepak1

@Deshdeepak1 what is your nvim version?

kawre avatar May 05 '24 11:05 kawre

Until https://github.com/MunifTanjim/nui.nvim/pull/362 is not merged, creating the cookie file manually should work now without any errors now.

kawre avatar May 05 '24 12:05 kawre

@Deshdeepak1 what is your nvim version?

0.9.5

Deshdeepak1 avatar May 05 '24 18:05 Deshdeepak1

creating the cookie file manually should work

it gives "http error 499"

Deshdeepak1 avatar May 05 '24 18:05 Deshdeepak1

creating the cookie file manually should work

it gives "http error 499"

After updating? Make sure you are using graphql requests

kawre avatar May 05 '24 18:05 kawre

Okay, I updated leetcode.nvim , and it works now. Thanks.

Deshdeepak1 avatar May 05 '24 19:05 Deshdeepak1

Then you can try creating the cookie file manually. Create a file named cookie inside vim.fn.stdpath("cache") + "leetcode" and paste it there

Just a little addition, if you use leetcode.cn, then the file should be cookie_cn.

yqwu905 avatar May 06 '24 01:05 yqwu905

You also need to manually trim out \n from tokens since nui input popup seems not working well with multiple lines.

phanen avatar May 06 '24 02:05 phanen

just in case you are a newbie like me and don't know how to use vim.fn.stdpath("cache") + "leetcode", the full lua code looks like this :lua print(vim.fn.stdpath("cache") .. "/leetcode")

huawushanqiu avatar Aug 12 '24 14:08 huawushanqiu