davidgranstrom/scnvim

[BUG] Error If postwindow float in not enable

Closed this issue · 2 comments

Hi there!

After reinstalling scnvim (by mistake) I can't start scnvim anymore. I ran :checkhealth scnvim and there's nothing wrong there.

If I have in the config file

...
    postwin = {
        float = {
            enabled = false,
        },
    },
...

...which I prefer, and I do :SCNVimStart in a .scd file, sclang won't start and I'll get this:

Error executing Lua callback: ...vim/site/pack/packer/start/scnvim/lua/scnvim/postwin.lua:134: Vim(mkview):E32: No file name                                     
stack traceback:
        [C]: in function 'nvim_win_set_buf'
        ...vim/site/pack/packer/start/scnvim/lua/scnvim/postwin.lua:134: in function 'open_split'
        ...vim/site/pack/packer/start/scnvim/lua/scnvim/postwin.lua:151: in function 'open'
        ...nvim/site/pack/packer/start/scnvim/lua/scnvim/sclang.lua:54: in function 'default_fn'
        ...nvim/site/pack/packer/start/scnvim/lua/scnvim/action.lua:45: in function 'on_init'
        ...nvim/site/pack/packer/start/scnvim/lua/scnvim/sclang.lua:210: in function <...nvim/site/pack/packer/start/scnvim/lua/scnvim/sclang.lua:204>

Information

  • Operating system
    Ubuntu Studio 22.04

  • SuperCollider version
    SuperCollider 3.13.0-dev

  • nvim --version

NVIM v0.8.0-dev-1081-g907fc8ac3
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unu
sed-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthr
ough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_F
ROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr
/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az190-570

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"
  • Package manager
    packer.nvim

If there's any other information I could give to help to find out what's happening wrong, please ask.

best regards,
Gil

@gilfuser Hi, thanks for the report!

Error executing Lua callback: ...vim/site/pack/packer/start/scnvim/lua/scnvim/postwin.lua:134: Vim(mkview):E32: No file name                                     

The error suggests that the (post window) buffer does not have a name, are you perhaps using some kind of vim session handler plugin that tries to restore previously opened windows/buffers?

Ah... yes I am. I had this piece of code here to make vim remember folds between sessions:

augroup remember_folds
      autocmd!
      autocmd BufWinLeave * mkview
      autocmd BufWinEnter * silent! loadview
augroup END

changing to that solved the problem:

augroup remember_folds
    autocmd!
    autocmd BufWinLeave ?* mkview | filetype detect
    autocmd BufWinEnter ?* silent loadview | filetype detect
augroup END

thank you David!

best regards