Bug 198367 - python indenter: indentation of def is wrong
Summary: python indenter: indentation of def is wrong
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: indentation (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2009-06-30 00:19 UTC by Pascal d'Hermilly
Modified: 2018-10-27 04:01 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal d'Hermilly 2009-06-30 00:19:33 UTC
Version:            (using KDE 4.2.90)
OS:                Linux
Installed from:    Ubuntu Packages

Kate indents automatically upon and when I press ctrl+z like other places, it does not unindent but completely remove my paste.

Reconstruction:
1 start new document
2 insert the following 7 lines(I hope the html doesn't kill it):
def move(oGalaxy,fG,fVmax,iXmax,iYmax):
    for i in oGalaxy:
        for j in oGalaxy:
            if(i!=j):
                fForce(i,j, oGalaxy,fG)            
    for i in oGalaxy:
        if testValidElement(i,fVmax,iXmax,iYmax)== false: oGalaxy.remove(i)
3 Select Tools menu ->indentation -> python
4 insert the following line on line 8 character 0:
def applyForce(elCalc,locEl,fG)
5 it indents to the if (even though it is obviously a new function), but the problem is that when I press ctrl+z it doesn't undo the automatic indentation(which is the behaviour otherwise), but delete the whole insertation.

Please tell me if this is gibberish, and I will try to explain it differently.
Comment 1 Pascal d'Hermilly 2009-06-30 00:20:46 UTC
By "insert" in the description, I mean copy-paste
Comment 2 Shriramana Sharma 2009-12-18 11:04:43 UTC
I understand what you are trying to say. You are saying that:

Just like in popular word processors like OpenOffice, you type sunday and it is autocorrected to Sunday, and if you press Ctrl + Z only the autocorrect is undone, 

similarly you see the automatic indenting as such an autocorrection, and want it to count as a separate item for the undo buffer and hence Ctrl + Z must undo only the autocorrect (autoindent in this case) and not the pasting operation.

I hope that clarifies it. I also confirm that this bug needs fixing on my KDE 4.3.2 system in Kubuntu Karmic Koala.
Comment 3 Dominik Haumann 2011-06-25 21:51:18 UTC
As workaround, you can disable the indentation of pasted text in the config page "Editing > Indentation > [ ] Adjust indentation of code pasted from the clipboard".
Comment 4 Dominik Haumann 2011-08-09 10:54:39 UTC
Can you please look into it in the file
kde4/apps/katepart/script/python.js

You can invoke F7 > "reload-scripts" to test all changes in the indenter. A patch would be very much welcome!
Comment 5 Christoph Cullmann 2012-10-28 16:21:14 UTC
Hi,

the indenter is a javascript which you can fix and provide a patch.

For docs see http://kate-editor.org/2009/10/29/extending-kate-with-scripts/

We have not the time nor expertise to maintain the indenters on our own. Please help out ;)
Reopen if a patch is around.
Comment 6 Andrew Crouthamel 2018-09-23 02:32:58 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Andrew Crouthamel 2018-10-27 04:01:02 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!