Bug 449186

Summary: Extglob patterns break Bash syntax highlighting
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: mixo <mixosaurus+bugskde>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: jonathan.poelen, walter.von.entferndt
Priority: NOR    
Version: 5.90.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=430668
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description mixo 2022-01-26 10:10:29 UTC
SUMMARY
Extglob patterns break the parsing. Everything following a string expansion with an extglob pattern is highlighted as "string" (in red) or "normal text" (in black). 

STEPS TO REPRODUCE
1. open a shell file
2. notice highlighting problems

OBSERVED RESULT
```
# in quotes
"${var#lo+(r)em}"
# everything that follows is treated as "string" (red)
```

and

```
# without quotes
${var#lo+(r)em}
# everything that follows is treated as "normal text" (black)
```

It happens with all extglob patterns: ?(...), *(...), +(...), @(...), !(...)

EXPECTED RESULT
The third line in both examples should be treated as a comment (light grey).

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Follow-up on bug #430668.