Skip to content

Incorrect indentation when using "{number}>" command #225

@Freezerburn

Description

@Freezerburn

Description of the bug

In visual selection mode with Vintage enabled, if you select multiple lines, then enter a number to have a command repeated, then use the ">" or "<" command to change indentation, only a single line from all the lines selected will be indented the selected number of times. All the other selected lines will only have their indentation changed by a single step. The line that has its indentation changed by multiple steps will be the line that was initially selected.

Steps to reproduce

  1. Open a file with multiple lines or put create multiple lines of whatever text you want.
  2. Press "V" (capital V) to select a whole line.
  3. Press "j" or "k" a number of times to select more than one line.
  4. Press "2"/"3"/etc.
  5. Press ">" or "<".

Expected behavior

Given a file that looks like:

a
a
a

If the cursor is on the first line, and the reproduction steps are followed to select the 2 lines below it then indent with repetition 2, the result should look like:

		a
		a
		a

Expected behavior was verified in VIM.

Actual behavior

Instead the file looks like:

		a
	a
	a

Sublime Text build number

4192

Operating system & version

macOS Tahoe 26.3.1 (a)

Additional information

This bug has existed for many years. I'm pretty sure the first version I used of Sublime Text 2 over a decade ago exhibited this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions