You can clone with
I tried to diff two regions of the same file using this plugin. Diffing works, but you can't save any changes back to original file. When I enter :w in NR buffer, it says "NarrowRegion: Original buffer protected. Can't write changes!"
Is it possible to open two different NR buffers from the same file and save changes made to them?
Thanks for reporting. Please try the updated version and make sure to set the g:nrrw_rgn_protect variable to 'n'
Thanks! It works now as I wanted.
I noticed one more issue. When you close these multiple NR buffers, highlighting of NR regions in the original buffer won't restore to its original state (before opening NR buffers).
Hm, this works for me.
Can you give me the exact steps, how the syntax highlighting is wrong?
I uploaded a video where this bug can be seen. First time it works OK, but second time the highlighting won't go away. Maybe it depends on what region you close first, I'm not sure.
I hope it helps.
Okay, there was something seriously wrong with Narrowing regions of the same buffer at the same time, which could mess up your data and the highlighting. This should be fixed now.
Please try again and be sure to set the g:nrrw_rgn_protect='n'
Could you please check again?
I tried the updated version and it didn't fix the issue. The highlighting still persists after closing narrow regions.
I think I got it. Deleting the highlighting regions was wrong. I pushed an update
Nope. Highlighting is still there after closing narrow regions.
Here is what I did:
open first nregion, open second nregion
delete some words from the first one, write and close it
now I have only one nregion open, but both regions in the original file are highlighted.
close the second one
now I have no nregions open and one region in the original file highlighted
I pulled the latest commits from 22 of July and now everything works as expected.