Bug 339676

Summary: kate version 3.13.3 doesn't clean indentation for bash
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Marko Käning <mk-lists>
Component: indentationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WAITINGFORINFO    
Severity: normal CC: christoph, some-things2
Priority: HI    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Marko Käning 2014-10-04 20:09:55 UTC
kate doesn't perform a clean indentation for bash scripts, as it seems

Reproducible: Always

Steps to Reproduce:
1) Create this bash script:
---
#!/bin/bash
if [ "$1" == "this" ]; then
    echo "Please"
  echo "align"
echo "this!"
fi
---

2) Click "Tools/Clean Indentation"

Actual Results:  
No change to indentation made by kate

Expected Results:  
One might expect some alignment of the code block in between "if" and "fi", so that all three echos end up starting in one column like this:
---
#!/bin/bash
if [ "$1" == "this" ]; then
    echo "Please"
    echo "align"
    echo "this!"
fi
---

Did I misunderstand the concept of "clean indentation"?
Comment 1 Dominik Haumann 2014-10-05 16:57:09 UTC
Confirmed, "Clean Indentation" does not work, neither if no text is selected, nor if text is selected. This is a regression.
Comment 2 Marko Käning 2014-11-19 22:54:07 UTC
No news here?
Comment 3 Grod 2015-11-26 14:45:22 UTC
This is still happening in Kate: 3.14.7
 :(
Comment 4 Christoph Cullmann 2018-08-17 21:16:05 UTC
Yep, broken.
Patches welcome.
Comment 5 Christoph Cullmann 2022-09-24 21:29:27 UTC
Hi, without somebody providing some patch, this will not happen.

https://kate-editor.org/join-us/

If somebody is able to contribute something, thanks!