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:

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
Bash highlight works as before.
9.0.1275, build from the lastest source
OS: Ubuntu 22.10
Terminal: Alacritty, build from the latest source
$TERM: alacritty
shell: fish, version 3.6.0
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
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.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
Closed #11937 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
@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.![]()
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.![]()
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.![]()
@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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@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.![]()
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.![]()
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.![]()