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

Full-screen narrow region (:NR!) throws error on write #62

Closed henrebotha closed 5 years ago

henrebotha commented 6 years ago

The error in question:

"../../dev-entersekt/CNKT/billing/src/main/java/com/entersekt/events/ElrSender.java" 189L, 8046C
Error detected while processing function <SNR>154_WriteNrrwRgn[14]..nrrwrgn#WidenRegion:
line  191:
E86: Buffer 7 does not exist
Press ENTER or type command to continue

Steps to reproduce:

  1. Select a region in visual mode.
  2. Type :NR! and press Enter.
  3. Edit the displayed buffer.
  4. Type :w.

Complete .vimrc used:

set nocompatible
filetype off
let mapleader = "\<space>"
call plug#begin()
Plug 'chrisbra/NrrwRgn'
call plug#end()
set updatetime=250

It does however work, despite the error. (Syntax highlighting is suppressed after widening, but I understand this to be a separate issue.)

chrisbra commented 6 years ago

hm, I cannot reproduce this. I made a slight change for widening a single narrowed window, did this perhaps fix it?

henrebotha commented 6 years ago

Nope, seems like the same behaviour as before.

"app/javascript/Main.elm" 284L, 9049C
Error detected while processing function <SNR>157_WriteNrrwRgn[14]..nrrwrgn#WidenRegion:
line  191:
E86: Buffer 2 does not exist
E37: No write since last change
E162: No write since last change for buffer "app/javascript/Main.elm"
Press ENTER or type command to continue
chrisbra commented 6 years ago

I need more information. Do you perhaps do not use :set hidden Otherwise please reproduce with a simple vimrc.

henrebotha commented 6 years ago

Vimrc:

set nocompatible

call plug#begin()
Plug 'chrisbra/NrrwRgn'
call plug#end()

Hidden:

:set hidden?
nohidden

Vim version:

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 22 2017 14:32:14)
macOS version
Included patches: 1-1420
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +cryptv            -footer            +menu              +odbeditor         +statusline        +virtualedit
+arabic            +cscope            +fork()            +mksession         +packages          -sun_workshop      +visual
+autocmd           +cursorbind        +fullscreen        +modify_fname      +path_extra        +syntax            +visualextra
-autoservername    +cursorshape       -gettext           +mouse             +perl              +tag_binary        +viminfo
+balloon_eval      +dialog_con_gui    -hangul_input      +mouseshape        +persistent_undo   +tag_old_static    +vreplace
+balloon_eval_term +diff              +iconv             +mouse_dec         +postscript        -tag_any_white     +wildignore
+browse            +digraphs          +insert_expand     -mouse_gpm         +printer           +tcl               +wildmenu
++builtin_terms    +dnd               +job               -mouse_jsbterm     +profile           +termguicolors     +windows
+byte_offset       -ebcdic            +jumplist          +mouse_netterm     +python            +terminal          +writebackup
+channel           +emacs_tags        +keymap            +mouse_sgr         -python3           +terminfo          -X11
+cindent           +eval              +lambda            -mouse_sysmouse    +quickfix          +termresponse      -xfontset
+clientserver      +ex_extra          +langmap           +mouse_urxvt       +reltime           +textobjects       +xim
+clipboard         +extra_search      +libcall           +mouse_xterm       +rightleft         +timers            -xpm
+cmdline_compl     +farsi             +linebreak         +multi_byte        +ruby              +title             -xsmp
+cmdline_hist      +file_in_path      +lispindent        +multi_lang        +scrollbind        +toolbar           -xterm_clipboard
+cmdline_info      +find_in_path      +listcmds          -mzscheme          +signs             +transparency      -xterm_save
+comments          +float             +localmap          +netbeans_intg     +smartindent       +user_commands
+conceal           +folding           -lua               +num64             +startuptime       +vertsplit
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X -DMACOS_X_DARWIN  -F/usr/local/opt/pyt
hon/Frameworks -I/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.14/Framewor
ks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L.             -L /BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal
.sdk/usr/local/libressl/lib -L/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk/u
sr/local/lib -L.             -L /BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk
/usr/local/libressl/lib -L/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk/usr/l
ocal/lib -F/usr/local/opt/python/Frameworks -L/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -framewo
rk CoreFoundation -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework AppKit   -fstack-protector  -L/Sy
stem/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/opt/python/Frameworks -framework Python  -F/System/Library/Frameworks -fram
ework Tcl -framework CoreFoundation -framework Ruby

If I do :set hidden, a different error occurs:

E37: No write since last change
E162: No write since last change for buffer "../../dev-entersekt/CNKT/billing/src/main/java/com/entersekt/events/ElrSender.java"
Press ENTER or type command to continue
henrebotha commented 6 years ago

Any thoughts @chrisbra?

chrisbra commented 6 years ago

Will have a look again, however I don't see your error and I don't see why you would get the hidden error. The whole point of setting hidden is, to be able to switch buffers (and keep them in memory) even if they have been changed.

chrisbra commented 6 years ago

can you please try again? I made some more changes.

gtarsia commented 5 years ago

I experienced the same behaviour as @henrebotha EDIT: Sorry, I set hidden in vim and it got fixed for me.