Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 126 by [email protected]: [PATCH] Fix broken syntax highlighting for sh after runtime files update
http://code.google.com/p/vim/issues/detail?id=126

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 <[email protected]>
    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

Attachments:
        fix-sh-subcommand-syntax.patch  1.8 KB

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui