Friday, December 18, 2020

E77: Too many files

I have a simple scratch buffer functionity in scratch.vim like follows

if exists('g:loaded_scratch')
finish
endif
let g:loaded_scratch = 1

let g:scratchbuf_no = 1

function! ScratchEdit(cmd)
exe a:cmd '[Scratch' . g:scratchbuf_no . ']'
let g:scratchbuf_no += 1

setlocal buflisted
setlocal noswapfile
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal foldcolumn=0
setlocal nonumber
endfunction

command! -bar -nargs=* Scratch call ScratchEdit('edit')

(if above could/should be improved any advice is welcome)


Sometimes when issueing :Scratch I get

E77: Too many files

Then after some minutes when switching buffers (but not having closed
any buffer) I can do :Scratch without any errors.

Any ideas how to find out what the cause is?

--
Thanks, Manfred

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201218101659.7b48f32c%40hogwart.

No comments: