Skip to content

Enhance Shift-Tab key function #284

Open
@PropGit

Description

@PropGit

Background
[This operation is the complement of the Tab key (issue #283)]
Issues #88, #112, #121 led to the current implementation of the Shift-Tab key's function in source, which functions like Ctrl/Cmd-[ (mapped to indentLess) for both single line and multiple selected lines.

However, that's not the exact implementation we intended for Shift-Tab.

Demonstration of Intent of Shift-Tab

Single Line With or Without Selection
With cursor in any position on a line (with no selection), or when there's a selection within any part of a single line, pressing the Shift-Tab keys once results in one or more space characters being removed from the point just left of the cursor, or just left of the leading point of the selection, until it either lines up with previous "tab" position column (currently multiples of 2) or bumps into previous visible text. Selection and the text it includes remains after operation.

Example 1:
image
Results in this:
image

Example 2:
image
Results in this:
image

Example 3:
image
Results in this:
image

Multi-Line Stream Selection
When any stream selection includes multiple lines, pressing the Shift-Tab keys once results in outdenting each whole line to the previous "tab" position column (currently multiples of 2); effectively removing one or more space characters from the beginning of each involved line regardless of the actual selection's start and end within said lines. Selection need not be perfect, it may include only a portion of the starting and ending line. Selection and the text it includes remains after operation.

Example 1:
image
Results in this:
image

Example 2:
image
Results in this:
image

Multi-Line Block Selection
When any block selection includes multiple lines, pressing the Shift-Tab keys once results in one or more space characters being removed from just left of the leading point of the selection on each line, until it lines up with previous "tab" position column; currently multiples of 2. Selection and the text it includes remains after operation.

Example 1:
image
Results in this:
image

Example 2:
Starting with this selection...
image
Pressing Shift-Tab four (4) times results in this:
image
Additional presses of Shift-Tab have no effect because part of the selection has already bumped into visible text to its left.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions