Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable block de-indent (shift+tab) in text editor? #6127

Closed
johnmarktaylor91 opened this issue Mar 23, 2019 · 12 comments · Fixed by #7865
Closed

Enable block de-indent (shift+tab) in text editor? #6127

johnmarktaylor91 opened this issue Mar 23, 2019 · 12 comments · Fixed by #7865
Labels
bug pkg:codeeditor status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@johnmarktaylor91
Copy link

I love the ability to highlight and de-indent a block of text in the Notebook editor with shift+tab. However, this feature doesn't seem to work in the text editor (i.e., if you do File->New->Text File)... would it be simple to add?

@Vonatzki
Copy link

Vonatzki commented Apr 7, 2019

This would be a big plus. I badly need this right now since I am trying to make jupyterlab as my main work env hosted on a remote VM.

Was surprised when I can't de-indent parts of my SQL script.

@v-iashin
Copy link

The same here

@BXSuhelSingh
Copy link

Yeah same here

@kuprel
Copy link

kuprel commented Nov 6, 2019

Block indent works, would be great to get de-indent as well

@gavieira
Copy link

gavieira commented Dec 5, 2019

I definitely agree

@gavieira
Copy link

gavieira commented Dec 5, 2019

Actually, I just found out that Ctrl-[ works for block dedenting.

However, this shortcut did not work for me in chrome (probably due to some extension). Switching to another browser fixed the issue.

Also, it seems relatively straightforward to customize the shortcut and replace it with shift+tab.

@ojsquire
Copy link

Actually, I just found out that Ctrl-[ works for block dedenting.

However, this shortcut did not work for me in chrome (probably due to some extension). Switching to another browser fixed the issue.

Also, it seems relatively straightforward to customize the shortcut and replace it with shift+tab.

Thanks, this worked for me in Chrome (Version 79.0.3945.79 (Official Build) (64-bit)). I am on a Mac, so Cmd-[ dedents, Cmd-] indents in a python script and a notebook.

@datdinhquoc
Copy link

Definitely a must, 'tab'-ed multiple lines, how to 'shift-tab' back?

@telamonian
Copy link
Member

Strange that this works in notebook cells (which use codemirror) but not text editors (which use codemirror)...

Probably just needs a config fix somewhere

@telamonian
Copy link
Member

telamonian commented Feb 9, 2020

Hah! I got it. It's the same problem that I fixed for the notebook and console waaay back in #5060: the 'shift tab' shortcut is also being used for the command to launch the interactive help tooltip. What's meant to happen is that if you just place the cursor at, say, a python keyword, 'shift tab' will open a tooltip with the relevant docstring; but if you have text selected and then hit 'shift tab' you get a de-dent.

This is indeed what happens in the editor in notebook and terminal. However in the text file editor, for whatever reason, the tooltip command is currently swallowing the 'shift tab' shortcut even when text is selected. I'll see if I can fix it

update

This will be fixed by #7865

@datdinhquoc
Copy link

Definitely a must, 'tab'-ed multiple lines, how to 'shift-tab' back?

That 'shift-tab' is not working, so I have to press Ctrl-Z

@telamonian
Copy link
Member

To clarify, shift tab to dedent will be fixed in either JupyterLab 2.0.0 (which will be released very soon), or one of the early 2.0.x releases, depending on when #7865 gets pulled in

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Mar 11, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug pkg:codeeditor status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants