Hi Org ML,

I hope this is the right place. If not please let me know where I should surface this 😅

Issue:

If I press TAB while the cursor is in a sql src block, it opens the code in a new buffer in the background. Kind of like pressing C-C C-' (org-edit-special) but silently. It's frustrating because it prevents me from editing it until I find the buffer or use org-edit-special.

Reproduction:
  1. Create an org-mode buffer
  2. Add at least one headline
  3. Create a sql source block (sample below)
  4. Put the cursor on the "S" of the "SELECT" statement
  5. Press TAB

Expected:

Indents using either native sql-mode or sql-indent-mode if installed.

Actual:

Highlights the SQL src, opens it in a new buffer in the background, and I can't edit the source.

Notes:

If I use M-x org-cycle directly this behavior also occurs. If I call indent-for-tab-command on the SQL sample the behavior also occurs, but I can nil-out the body of that function using the REPL and the behavior still occurs. This does not happen when using TAB in a bash src block. This does not happen in a sql-mode buffer which is why I currently suspect it to be org-babel sql specific.

GIF reproducing behavior below

2020-10-06 23.13.44.gif

I appreciate any help debugging this, or even links to docs to help me learn how to debug it.

Thanks,
J