chrisbra / NrrwRgn

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

:NR! causes original buffer modified #43

Closed agguser closed 9 years ago

agguser commented 9 years ago

Using :NR! (open narrow buffer in current window) will always set original buffer to be modified.

chrisbra commented 9 years ago

Hi, is this a problem? I think this was done, to not accidentally close Vim when doing :q! in the scratch buffer.

chrisbra commented 9 years ago
" if hidden is set, set the original buffer to be modified, so
" that :q won't accidently quit vim
if &hid
setl modified
endif

I don't want to change this.

agguser commented 9 years ago

But you can close narrow buffer with :bw (or :bw!) to not quit vim? Could you please add a configuration option (e.g. g:nrrw_no_set_modified) to not setl modified? I want this because when original is set modified, I don't know if it was modified from (accidentally) saving narrow buffer or not!

chrisbra commented 9 years ago

Okay I have found a different solution, by mapping away :q and :q!. Please test.