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

Delay after pressing `<Plug>RestNvim`

Open mawkler opened this issue 2 years ago • 1 comments

There's a delay after pressing the <Plug>RestNvim. It seems to have length vim.o.timeoutlen, even though there's only one mapping. Here's a minimal config where I've mapped <CR> to <Plug>RestNvim:

{
  'NTBBloodbath/rest.nvim',
  dependencies =  'nvim-lua/plenary.nvim',
  config = function()
    require('rest-nvim').setup({})
    vim.keymap.set('n', '<CR>', '<Plug>RestNvim')
  end
}

If I press a key like j for instance immediately after invoking <Plug>RestNvim the request gets sent immediately.

mawkler avatar Sep 27 '23 18:09 mawkler

Changing from <Plug>RestNvim to rest.run fixes the issue:

{
  'NTBBloodbath/rest.nvim',
  dependencies =  'nvim-lua/plenary.nvim',
  config = function()
    local rest = require('rest-nvim')
    rest.setup({})
    vim.keymap.set('n', '<CR>', rest.run)
  end
}

So there seems to be some issue with the <Plug> mapping.

mawkler avatar Sep 27 '23 18:09 mawkler

Closing this due to v3 release. Now rest.nvim don’t provide any default <plug> mapping, instead it comes with user commands like :Rest run

Also, all code is rewrite to be asynchronous so it won’t block the editor while sending the request

boltlessengineer avatar Aug 23 '24 15:08 boltlessengineer

Great! Thank you for your awesome work!

mawkler avatar Aug 26 '24 08:08 mawkler