Bug 208762

Summary: Code Folding badly detects bash command 'dd if=[...]'
Product: [Applications] kate Reporter: aftertaf <david.wooffindin>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christian.loose, david.wooffindin, jangerrit
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description aftertaf 2009-09-28 11:42:32 UTC
Version:           4:4.3.1 (using KDE 4.3.1)
OS:                Linux
Installed from:    Ubuntu Packages

When using Kate to write bash scripts, I have encountered a problem that doesn't make Kate crash, but is an annoying 'feature' :)

I have a long script, and I like to use folding on my functions etc to see better...

When I have a function that uses the command "dd" . . . . the folding doesn't work.

the following line :
'dd if=/dev/sda of=/dev/sdb' for example . . .

just try Kate in 'bash' mode to reproduce...

the IF is seen as part of an if...fi nest.
When i Fold the function with this command, it folds to the end of the file . . .
It would be nice if Kate could 'see' the dd if and differenciate the input file option of dd from the start of an if-fi nest.

Thanks for reading,
David
Comment 1 Christoph Cullmann 2010-08-11 20:54:20 UTC
SVN commit 1162268 by cullmann:

Christian Loose <christian.loose@hamburg.de>:

BUG: 208762    
Fix highlighting of "if="-option of command dd in a bash file.


 U             bash.xml  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1162268
Comment 2 Jan Gerrit Marker 2011-01-22 14:23:32 UTC
The fix introduces a new bug:
Normally
if [ "y" = "x" ];
the [ would be highlighted.
Now you need to write
if  [ "y" = "x" ];
if you want the [ to be highlighted correctly.
Comment 3 Dominik Haumann 2011-08-13 19:18:22 UTC
Git commit 0cca7274a050c179b9443247cc89cc139020fc8e by Dominik Haumann.
Committed on 13/08/2011 at 21:15.
Pushed by dhaumann into branch 'master'.

dd: if does not need extra space before [

CCBUG: 208762
REVIEW: 102318

M  +2    -2    part/syntax/data/bash.xml

http://commits.kde.org/kate/0cca7274a050c179b9443247cc89cc139020fc8e
Comment 4 Dominik Haumann 2011-08-14 20:01:11 UTC
Git commit 938759858d7fc76d04135022eb90028dc42e49a0 by Dominik Haumann.
Committed on 14/08/2011 at 21:58.
Pushed by dhaumann into branch 'master'.

fix if statement with dd

applied the wrong patch accidently, thanks for noticing!
REVIEW: 102318
CCBUG: 208762

M  +2    -2    part/syntax/data/bash.xml

http://commits.kde.org/kate/938759858d7fc76d04135022eb90028dc42e49a0