| Summary: | syntax highlighting for zsh is broken with a mathematical expression in a substring expression | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Jonathan Poelen <jonathan.poelen> |
| Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 5.31.0 | ||
| Target Milestone: | --- | ||
| Platform: | Kubuntu | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/syntax-highlighting/8947f5f06611503f802b1a5a285bf33b12ea02a4 | Version Fixed/Implemented In: | 5.37 |
| Sentry Crash Report: | |||
I suggest replacing
<RegExpr attribute="Variable" context="VarBrace" String="\$\{&varname;" />
with
<RegExpr attribute="Variable" context="VarBrace" String="\$\{#?&varname;" />
Implemented here:
https://github.com/jonathanpoelen/syntax-highlighting/commit/f08aa02684017668738c8e8da7e64aef6100a5b5
Git commit 8947f5f06611503f802b1a5a285bf33b12ea02a4 by Dominik Haumann. Committed on 21/07/2017 at 17:56. Pushed by dhaumann into branch 'master'. zsh highlighting: Fix math expression in a substring expression Thanks to Jonathan Poelen for the initial patch. In addition, we now also have a small unit test, taken from http://zshwiki.org/home/examples/hardstatus FIXED-IN: 5.37 A +66 -0 autotests/folding/test.zsh.fold A +73 -0 autotests/html/test.zsh.html A +66 -0 autotests/input/test.zsh A +66 -0 autotests/reference/test.zsh.ref M +2 -2 data/syntax/zsh.xml https://commits.kde.org/syntax-highlighting/8947f5f06611503f802b1a5a285bf33b12ea02a4 |
In the following zsh expression: ${str:$((${#a[1]}+1))} The syntax highlighting is broken from '+' to the end of the document.