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

Indent and dedent in htmlnotebook #2167

Closed
lpsinger opened this issue Jul 18, 2012 · 13 comments
Closed

Indent and dedent in htmlnotebook #2167

lpsinger opened this issue Jul 18, 2012 · 13 comments
Milestone

Comments

@lpsinger
Copy link
Contributor

When editing code in an HTML notebook, it would be convenient if there was a way to indent or dedent a selected block of code, perhaps with keybindings to tab and shift-tab or C-[ and C-].

@takluyver
Copy link
Member

Tab & shift-tab are working here. What OS, browser and version of IPython are you using?

@lpsinger
Copy link
Contributor Author

Safari (5.1.7) and Chrome (20.0.1132.57) on OS X (Lion). Hmm, seems to work. I guess I had tried command-[, command-], command-tab, and command-shift-tab, but not tab and shift-tab.

Could the tab and shift-tab shortcuts be added to the shortcuts help dialog? What about menu items for indent and dedent?

@minrk
Copy link
Member

minrk commented Jul 18, 2012

It probably makes sense to add them - we hadn't because the tab/shift-tab actually have nothing to do with us, and are just part of CodeMirror, and we only ever added our own shortcuts to that list.

@takluyver
Copy link
Member

I think of tab & shift-tab as a bit like the shortcuts for copy &
paste - they're common to most applications, so we don't need to list
them in the help. I'll leave this open in case anyone wants to add
menu items for indent/dedent, but I'm not sure whether that's
necessary, either.

@lpsinger
Copy link
Contributor Author

Aha. On both of my browsers, the tab key has no effect if either the first or the last line of code in a cell is selected. As long as the selection consists of some number of the second through second to last lines in a cell, it works fine.

@takluyver
Copy link
Member

That does sound like a bug, although it may well be in codemirror.

@minrk
Copy link
Member

minrk commented Jul 18, 2012

yeah, I have found codemirror to be quite fiddly for lots of things at the top or bottom of cells.

@joonro
Copy link
Contributor

joonro commented May 10, 2013

I'm on GNU/Linux (openSUSE 12.3) and in both Firefox 20 and Chromium 27, shift-tab does not work in the notebook. (Tab works fine)

@aflaxman
Copy link

shift-tab is not working for me now in windows/chrome. it used to. tab works and is great.

@Carreau
Copy link
Member

Carreau commented Jun 24, 2013

shift-tab is not working for me now in windows/chrome. it used to. tab works and is great.

Shift tab is not supported by codemirror anymore for diverse reason, C-[ and C-] should work more often and are the official way to do it (when keyboard layout allows it).

@aflaxman
Copy link

C-] works, great, thanks!

@Carreau
Copy link
Member

Carreau commented Jul 5, 2013

I wold vote for closing this issue as Tab is not supported by CM and C-[,] is the official way.
Yes I know it sucks for non-english keyboard user, I' m part of it.

@minrk
Copy link
Member

minrk commented Jul 5, 2013

works for me. I would defer to CodeMirror as much as possible when they have a position on things like this.

@minrk minrk closed this as completed Jul 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants