RRethy/nvim-treesitter-endwise

Autoclosed words not reverted back via `u` key

aliaksandrb opened this issue ยท 0 comments

Within existing nesting group the plugin leaves auto-closed end's when history reverted back via u key.

  1. open an existing file, ex:
class A
  def b
   p 1
  end

  def c
    p 2
  end
end
  1. Add a nested group
class A
  module B
    def x
       |
    end  # autoclosed ๐Ÿ‘ 
  end # autoclosed ๐Ÿ‘ 
  def b
   p 1
  end

  def c
    p 2
  end
end
  1. Revert it back via u key multiple times. It stops in this state:
class A
  end # left ๐Ÿ‘Ž 
  def b
   p 1
  end

  def c
    p 2
  end
end

Please notice the end left behind. I would expect it reverts back into initial state instead.

Here is short video example: https://user-images.githubusercontent.com/526022/232875662-89ecbd07-6fe1-4c65-8b98-cefd6bafd3c1.mov