Bug 413626 - Bash string highlighting problems
Summary: Bash string highlighting problems
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 5.63.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-30 10:04 UTC by James McIntosh
Modified: 2025-05-18 17:50 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Bash highlighting example (1.26 KB, application/x-shellscript)
2019-10-30 10:04 UTC, James McIntosh
Details
Not sure if this is related but an example of a bad highlighting in kate just in case. May help you narrow down the problem. (23.38 KB, image/png)
2020-08-05 12:00 UTC, Miklos Karacsony
Details
Another example (40.91 KB, image/png)
2020-08-05 12:02 UTC, Miklos Karacsony
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James McIntosh 2019-10-30 10:04:28 UTC
Created attachment 123586 [details]
Bash highlighting example

Strings within braces will cause problems if there is a space.

xxx${"{"}xxxxxx${"}"}xxx # This works
xxx${"{"}xxx xxx${"}"}xxx # Highlighting error

OBSERVED RESULT
String highlighting will continue, overriding other styles. 

SOFTWARE/OS VERSIONS
KDE neon: 5.17 
KDE Plasma Version: 5.17.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
See attachment
Comment 1 Anders Ponga 2020-01-26 20:40:56 UTC
After messing around for a bit I discovered that commenting out this line:

<RegExpr attribute="Escape" context="BraceExpansion" String="\{(?=(\\[ \{\}]|[^\s\{\}]|\{(\\[ ]|\S)*\})+\})"

fixes this issue. 
That line comes from a patch which fixes https://bugs.kde.org/show_bug.cgi?id=387915
Comment 2 Anders Ponga 2020-01-26 21:16:50 UTC
(In reply to Anders Ponga from comment #1)
> After messing around for a bit I discovered that commenting out this line:
> 
> <RegExpr attribute="Escape" context="BraceExpansion" String="\{(?=(\\[
> \{\}]|[^\s\{\}]|\{(\\[ ]|\S)*\})+\})"
> 
> fixes this issue. 
> That line comes from a patch which fixes
> https://bugs.kde.org/show_bug.cgi?id=387915

After checking I confirmed that this bug is present before that patch.
Comment 3 Anders Ponga 2020-01-27 11:15:15 UTC
(In reply to Anders Ponga from comment #2)
> (In reply to Anders Ponga from comment #1)
> > After messing around for a bit I discovered that commenting out this line:
> > 
> > <RegExpr attribute="Escape" context="BraceExpansion" String="\{(?=(\\[
> > \{\}]|[^\s\{\}]|\{(\\[ ]|\S)*\})+\})"
> > 
> > fixes this issue. 
> > That line comes from a patch which fixes
> > https://bugs.kde.org/show_bug.cgi?id=387915
> 
> After checking I confirmed that this bug is present before that patch.

Disregard my nonsense. I have no idea what's going on.
Comment 4 Nibaldo G. 2020-02-12 11:31:45 UTC
I have tried to fix this, but I need more knowledge in Bash, since there is no simple solution, we must change the way it stands out in content within the braces ${...}.

I have also seen that this bug is present in more text editors such as Atom, Visual Studio Code and Sublime Text.
Comment 5 Jonathan Poelen 2020-03-15 01:51:42 UTC
Is the syntax ${"..."} really valid? I don't see anything like it in the manual.
Comment 6 Miklos Karacsony 2020-08-05 12:00:59 UTC
Created attachment 130659 [details]
Not sure if this is related but an example of a bad highlighting in kate just in case. May help you narrow down the problem.
Comment 7 Miklos Karacsony 2020-08-05 12:02:01 UTC
Created attachment 130660 [details]
Another example
Comment 8 Jonathan Poelen 2025-05-18 17:50:27 UTC
I'm closing this issue because the syntax indicated by the author is not valid in bash or ksh and he doesn't give more context.

The images added by Miklos correspond to a real bug, but it has nothing to do with this bug and there has already been a fix several years ago.