Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Aug 18, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

+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
Copy link
Author

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant