Created attachment 170102 [details] shell file that demonstrates highlighting issue when opened in kate *** If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** SUMMARY I have attached an example shell file for which syntax highlighting is broken, but the shell is valid. Note the breakage seems to occur because of an escaped line break inside a conditional statement causing a leading double quote that appears to be escaped instead of the end of line. STEPS TO REPRODUCE 1. Open the attached example in Kate or Kwrite 2. Observe the syntax highlighting OBSERVED RESULT The start of the string in the second half of the conditional appears to be escaped leading to incorrect syntax highlighting for the rest of the file. EXPECTED RESULT The escape character should be applied to the end-of-line instead of the double quote. SOFTWARE/OS VERSIONS Tested with Kate 23.08.1 on a custom distro. I can try again on Kubuntu 24.04 when I get home. ADDITIONAL INFORMATION
Created attachment 170104 [details] Screenshot that includes both the observed behavior and the kate version information.
It reproduces on Kate 23.08.5
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/652
Git commit 1395988e39b59c8734e0291578fa9d6f98e160e8 by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 22/08/2024 at 15:52. Pushed by cullmann into branch 'master'. Bash: fix escaped line in brace condition M +10 -0 autotests/folding/highlight.sh.fold M +10 -0 autotests/html/highlight.sh.dark.html M +10 -0 autotests/html/highlight.sh.html M +10 -0 autotests/input/highlight.sh M +10 -0 autotests/reference/highlight.sh.ref M +23 -7 data/syntax/bash.xml https://invent.kde.org/frameworks/syntax-highlighting/-/commit/1395988e39b59c8734e0291578fa9d6f98e160e8