Bug 350661 - Kate fails to indent block of text multiple times at once in vi mode
Summary: Kate fails to indent block of text multiple times at once in vi mode
Status: CONFIRMED
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (show other bugs)
Version: 16.04.1
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL: http://fratti.ch/bugdemos/kate/indent...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-27 14:07 UTC by Nicolas F.
Modified: 2021-11-07 09:31 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 Nicolas F. 2015-07-27 14:07:26 UTC
If in Vi mode, a visual selection of multiple lines is indented multiple times at once (i.e. :>>>), Kate crashes.

Reproducible: Always

Steps to Reproduce:
1. Activate vi input mode, write some text
2. Hit : followed by more than one >
3. Hit enter
Comment 1 Buovjaga 2016-06-25 14:46:27 UTC
Could you give more detailed instructions as I am not at all familiar with vi inputting, but would like to try and reproduce?
I'm asking, because I only managed to write :>>> in pure text after bashing on some keys for a while..
Comment 2 Nicolas F. 2016-06-26 22:08:22 UTC
The behaviour changed in recent versions, apparently. Instead of crashing, it now claims multiple indents are an invalid command.

1. i activates insert mode. hit i, write some text, multiple lines.
2. Then hit escape to leave insert mode.
3. Enter visual line selection mode by hitting Shift+V
4. Use the cursor or vi movement keys (h, j, k, l) to select multiple lines
5. Hit :
6. Hit > twice
7. Hit Enter

Note how it says unrecognised command now. In earlier versions, it would crash.

It can be worked around by instead of doing steps 5 to 7, simply typing the number of places to indent and >, e.g. "2>"
Comment 3 Buovjaga 2016-06-30 06:23:15 UTC
Thanks, now I reproduce.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm
Comment 4 kde.org 2021-11-07 09:31:27 UTC
Kate 21.08.2, I can confirm that it doesn't crash.
I can also confirm that the steps 1-7 in https://bugs.kde.org/show_bug.cgi?id=350661#c2 yield in '>>" unknown command.
Indenting one level using a single > in step 6 works.
The proposed workaround also works.
Not sure if any of the developers has the time and enthusiasm to look into fixing this if there are workarounds available. We'll see :-)