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

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

@mawkler

Description

@mawkler

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>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions