chrisbra / NrrwRgn

A Narrow Region Plugin for vim (like Emacs Narrow Region)
http://www.vim.org/scripts/script.php?script_id=3075
675 stars 25 forks source link

Moving the Narrow Region to a separate tab and closing gives an error #66

Open idbrii opened 5 years ago

idbrii commented 5 years ago
  1. Select a block of text
  2. :NR
  3. :wincmd T
  4. :close

    Error detected while processing BufWinLeave Autocommands for "": E121: Undefined variable: b:nrrw_instn E116: Invalid arguments for function 328_NRBufWinLeave

However, modifying and saving (:w) correctly applies to the original text, so it seems this is a valid use case.

Tested on 19e79fb4346369dfa3a4e6fd35742f5c5d40bdba, gvim 8.1.527, on Win10.

Also, I just found the :NR! command which I can switch to as my default so I'm less bothered by this bug. Thanks for the great plugin!

chrisbra commented 5 years ago

latest master fixed this not completly. It works, if you use :noa wincmd T to make sure the WinEnter autocommand does not trigger for the narrowed window. Not sure how to fix this currently.