Bug 490215 - Normal indentation mode should reset indentation on an empty line
Summary: Normal indentation mode should reset indentation on an empty line
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: indentation (show other bugs)
Version: 24.05.2
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-13 08:59 UTC by deadmeu
Modified: 2024-12-05 15:40 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 deadmeu 2024-07-13 08:59:03 UTC
SUMMARY
Using Normal indentation mode (enabled by default), if you have an indented line, and then insert one or many new blank lines, a following new line will always be automatically indented.

STEPS TO REPRODUCE
1. Configure Kate to use "Normal" indentation mode
2. In the editor, add an indentation, either by manually entering 2 or 4 whitespace characters, or by pressing tab
3. Press Enter, a new line should be added indented at the same level
4. Clear the indentation on the current line by deleting all characters on the current line
5. Press Enter, a new line should be added as in step #3 automatically indented at the initial level

OBSERVED RESULT
New lines are indented at the last known non-empty indentation level

EXPECTED RESULT
An empty line should clear the indentation level for future new lines

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.8-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Potentially conflicts with 417668 as I think a new, empty line should clear the indentation level. The reason for this, is that I often write (using KWrite) normal text with bullet points indented and need to separate lists with newlines, but it is annoying to have to clear out the indentations with each newline, e.g.:

First List:
    - Do this first thing
    - Second item in the list

<these newlines are always indented by default>

Second List:
    - First note
    - etc.

I think the current indentation preservation feature should only be applied when it is relevant, such as when writing Python code, rather than in empty text documents like it currently is.
Comment 1 Christoph Cullmann 2024-08-08 17:13:08 UTC
I am not sure that changing the default behavior is a good idea, if we do that, it should be optional. Help to add that is welcome.