# Block Indentation / De-Indentation Behavior

**URL:** <https://discourse.jupyter.org/t/block-indentation-de-indentation-behavior/24799>\
**Category:** JupyterLab\
**Tags:** jupyterlab, how-to, help-wanted\
**Created:** [March 26, 2024, 10:18am UTC](https://discourse.jupyter.org/t/block-indentation-de-indentation-behavior/24799 "2024-03-26T10:18:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrunoBelucci](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/brunobelucci/32/10929_2.png) [@BrunoBelucci](https://discourse.jupyter.org/u/BrunoBelucci)\
**Post date:** [March 26, 2024, 10:18am UTC](https://discourse.jupyter.org/t/block-indentation-de-indentation-behavior/24799/1 "2024-03-26T10:18:41Z")

</div>

I am used to using Tab / Shift + Tab to indent / de-indent a block of code in Jupyter Notebook. However, the behavior seems inconsistent in jupyter lab, it works fine when selecting a block of code, but if there is some code indented and I want to open the tooltip for a function, which also uses the Shift + Tab shortcut, both actions are performed at the same time, the tooltip opens and the line is de-indented. Honestly, it is starting to be very frustrating to have to re-indent the unintentionally de-indented line. I do not see any option to change this behavior, nor an option to disable the Shift + Tab shortcut to de-indent, which I would gladly disable to stay only with the Ctrl + [ shortcut. Does anyone know any configuration that I can change to fix this issue?

Just one simple example:

```auto
import numpy as np
for i in range(5):
    array = np.array(i)

```

Maybe I want to open the tooltip for np.array, so I put the cursor after np.array( and press Shift + Tab, which opens the tooltip, but gives me:

```auto
import numpy as np
for i in range(5):
array = np.array(i)

```

FIY, the behavior on the classical notebook was to only de-indent if the whole line or more than one line was selected, which for me is much more natural.

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [March 26, 2024, 12:54pm UTC](https://discourse.jupyter.org/t/block-indentation-de-indentation-behavior/24799/2 "2024-03-26T12:54:06Z")

</div>

@BrunoBelucci I believe that you are running into [Jupyterlab 4.1 dedent broken · Issue #15821 · jupyterlab/jupyterlab · GitHub](https://github.com/jupyterlab/jupyterlab/issues/15821) which was a regression introduced in 4.1.0 and fixed by [Fix spurious dedent when opening inspector tooltip by krassowski · Pull Request #15898 · jupyterlab/jupyterlab · GitHub](https://github.com/jupyterlab/jupyterlab/pull/15898) in JupyterLab v4.1.4 (the latest version is 4.1.5). Can you check your JupyterLab version, upgrade and see if it is still a problem?

---

<div class="post-metadata">

**Author:** ![BrunoBelucci](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/brunobelucci/32/10929_2.png) [@BrunoBelucci](https://discourse.jupyter.org/u/BrunoBelucci)\
**Post date:** [March 26, 2024, 1:21pm UTC](https://discourse.jupyter.org/t/block-indentation-de-indentation-behavior/24799/3 "2024-03-26T13:21:24Z")

</div>

Yes, it totally solved the problem! Thank you very much, I had spent some time looking for this issue on GitHub and here on the forum but I missed this issue.
