Version: 3.3.5 (using KDE 3.5.5 "release 45.2" , openSUSE 10.2) Compiler: Target: x86_64-suse-linux OS: Linux (x86_64) release 2.6.18.2-34-default In this code: if ([ "" ] || [ "123" ]); then echo 123; fi The parser does not recognize the parenthesis before/after the command ("[ ]" in case) if not spaced as: if ( [ "" ] || [ "123" ] ); then echo 123; fi
I can confirm this, as with the other 2, reassigning to kate.
(Really reassing to the Kate guys.)
This bug is still present in kde 4.3
Moving to wish list status. All highlightings works with heuristics and will never be perfect. Perhaps somebody can provide a patch, therefor not closing it.
Still present in kde 4.8
Then please look into bash.xml and provide a fix... That would be awesome.
Hello Dominik, As you suggested, I'm trying to fix all the bugs I opened about bash syntax. Some of them I already fixed but I'm struggling with the parentheses. With multiple parentheses, I can have: (((exp)); cmd ) (((exp) exp )) (((cmd); cmd); cmd ) ((((exp) ))) For example, these are valid bash syntax: (( A + 1 )) (((1 > 2) )); echo $? ((((1 > 2) ))) ; echo $? ( ((1>2))); echo $? (( echo 123 ) | echo 1 ) How can I write a rule that matches correctly all these cases? I only know what the "((" means after I find a "))", so it is an expression, or when I find a single ")", so it is a subshell. I could use lookAhead with regexp but it does not solve the problem as I still can have internal parentheses, which regexp are not enough and I need to consume the string to get into the context. is there someway to have kate "rollback" to the previous context unconsumming the string used in this context and letting it check the next rule in the parent context? I.E: <context attribute="Normal Text" lineEndContext="#stay" name="FindCommands"> <Detect2Chars attribute="Keyword" context="ExprDblParen" char="(" char1="(" beginRegion="expression" /> <DetectChar attribute="Keyword" context="SubShell" char="(" beginRegion="subshell" /> (...) <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParen"> <Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression" /> <!-- ops... it wasn't an expression but a subshell --> <DetectChar attribute="Keyword" context="#rollback" char=")" endRegion="subshell" /> <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" /> <IncludeRules context="FindMost" /> </context> For example: (( echo 123 ) | echo 1 ) Matches (( in Detect2Chars@FindCommands and go to ExprDblParen echo 123 ) | echo 1 ) Matches "echo 123" in FindMost@ExprDblParen ) | echo 1 ) Matches ")" in DetectChar@ExprDblParen, rollback to FindCommands (( echo 123 ) | echo 1 ) Matches ( in DetectChar@FindCommands and go to SubShell I also though about improving FindMost to avoid detecting commands but echo>2 is both a valid expression and a valid command. I need some help :-)
Created attachment 70356 [details] Removed the limitation of bracket starting with line or space before. Added ")" as valid character after bracked Fix all those cases: echo |[[ true ]] echo |[ true ] if ([ true ]); then true fi if ([ true ] ); then true fi if ([[ true ]]); then true fi if ([[ true ]] ); then true fi if ( [[ true ]]); then true fi if ([ "" ] || [ "123" ]); then echo 123; fi
I still need help with "((true) )"
Dear user, this wish list item is now closed, as it wasn't touched in the last two years and no contributor stepped up to implement it. The Kate/KTextEditor team is very small and we can just try to keep up with fixing bugs. Therefore wishs that show no activity for two years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users. If you want your feature to be implemented, please step up to provide some patch for it. If you think it is really needed, you can reopen your request, but keep in mind, if no new good arguments are made and no people get attracted to help out to implement it, it will expire in two years again. We have a nice website kate-editor.org that provides all the information needed to contribute, please make use of it. For highlighting improvements our user manual shows how to write syntax definition files. Greetings Christoph