Bug 503243 - Kate Indentation seems broken
Summary: Kate Indentation seems broken
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: indentation (other bugs)
Version First Reported In: 23.08.5
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-23 16:57 UTC by Bea
Modified: 2025-08-14 19:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.