Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

vim.ui.input clashes with rest.nvim #172

Open
mawkler opened this issue Sep 20, 2024 · 0 comments
Open

vim.ui.input clashes with rest.nvim #172

mawkler opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mawkler
Copy link

mawkler commented Sep 20, 2024

Describe the bug

Dressing seems to clash with rest.nvim. When rest.nvim reads in input using with vim.ui.input using dressing.nvim an error is thrown. If I remove dressing.nvim it works. It also works with noice.nvim's vim.ui.input modification.

System information

  • OS: linux
  • Neovim version: v0.11.0-dev-794+gf01c764cc
  • Is this related to a specific vim.ui.select backend? If so, which one?
  • Dressing config:
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    '--branch=stable', -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  {
    "rest-nvim/rest.nvim",
    dependencies = 'nvim-treesitter/nvim-treesitter',
  },
  {
    'stevearc/dressing.nvim',
    opts = {}
  }
})

To Reproduce
Steps to reproduce the behavior:

  1. nvim -u path/to/config

  2. Input the following to your buffer:

    @host = https://api.github.com
    
    # @prompt host Host to send the request
    
    GET /users/{{user}}
    Host: {{host}}
    user-agent: neovim
  3. :Rest run

  4. rest.nvim tries to read from vim.ui.input, but the following error is thrown:

Error executing Lua callback: /usr/share/nvim/runtime/lua/vim/treesitter.lua:217: Index out of bounds
stack traceback:
        [C]: in function 'nvim_buf_get_text'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:217: in function 'get_node_text'
        .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:41: in function 'get_node_field_text'
        .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:264: in function 'parse_variable_declaration'
        .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:465: in function 'parse'
        ...ocal/share/nvim/lazy/rest.nvim/lua/rest-nvim/request.lua:111: in function 'run'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:125: in function 'impl'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:309: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:297>
@mawkler mawkler added the bug Something isn't working label Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants