[vim/vim] Bash Syntax HighLight error (Issue #11969)

20 views
Skip to first unread message

A4-Tacks

unread,
Feb 10, 2023, 6:14:31 PM2/10/23
to vim/vim, Subscribed

Steps to reproduce

a=$'\e'
echo "${a@Q}"
Screenshot_20230211_070940

Expected behaviour

"@q" This section is not marked as an error, which is bash's allowed syntax, which you can find in its manual

Version of Vim

8.2.4919

Environment

Os: Ubuntu 22.04
Shell: Bash-5.1.16

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/11969@github.com>

cecamp

unread,
Feb 10, 2023, 7:13:05 PM2/10/23
to vim/vim, Subscribed

I'm afraid that I haven't seen that syntax before and the bash manual is quite large. Please elucidate on what its supposed to do. When I ran your code snippet, I got line 3: ${a@Q}: bad substitution (I have a #! /bin/bash on top).


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/11969/1426516273@github.com>

errael

unread,
Feb 11, 2023, 1:23:22 AM2/11/23
to vim/vim, Subscribed

Under Parameter Expansion

       ${parameter@operator}

              Parameter transformation.  The expansion is either a transformation of the value of

              parameter or information about parameter itself, depending on the value  of  opera‐

              tor.  Each operator is a single letter:



              U      The  expansion is a string that is the value of parameter with lowercase al‐

                     phabetic characters converted to uppercase.

              u      The expansion is a string that is the value  of  parameter  with  the  first

                     character converted to uppercase, if it is alphabetic.

              L      The  expansion is a string that is the value of parameter with uppercase al‐

                     phabetic characters converted to lowercase.

              Q      The expansion is a string that is the value of parameter quoted in a  format

                     that can be reused as input.

              E      The  expansion is a string that is the value of parameter with backslash es‐

                     cape sequences expanded as with the $'...' quoting mechanism.

              P      The expansion is a string that is the result of expanding the value  of  pa‐

                     rameter as if it were a prompt string (see PROMPTING below).

              A      The  expansion is a string in the form of an assignment statement or declare

                     command that, if evaluated, will recreate parameter with its attributes  and

                     value.

              K      Produces a possibly-quoted version of the value of parameter, except that it

                     prints the values of indexed and associative arrays as a sequence of  quoted

                     key-value pairs (see Arrays above).

              a      The expansion is a string consisting of flag values representing parameter's

                     attributes.



              If parameter is @ or *, the operation is applied to each  positional  parameter  in

              turn,  and  the expansion is the resultant list.  If parameter is an array variable

              subscripted with @ or *, the operation is applied to each member of  the  array  in

              turn, and the expansion is the resultant list.



              The  result of the expansion is subject to word splitting and pathname expansion as

              described below.


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

Theodor

unread,
Feb 13, 2023, 5:11:31 AM2/13/23
to vim/vim, Subscribed

I'm afraid that I haven't seen that syntax before and the bash manual is quite large. Please elucidate on what its supposed to do. When I ran your code snippet, I got line 3: ${a@Q}: bad substitution (I have a #! /bin/bash on top).

good
bad
Syntax highlighting broke after updating to version 9.0.1302. Rolled back to version 9.0.1182 archlinux.


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/11969/1427669653@github.com>

K.Takata

unread,
Feb 13, 2023, 5:38:02 AM2/13/23
to vim/vim, Subscribed

@TAforever I think it's another issue. See #11937.


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/11969/1427711135@github.com>

Theodor

unread,
Feb 13, 2023, 5:53:27 AM2/13/23
to vim/vim, Subscribed

@TAforever I think it's another issue. See #11937.

@k-takata Thank you! problem solved


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/11969/1427729379@github.com>

Rain

unread,
Feb 20, 2023, 11:10:00 PM2/20/23
to vim/vim, Subscribed

I also have the same problem
image


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/11969/1437833737@github.com>

errael

unread,
Feb 20, 2023, 11:31:34 PM2/20/23
to vim/vim, Subscribed

I also have the same problem

@scrawld Same problem as what? This issue is about echo "${a@Q}", and fixed as indicated in #11937


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/11969/1437844661@github.com>

Jakub Wilk

unread,
Mar 6, 2023, 5:15:11 AM3/6/23
to vim/vim, Subscribed

Duplicate of #10551.


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/11969/1455850203@github.com>

Christian Brabandt

unread,
Mar 6, 2023, 5:30:28 AM3/6/23
to vim/vim, Subscribed

this seems to be fixed by dd60c36#diff-650e28e4ad6a5c9241345580a7136ff18b5629f3b4910a5b5a455828bca5e517


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/11969/1455874443@github.com>

Christian Brabandt

unread,
Mar 6, 2023, 5:30:28 AM3/6/23
to vim/vim, Subscribed

Closed #11969 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/11969/issue_event/8672609083@github.com>

Reply all
Reply to author
Forward
0 new messages