Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

opening two nregions from the same buffer blocks widening #3

Closed
kolyuchiy opened this Issue July 13, 2011 · 12 comments

2 participants

Nikolay Morev chrisbra
Nikolay Morev

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?

chrisbra
Owner

Thanks for reporting. Please try the updated version and make sure to set the g:nrrw_rgn_protect variable to 'n'

Nikolay Morev

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).

chrisbra
Owner

Hm, this works for me.

chrisbra
Owner

Can you give me the exact steps, how the syntax highlighting is wrong?

Nikolay Morev

http://dl.dropbox.com/u/4932631/out.ogv
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.

chrisbra
Owner

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'

chrisbra
Owner

Could you please check again?

Nikolay Morev kolyuchiy closed this July 20, 2011
Nikolay Morev

I tried the updated version and it didn't fix the issue. The highlighting still persists after closing narrow regions.

Nikolay Morev kolyuchiy reopened this July 20, 2011
chrisbra
Owner

I think I got it. Deleting the highlighting regions was wrong. I pushed an update

Nikolay Morev

Nope. Highlighting is still there after closing narrow regions.
Here is what I did:
vim 1.txt
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

chrisbra
Owner
Nikolay Morev

I pulled the latest commits from 22 of July and now everything works as expected.

Nikolay Morev kolyuchiy closed this July 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.