[vim/vim] sh/bash high light broken since upgrade to sh.vim version 205 (Issue #11937)

352 views
Skip to first unread message

Illia Bobyr

unread,
Feb 3, 2023, 12:54:48 AM2/3/23
to vim/vim, Subscribed

Steps to reproduce

Latest upgrade of the runtime files brought in sh.vim version 205.
Unfortunately, it seems to be breaking sh/bash syntax highlight pretty badly for me.

On the left is sh.vim version 204, on the right is sh.vim version 205:
image

I was writing a few scripts, and every time, after a second or third command, the highlight was switching into shCmdSubRegion, covering everything.
On the picture that happened in line 3, and line 4 and below is all highlighted green.

Here is the test case from the picture:

#!/bin/bash

for name in {1..3}; do
  echo "$name"
done

Expected behaviour

Bash highlight works as before.

Version of Vim

9.0.1275, build from the lastest source

Environment

OS: Ubuntu 22.10
Terminal: Alacritty, build from the latest source
$TERM: alacritty
shell: fish, version 3.6.0

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937@github.com>

Derek Schrock

unread,
Feb 5, 2023, 5:25:24 PM2/5/23
to vim/vim, Subscribed

The issue appears to be https://github.com/vim/vim/blob/master/runtime/syntax/sh.vim#L338

The start value \$(\ze[^(]\|$

Mainly \|$

An sh command sub. starts with an EOL or $( followed by possible multi-lines of characters that are not ). EOL doesn't seem to make sense here? Don't know if grouping the [^)] and |$ was expected here or if it's just a mistake. Removing and grouping seems to fix it.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1418281554@github.com>

Derek Schrock

unread,
Feb 5, 2023, 5:37:49 PM2/5/23
to vim/vim, Subscribed

grouping the non-) and EOL appears to be what is needed here?

\$(\ze\([^(]\|$\)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1418284068@github.com>

chdiza

unread,
Feb 7, 2023, 1:13:45 AM2/7/23
to vim/vim, Subscribed

@cecamp


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1420253040@github.com>

chdiza

unread,
Feb 7, 2023, 1:16:12 AM2/7/23
to vim/vim, Subscribed

Even the below shows the brokenness:

export PATH
###
export PATH
#everything afer the hashes is colored as shCmdSubRegtion  for some reason


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1420255010@github.com>

cecamp

unread,
Feb 7, 2023, 12:06:28 PM2/7/23
to vim/vim, Subscribed

Closed #11937 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/11937/issue_event/8460295517@github.com>

cecamp

unread,
Feb 7, 2023, 12:06:28 PM2/7/23
to vim/vim, Subscribed

I've submitted the fixed syntax/sh.vim to Bram already. You can also get it from my website.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1421116531@github.com>

K.Takata

unread,
Feb 20, 2023, 11:49:26 PM2/20/23
to vim/vim, Subscribed

@brammool
Could you include the latest version of sh.vim soon? Many people have reported this error.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1437853534@github.com>

Bram Moolenaar

unread,
Feb 22, 2023, 9:41:59 AM2/22/23
to vim/vim, Subscribed

I have recently updated runtime files, but it appears that @cecamp did not send me an update for "sh.vim".
Now I'm not sure what version should be included, thus I'll await what Charles sends me.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1440154372@github.com>

Nickolas Kraus

unread,
Feb 23, 2023, 4:26:33 PM2/23/23
to vim/vim, Subscribed

In the meantime,

$ mkdir -p ~/.vim/syntax
$ curl -s -H 'Accept-encoding: gzip' http://www.drchip.org/astronaut/vim/syntax/sh.vim.gz | gzip -d > ~/.vim/syntax/sh.vim


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1442453014@github.com>

Derek Schrock

unread,
Feb 23, 2023, 7:02:42 PM2/23/23
to vim/vim, Subscribed

@cecamp please work with @brammool to get the correct file in the repo.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1442595540@github.com>

Bram Moolenaar

unread,
Feb 25, 2023, 6:57:24 AM2/25/23
to vim/vim, Subscribed

Turns out that Charles did send me the new file, but it ended up in my spam folder.
It will be included with the next runtime files update.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1445064861@github.com>

Patrick Fay

unread,
Apr 4, 2023, 7:03:33 PM4/4/23
to vim/vim, Subscribed

From nickolas' message, I couldn't get the file from drchip but I was able to get it from the commit above from albertyw's github instead, this fixed it for me

mkdir -p ~/.vim/syntax
curl https://raw.githubusercontent.com/albertyw/dotfiles/e787d02d754883d02021811421906ce861a3b993/files/vim/syntax/sh.vim > ~/.vim/syntax/sh.vim


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1496704632@github.com>

Illia Bobyr

unread,
Apr 4, 2023, 7:37:53 PM4/4/23
to vim/vim, Subscribed

From nickolas' message, I couldn't get the file from drchip but I was able to get it from the commit above from albertyw's github instead, this fixed it for me

mkdir -p ~/.vim/syntax
curl https://raw.githubusercontent.com/albertyw/dotfiles/e787d02d754883d02021811421906ce861a3b993/files/vim/syntax/sh.vim > ~/.vim/syntax/sh.vim

Why do you still need it?
It has been fixed on mater a while ago.
If you want to update just sh.vim, but not the rest of your runtime, you can get the latest version from the vim repo:


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1496725642@github.com>

Nickolas Kraus

unread,
Apr 5, 2023, 11:03:49 AM4/5/23
to vim/vim, Subscribed

http://www.drchip.org (the source of the original sh.vim file) is no longer available.

Regardless, this is no longer needed. Upgrade to Vim 9.0.1400.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1497643417@github.com>

Shane-XB-Qian

unread,
Apr 5, 2023, 12:13:49 PM4/5/23
to vim/vim, Subscribed

no longer available.

wow........ what happened..?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1497765533@github.com>

Nick Jensen

unread,
Apr 5, 2023, 4:18:05 PM4/5/23
to vim/vim, Subscribed

Yes it is: http://www.drchip.org/astronaut/vim/


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1498077079@github.com>

Gary Johnson

unread,
Apr 5, 2023, 4:32:11 PM4/5/23
to reply+ACY5DGFZJLOJUFZVHP...@reply.github.com, vim...@googlegroups.com
On 2023-04-05, Nick Jensen wrote:
> Yes it is: http://www.drchip.org/astronaut/vim/

That page exists, but all the links to his scripts fail with error
404.

Regards,
Gary

vim-dev ML

unread,
Apr 5, 2023, 4:32:28 PM4/5/23
to vim/vim, vim-dev ML, Your activity


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11937/1498116182@github.com>

K.Takata

unread,
Apr 6, 2023, 1:08:17 AM4/6/23
to vim/vim, vim-dev ML, Comment

@cecamp said (#12150 (comment)):

Unfortunately my email is seriously broken at the moment, and I'm gone until next week. My website is down, too,


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/11937/1498498760@github.com>

Bram Moolenaar

unread,
Apr 21, 2023, 5:36:52 PM4/21/23
to vim...@googlegroups.com, K.Takata

> @cecamp said (https://github.com/vim/vim/pull/12150#issuecomment-1471211650):
>
> > Unfortunately my email is seriously broken at the moment, and I'm
> > gone until next week. My website is down, too,

The website has been restored and Charles did send me a few updates.
It will take time before he caught up with everything though.
I will send out a runtime files update as soon as my inbox isn't too
full (it's slowly getting less full now).

--
ARTHUR: If you do not open these doors, we will take this castle by force ...
[A bucket of slops land on ARTHUR. He tries to retain his dignity.]
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

cecamp

unread,
Apr 21, 2023, 10:41:28 PM4/21/23
to vim/vim, vim-dev ML, Comment

sh.vim is up to v208, and my website is back up, so you should be able to get it: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH . If that still doesn't do the trick, let me know.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/11937/1518479373@github.com>

edgeworthe

unread,
Apr 29, 2023, 12:17:00 PM4/29/23
to vim/vim, vim-dev ML, Comment

This issue seems to have been deployed to macOS—I see version 205 in /usr/share/vim/vim90/syntax/sh.vim running Ventura 13.3.1, but I think the config was included as part of Xcode 14.3

Solution in this earlier reply works ok, or switching to a brew-installed vim would probably fix it as well


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: <vim/vim/issues/11937/1528822240@github.com>

Reply all
Reply to author
Forward
0 new messages