New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opening two nregions from the same buffer blocks widening #3

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

Comments

Projects
None yet
2 participants
@kolyuchiy

kolyuchiy commented Jul 13, 2011

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 13, 2011

Owner

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

Owner

chrisbra commented Jul 13, 2011

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

@kolyuchiy

This comment has been minimized.

Show comment
Hide comment
@kolyuchiy

kolyuchiy Jul 14, 2011

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

kolyuchiy commented Jul 14, 2011

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 18, 2011

Owner

Hm, this works for me.

Owner

chrisbra commented Jul 18, 2011

Hm, this works for me.

@chrisbra

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 18, 2011

Owner

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

Owner

chrisbra commented Jul 18, 2011

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

@kolyuchiy

This comment has been minimized.

Show comment
Hide comment
@kolyuchiy

kolyuchiy Jul 18, 2011

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.

kolyuchiy commented Jul 18, 2011

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 19, 2011

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'

Owner

chrisbra commented Jul 19, 2011

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 20, 2011

Owner

Could you please check again?

Owner

chrisbra commented Jul 20, 2011

Could you please check again?

@kolyuchiy

This comment has been minimized.

Show comment
Hide comment
@kolyuchiy

kolyuchiy Jul 20, 2011

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

kolyuchiy commented Jul 20, 2011

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

@kolyuchiy kolyuchiy closed this Jul 20, 2011

@kolyuchiy kolyuchiy reopened this Jul 20, 2011

@chrisbra

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 20, 2011

Owner

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

Owner

chrisbra commented Jul 20, 2011

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

@kolyuchiy

This comment has been minimized.

Show comment
Hide comment
@kolyuchiy

kolyuchiy Jul 21, 2011

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

kolyuchiy commented Jul 21, 2011

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jul 22, 2011

Owner

On Thu, July 21, 2011 10:18 pm, kolyuchiy wrote:

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

I am afraid, I can't reproduce it.

Here is what I did:
vim -u NONE -U NONE -N -i NONE -c 'ru! plugin/NrrwRgn.vim' file.txt

That starts vim, bypassing loading any plugin or you personal settings,
just nocompatible set and only load's the NrrwRgn plugin. That should
make sure, no personal setting or other plugin is messing with it.

  1. :let g:nrrw_rgn_protect='n'
  2. Narrow a first region :1,10NR
  3. Narrow a second region :11NR
  4. Changing a word in the first region, :wq
    The plugin put the changes back and removed the highlighting
    of the first region
  5. Changing a word in the second region, :wq
    The plugin put the changes back and removed the highlighting.

Looks good for me. Now there is another problem I just noticed (that is,
after step 5 and you make a new Narrowed Region, the plugin will happily
overwrite your second Narrowed Window and put in there the stuff
you selected this time. This needs to be changed, but other than that,
I don't see a problem)

Are your sure you updated your version?

regards,
Christian

Owner

chrisbra commented Jul 22, 2011

On Thu, July 21, 2011 10:18 pm, kolyuchiy wrote:

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

I am afraid, I can't reproduce it.

Here is what I did:
vim -u NONE -U NONE -N -i NONE -c 'ru! plugin/NrrwRgn.vim' file.txt

That starts vim, bypassing loading any plugin or you personal settings,
just nocompatible set and only load's the NrrwRgn plugin. That should
make sure, no personal setting or other plugin is messing with it.

  1. :let g:nrrw_rgn_protect='n'
  2. Narrow a first region :1,10NR
  3. Narrow a second region :11NR
  4. Changing a word in the first region, :wq
    The plugin put the changes back and removed the highlighting
    of the first region
  5. Changing a word in the second region, :wq
    The plugin put the changes back and removed the highlighting.

Looks good for me. Now there is another problem I just noticed (that is,
after step 5 and you make a new Narrowed Region, the plugin will happily
overwrite your second Narrowed Window and put in there the stuff
you selected this time. This needs to be changed, but other than that,
I don't see a problem)

Are your sure you updated your version?

regards,
Christian

@kolyuchiy

This comment has been minimized.

Show comment
Hide comment
@kolyuchiy

kolyuchiy Jul 24, 2011

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

kolyuchiy commented Jul 24, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment