Skip to content

Editor: Tab key handler prevents from indenting selection, Shift+Tab doesn't unindent #841

@juliendargelos

Description

@juliendargelos

The handler responsible for converting tab to spaces replaces the selection instead of indenting it:

Tab: (cm) => {
// convert tabs to spaces and add invisible elements
const s = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(s);
},

I would also expect ShiftTab to unindent a line or selection, but it doesn't have any effect.

Observed behavior:

Image

Expected behavior (shown on sublime text):

Image

Workaround:

Using multiple cursors by pressing Alt and dragging the mouse can indent multiple lines, but it isn't practical and also fails at unindenting correctly as it removes the whole indentation when pressing ShiftTab.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions