Closed realtradam closed 2 years ago
Hi, there.
I speculate what could be happening is the plugin doesn't initialise until
You're right. There was a timer to enable fold, which I removed to support mkview/loadview. https://github.com/leafOfTree/vim-vue-plugin/commit/a8decb75b1125c64cf132486c828d8fceffdb05f
and the resulting error: Error detected while processing ...
I think the error is because the autocmds matches those saved view
files. And filetype detect
will make vim become slow.
Therefore, I recommend you try the setup below, as shown in the help :h loadview
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
Thank you for the quick reply, and thanks for making and maintaining this awesome plugin!
I have updated the plugin with :PlugUpdate
as well as changing the autocmd
to the ones you recommended but I still get that same E490: No fold found
error.
I have also forgotten to mention in my original issue that I use Neovim so I apologise for that, however I have now tested this with Vim using the file I pasted below and the same E490
error happens. I have also tried deleting the vim-vue-plugin directory and reinstalling to no avail.
I checked both vim & nvim and ends up with autocmd
below, which should suppress those error messages. Please note the ?
and !
added.
autocmd BufWinLeave ?* mkview
autocmd BufWinEnter ?* silent! loadview
I also wonder, are the folds kept across buffers after you updated this plugin? If not, what kind of buffer filenames doesn't it work for?
I'm closing this issue. Feel free to reopen it if any questions.
I have an
augroup
set up that automatically saves and loads the cursor position as well as which folds were open/closed whenever I enter and leave a buffer. Saving the view this way works with this plugin, as well as manually loading the view with the command:loadview
but trying to use an autocmd to load this view fails where other filetypes would not. Here is a basic vimrc with VimPlug where this happens:and the resulting error:
Note that the first time you open a file it is expected to fail, as you have not saved a view yet, but on any subsequent opening of the buffer it should be able to load the view but vue files with this plugin do not(unless called manually with
:loadview
after the file is open). I speculate what could be happening is the plugin doesn't initialise until after the autocmd is called so vim doesnt yet understand how to apply the folds. This would explain why the manually calling:loadview
works and why the view can be saved with autocmd. I have tried setting up theautocmd
with various different "groups" but all of them yielded the same error.Sadly this means that whenever I
switchload buffers all the folds are reset and are closed.