Bug 460769 - Python source file editing problems
Summary: Python source file editing problems
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-20 15:46 UTC by Alan Prescott
Modified: 2023-02-09 07:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Prescott 2022-10-20 15:46:01 UTC
Something of a vague summary, I know but editing Python sources seems to have gone slightly borked in the latest release. At least 2 things I have come across:-

Editing class triple-quoted documentation inserts one or more additional indents after Enter

Auto-indenting when inserting a Python snippet has been turned back on which makes an awful mess of inserting anything except the most trivial snippet. This was a feature I requested as a wishlist item and I was really pleased to see it implemented so having auto-indenting re-appear is rather annoying.

STEPS TO REPRODUCE
Snippets
1. Insert a multi-line Python snippet with it's own indenting

Triple-quoted class documentation
1. Edit triple quoted class documentation text, press Enter in text

OBSERVED RESULT
Snippets
1. Inserted snippet has additional indenting as if it had been typed by hand

Triple-quoted class documentation
1. Pressing Enter creates a new line indented from the previous line

EXPECTED RESULT
Snippets
Insert the snippet exactly as given or, by preference, all snippet lines preceded by an indent matching the first line.

Triple-quoted class documentation
On Enter, insert a new line indented the same as the previous line

Operating System: openSUSE Tumbleweed 20221019
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 6.0.2-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 7.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: LENOVO
Product Name: 81CT
System Version: Lenovo YOGA 730-13IKB
ADDITIONAL INFORMATION
Comment 1 Sven Brauch 2022-10-20 22:05:08 UTC
Moving to KTextEditor, this behaviour for sure got changed there.
Comment 2 Waqar Ahmed 2023-02-09 06:44:58 UTC
> Inserted snippet has additional indenting as if it had been typed by hand

This was changed 10 years ago IIUC, 

```
commit f51b5861e980ff4535aba8bd052dccd9fdfcf89e
Author: Sven Brauch <svenbrauch@googlemail.com>
Date:   Sun Sep 21 00:32:44 2014 +0200


Click To Show Commit In Tree View

    template handler: align inserted snippet to have proper indentation
```
Comment 3 Alan Prescott 2023-02-09 07:48:06 UTC
It may have been fixed 10 years ago but it returned.

Fixed again in Version 5.10.221202 (22.12.2) - OpenSUSE rpms