Here's a patch to normalize indent behaviour in KWrite part of KDevelop
mart.verburg at c2i.net
Mon Oct 7 17:05:18 UTC 2002
After the transit from KDEvelop 2.0 to 2.1, I was a bit annoyed by the new behaviour of my tab-key and of the indent function when entering a new line.
I'm used to working with tabs myself, and therefore switch on the tab-indent and autoindent functions of the editor. And then I expect:
1. when the tab-key is pressed, a tab is inserted at the cursor position
2. when enter is pressed, the text after the cursor is placed on a new line, and indented to the same indentation of the text on the old line. Tabs should be used to accomplish the bulk of the indent, and the rest if neccessary with spaces. Indenting to a diff'rent position might be desired to indent the line 'intelligently' within a block.
I was confronted with the following behaviour after installing KDevelop2.1 (with tab-indent and auto-indent switched on):
1. when the tab-key was pressed, the whole line got indented **with spaces!**
2. pressing enter caused the tekst on the newly created line to be indented **with spaces**
I've got nothing against people who use spaces instead of tabs (allthough I personally feel tabs are neeter), but it should be up to the user.
So I wrote a patch that restores the classic behaviour of the tab-key. Only exception is when tab-indent is switched off, when the tab-key is pressed, the whole line gets indented with spaces. Thus the tab-indent option causes use of real tabs when switched on. BTW this is also the behaviour of kate.
I ftp-ed the patch to
Concerning the 'intelligent' indenting behaviour: IMO that might be desirable, but here conventions should be taken into account, which complicated things a lot. I think poeple would be best off being able to set an option indicating if they like 'intelligent' indenting or not, and maybe they should then also be able to choose which indenting convention they like.
The patch serves it's purpose on my machine; I hope it can do the same for others. I have not tested it on any other machine.
kernel: 2.4.3-ac14 (trying to update to 2.4.18 as this patch was written)
distro: RedHat 7.0, partly updated to RH7.3 via bin-RPM's, except Glibc
"I found out why my car was humming. It had forgotten the words."
More information about the KDevelop-devel