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

Error Message when selecting text objects.

Open behzade opened this issue 3 years ago • 1 comments

Describe the bug When selecting vim text objects, for example vaw to select a word, if there is a pause between pressing a and w the following error message is shown.

Error executing vim.schedule lua callback: .../packer/start/sidebar.nvim/lua/sidebar-nvim/renderer.lua:162: E565: Not allowed to change text or change window

stack traceback:                                                                                                                                                                                                     
        [C]: in function 'nvim_buf_set_lines'                                                                                                                                                                        
        .../packer/start/sidebar.nvim/lua/sidebar-nvim/renderer.lua:162: in function 'draw'                                                                                                                          
        .../pack/packer/start/sidebar.nvim/lua/sidebar-nvim/lib.lua:25: in function '_redraw'                                                                                                                        
        .../pack/packer/start/sidebar.nvim/lua/sidebar-nvim/lib.lua:34: in function 'loop'                                                                                                                           
        .../pack/packer/start/sidebar.nvim/lua/sidebar-nvim/lib.lua:50: in function ''                                                                                                                               
        vim/_editor.lua: in function <vim/_editor.lua:0>     

To Reproduce Steps to reproduce the behavior:

  1. Start to select a text object
  2. Pause before the last key press

Expected behavior No error message being displayed

Environment (please complete the following information):

  • nvim version: v0.7.2
  • sidebar setup:
 use({
       "sidebar-nvim/sidebar.nvim",
       config = function()
           local sidebar = require("sidebar-nvim")
           local sidebar_lib = require("sidebar-nvim.lib")
           local opts = {
               open = true,
               sections = {
                   "files",
                   "git",
                   "containers"
               },
           }
           sidebar.setup(opts)
           vim.api.nvim_create_autocmd(
               "BufEnter",
               { pattern = "*", callback = sidebar_lib.update }
           )
       end,
   })

behzade avatar Jul 10 '22 17:07 behzade

thanks for the details, appreciate. I will take a look

GustavoKatel avatar Jul 10 '22 18:07 GustavoKatel