kawre / leetcode.nvim

A Neovim plugin enabling you to solve LeetCode problems.
MIT License
1.05k stars 46 forks source link

Can't seem to press enter on the dashboard to select 'Sign in' #10

Closed surmish closed 11 months ago

surmish commented 11 months ago

image

I'm stuck on this screen, and can press enter to bring up the floating window for pasting the cookie. What am I missing?

nvim: latest build, Oct 11 '23, compiled locally

kawre commented 11 months ago

Try updating to the latest version. :Lazy update leetcode.nvim

kohane27 commented 11 months ago

I'm also facing this issue. Please see the following video:

https://github.com/kawre/leetcode.nvim/assets/57322459/d3637fd9-321e-46a7-afc2-e56f33ee9509

After typing hello and press Enter, nothing happens.

Where does it read from the cookie? Can I manually create the file and input the token into the file?

I'm using the latest commit

Thank you!

kawre commented 11 months ago

Does it work after pasting the correct cookie?

kohane27 commented 11 months ago

@kawre It has the same behavior: it becomes empty again. Thank you for looking into this issue for us.

kawre commented 11 months ago

can you try pressing enter in insert mode

kohane27 commented 11 months ago

It works! I have to press Enter in Insert mode! Thank you so much!

surmish commented 11 months ago

Not sure what changed, but after nvim update and LazyVim and lazyvim.nvim update, now even nvim leetcode.nvim doesn't work.

 {
    "kawre/leetcode.nvim",
    build = ":TSUpdate html",
    dependencies = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim", -- required by telescope
      "nvim-telescope/telescope.nvim",
      "nvim-tree/nvim-web-devicons",
      "nvim-treesitter/nvim-treesitter",
      "rcarriga/nvim-notify",
    },
    opts = {
      lang = "rust",
      -- sql = "postgresql"
    },
    config = function(_, opts)
      vim.keymap.set("n", "<leader>lq", "<cmd>LcQuestionTabs<cr>")
      vim.keymap.set("n", "<leader>lm", "<cmd>LcMenu<cr>")
      vim.keymap.set("n", "<leader>lc", "<cmd>LcConsole<cr>")
      vim.keymap.set("n", "<leader>ll", "<cmd>LcLanguage<cr>")
      vim.keymap.set("n", "<leader>ld", "<cmd>LcDescriptionToggle<cr>")

      require("leetcode").setup(opts)
    end,
  },

is my setup.

After adding event = "BufEnter" for leetcode.nvim in my setup above, I see this:

Error executing lua callback: ...hare/nvim/lazy/leetcode.nvim/lua/leetcode-menu/utils.lua:10: 'win' cannot be passed for buffer-local option 'filetype'
stack traceback:
    [C]: in function 'nvim_set_option_value'
    ...hare/nvim/lazy/leetcode.nvim/lua/leetcode-menu/utils.lua:10: in function 'apply_opt_local'
    ...share/nvim/lazy/leetcode.nvim/lua/leetcode-menu/init.lua:120: in function 'init'
    ...tu/.local/share/nvim/lazy/leetcode.nvim/lua/leetcode.lua:61: in function 'start'
    ...tu/.local/share/nvim/lazy/leetcode.nvim/lua/leetcode.lua:72: in function <...tu/.local/share/nvim/lazy/leetcode.nvim/lua/leetcode.lua:72>
kawre commented 11 months ago

Is the orignal issue resolved? Can you sign in without any problems?

surmish commented 11 months ago

I just looked into my config files if there was something wrong, I had mapped <CR> enter key to <ESC>:

vim.keymap.set("n", "<CR>", '&buftype ==# "nofile" ? "<CR>" : ":"', { expr = true, desc = "Return key enters command mode" })

Commenting it out resolved the problem. Do you know how to get around this? Closing this non-issue and thank you very much for the plugin. I will try it out now.

kawre commented 11 months ago

@surmish added an option to navigate with Tab