filestyle
filestyle copied to clipboard
[BUG]: Error E315 if 'splitbelow' option is set.
When using the splitbelow
option, I get strange Vim internal errors (E315), for each line, when opening a help topic.
How to reproduce (minimal vimrc - I use vim-plug
as plugin manager):
set nocompatible
filetype off
call plug#begin('~/.vim/plugged')
Plug 'aserebryakov/filestyle'
call plug#end()
filetype plugin indent on
syntax on
set splitbelow
The errors look like:
:h syntax.txt
E315: ml_get: invalid lnum: 5319
E315: ml_get: invalid lnum: 5318
...
E315: ml_get: invalid lnum: 1
I suspect the wincmd w
commands are to blame, but I don't know how to change them.
Thanks for the plugin!
How critical issue is?
The issue is confirmed (Vim 7.4 for Windows + Pathogen).
How critical issue is?
It's not critical, in that I can disable set splitbelow
. It is critical, if you consider that set splitbelow
is a standard Vim option that anyone should be able to use. In any case, thanks for confirming the issue.
Perhaps - just give an option not to hook/autocmd FileStyle...
operations to any buffer by default, and allow/advice users how to do it selectively instead (only for their preferred filetypes)? Hooking to VimEnter
etc. by default is a little intrusive. Or: avoid 'help', unlisted, or even all read-only buffers, if that's the only place where the bug appears? (just suggestions, if useful)
I tried to reproduce the issue on Ubuntu version. It gives another error:
E434: Can't find tag pattern
I can make it happen (E315) on both Win7 x64 and ArchLinux (Vim 7.4, included patches 1-729).
I have the same problem and it's actually quite annoying. Similar to VanLaser, I'm also on Arch and use vim-plug. Another observation here is, that Local Additions
in the help root file is empty now.
Is there anything I can do to further help / debug this issue?
In general, errors like E315
may mean bug in Vim itself, but anyway I will try to find workaround as soon as possible.
@VanLaser, @dennishamester , can you please provide me the .vim
and .vimrc
to reproduce the issue in your environment?
~~@VanLaser, @dennishamester, can you please check the following workaround:~~
~~Comment the wincmd w
in the FileStyleDeactivate()
function.~~
~~It looks like it fixes the issue in Windows.~~
Commenting wincmd w
in FileStyleDeactivate()
totally breaks NerdTree
.
After a quick test, it seems to work like this:
if !&splitbelow
wincmd w
endif
(if I comment wincmd w
unconditionally, I get the original error when option splitbelow
is NOT set.
An alternative way (safer?) could be, perhaps, to save the splitbelow
option value, unset it temporarily, run wincmd w
, then set it back to the saved value, all those in a wrapper function, instead of the simple wincmd w
command. Not tested, though, it may be too late to unset the option at that point.
@VanLaser, as I mentioned before it can break NERDTree
.