Bug 503243

Summary: Kate Indentation seems broken
Product: [Applications] kate Reporter: Bea <beawolf>
Component: indentationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: waqar.17a
Priority: NOR    
Version First Reported In: 23.08.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Bea 2025-04-23 16:57:53 UTC
SUMMARY


STEPS TO REPRODUCE
1. Create an XML file, e.g.
<?xml version="1.0" encoding="utf-8">
2. Save it and re-open it, check that Extra - Mode is set to XML
3. Start typing XML code, e.g.
<foo>
<bar>
<two>
</two>
</bar>
</foo>

OBSERVED RESULT
Kate indents the newly added text as
<foo>
	<bar>
	<two>
	</two>
	</bar>
	</foo>


EXPECTED RESULT
In previous versions (in my case before upgrading from Kubuntu 22.04 to 24.04), Kate idented the new lines correctly as per XML standard as
<foo>
	<bar>
		<two>
		</two>
	</bar>
</foo>


SOFTWARE/OS VERSIONS
Kubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13

ADDITIONAL INFORMATION

The same issues shows when using Selection - Indent (was previously Extra - Auto-Indentation or something like that) on an un-idented text. The un-idented text is now idented to
<?xml version="1.0" encoding="utf-8">

<foo>
	<bar>
	<two>
</two>
</bar>
</foo>
instead of the expected
<foo>
	<bar>
		<two>
		</two>
	</bar>
</foo>

I also tried the most recent AppImage from https://cdn.kde.org/ci-builds/utilities/kate/master/linux/ (version 25.07.70) and it shows the same issue.
Comment 1 Waqar Ahmed 2025-08-14 19:17:08 UTC
Can't reproduce. You probably have the indentation set to cstyle or something else, (maybe you have .kateconfig file in one of the parent directory?). Change the indentation to xml and then retry. It can be changed from MainMenu -> Tools -> Indentation.