On 03/21/2015 20:55, John Little wrote:
I agree now that it's wrong, and the syntax dash uses is weird. It appears
that the writer of those parts of the shell syntax highlighting was writing for
dash. But this is understandable since the ANSI C quoting style, though it
appeared in ksh93, has only recently (2013) been published by the open group,
and while I'm not a standards lawyer that publication seems not very official,
more de facto.
Since the syntax script supports the $'...' style for bash and ksh, it should
be easy to do so in posix mode too. Nevertheless, shell script syntax
highlighting is almost a Sisyphean task, and I'm very grateful that Dr Chip has
done it.
The attached patch fixes the problem. There are 3 lines there which
don't make sense to me. If g:is_posix is set, it enforces
b:is_kornshell=1 and undefs b:is_sh. So it only works when these lines
are removed, as in the patch.
I suggest, you add this patch.
Yuri
--
--
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/d/optout.
--- share/vim/vim74/syntax/sh.vim 2015-03-22 14:52:39.855896000 -0700
+++ share/vim/vim74/syntax/sh.vim 2015-03-22 15:30:29.506805000 -0700
@@ -54,9 +54,9 @@
" or "g:is_posix", a b:is_sh is converted into b:is_bash/b:is_kornshell,
" respectively.
if !exists("b:is_kornshell") && !exists("b:is_bash")
- if exists("g:is_posix") && !exists("g:is_kornshell")
- let g:is_kornshell= g:is_posix
- endif
+ "if exists("g:is_posix") && !exists("g:is_kornshell")
+ " let g:is_kornshell= g:is_posix
+ "endif
if exists("g:is_kornshell")
let b:is_kornshell= 1
if exists("b:is_sh")
@@ -246,7 +246,7 @@
syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
endif
syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
-if exists("b:is_bash")
+if exists("b:is_bash") || exists("b:is_sh")
syn region shCaseExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained
elseif !exists("g:sh_no_error")
syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
@@ -312,7 +312,7 @@
if exists("b:is_bash")
syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained
endif
-if exists("b:is_bash")
+if exists("b:is_bash") || exists("b:is_sh")
syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial
syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial
elseif !exists("g:sh_no_error")