pvk7 / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

[PATCH] Fix broken syntax highlighting for sh after runtime files update #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I recently upgraded vim on Arch Linux which broke syntax highlighting of 
certain shell scripts. An example of such script:

    #!/bin/sh
    foo=$(cmd --arg)
    echo "$foo"

With 7.3.834-1, the syntax highlighting was fine. Since 7.3.875-1, the syntax 
highlighting was broken. Try it yourself:

    vim -u /dev/null +'syntax on' foo.sh

I bisected (git-remote-hg :-) ) it to:

    Author: Bram Moolenaar <bram@vim.org>
    Date: Tue Mar 19 11:35:58 2013 +0100

    Update runtime files.

This is a diff of the change to runtime/syntax/sh.vim
@@ -1,9 +1,10 @@
 shArithmetic
 shDeref
 shDerefSimple
+shEcho
 shEscape
 shNumber
-shOperator
+shOption
 shPosnParm
 shExSingleQuote
 shSingleQuote
@@ -16,4 +17,4 @@
 shTest
 shCtrlSeq
 shSpecial
-shCmdParenRegio
+shCmdParenRegion

shOption causes the invalid syntax highlighting here. The attached patch makes 
the `--` option stop at the closing parenthese too (seriously, who uses `--)`) 
anyway? It is a syntax error). Applied on top of 3.7.875, current workaround is 
to copy the file from /usr/share/vim/vim73/syntax/sh.vim into 
~/.vim/syntax/sh.vim and apply the patch.

Originally reported at https://bugs.archlinux.org/task/34523

Note, these changes somehow do not show up in the patches on ftp. Also, it 
stopped halfway applying due to 
https://groups.google.com/forum/#!topic/vim_dev/atNg4a30770

Original issue reported on code.google.com by lekenst...@gmail.com on 31 Mar 2013 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
+1 I can confirm this is still an issue with 7.3.1221 and this patch fixes it, 
thanks!

Original comment by randomen...@gmail.com on 20 Jun 2013 at 1:56

GoogleCodeExporter commented 9 years ago
Seems to be fixed. In any case, if you have problems with runtime files, please 
first bring up the issue with the maintainer of the file. He will then send 
updated files to Bram for inclusion. Closing for now.

Original comment by chrisbr...@googlemail.com on 30 Sep 2014 at 8:18