riv.vim icon indicating copy to clipboard operation
riv.vim copied to clipboard

sync: line continuations pattern specified twice

Open mrschyte opened this issue 10 years ago • 8 comments

Opening an rst file with vim gives the following error:

Messages maintainer: Bram Moolenaar <[email protected]>
"test.rst" 0L, 0C
Error detected while processing /usr/share/vim/vim74/syntax/vim.vim:
line  748:
E403: syntax sync: line continuations pattern specified twice
Press ENTER or type command to continue

mrschyte avatar Jun 14 '14 16:06 mrschyte

From the message above, seems it's the vim's syntax file's error.

Is there any code directives (.. code:: xxx)in your rst file.

Can you reinstall vim to see if the problem still exists?

gu-fan avatar Jul 11 '14 08:07 gu-fan

I've reinstalled vim to no effect. The message is shown even when opening a new, empty rst file. I noticed that, however with the older version available on vim.org the problem seems to go away. Note, that I'm using archlinux and it has two different packages for gvim and vim. Using the vim package works, but the gvim one drops the error message. It may be a bug in that specific package.

From the readme of the vim.org version:

:Author: Rykka G.F
:Update: 2012-10-16
:Version: 0.74 
:Github: https://github.com/Rykka/riv.vim

mrschyte avatar Jul 11 '14 09:07 mrschyte

That's right , I previously using archlinux, And have met some issues like this.

I will check the older version of riv.vim 's syntax file from vim.org, Thanks~

gu-fan avatar Jul 11 '14 09:07 gu-fan

The same issue happens with the vim installation on Ubuntu 14.04. I found out that the vim-runtime package on Ubuntu is bundled with an older version of the syntax/rst.vim file from 2013 by Nicolai Weibull. So, the syntax rules for restructuredText files are loaded twice.

  1. <vim-runtimepath>/syntax/rst.vim
  2. ~/.vim/after/syntax/rst.vim

The script ~/.vim/syntax/rst.vim won't be parsed as it is guarded by the b:current_syntax variable.

My solution: I deleted the (deprecated) /usr/share/vim/vim74/syntax/rst.vim to "solve" the problem and get rid of the error message.

@Rykka : A better solution working for everyone might be a guard in the after/syntax/rst.vim file. However, such a guard needs to be activated in syntax/rst.vim. I do not know if that leads to problems elsewhere...?

mdrohmann avatar Nov 19 '14 23:11 mdrohmann

@mdrohmann. Thanks, You are right. can you paste the older version here or in a gist?

gu-fan avatar Nov 20 '14 02:11 gu-fan

@Rykka Here is a gist of the old syntax file on Ubuntu 14.04.

mdrohmann avatar Nov 20 '14 19:11 mdrohmann

I hit the same error:

Error detected while processing /usr/share/vim/vim74/syntax/vim.vim:

just started appearing as a problem for me because I was restricting riv.vim's loading via vim-plug's for option (which lazy-loads based on via filetype; eg Plug 'Rykka/riv.vim', { 'for': 'rst' }). Removing this restriction stops the error, but I looked into what was causing it. See the linked issue at https://github.com/junegunn/vim-plug/issues/410.

May or may not be the same cause for the original issue, but either way, after/syntax/rst.vim was being loaded twice in my case.

davidjb avatar Feb 17 '16 01:02 davidjb

@davidjb nice =]

tony avatar Oct 16 '17 00:10 tony