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

Weird behavior of j/k command for moving to the next/previous cell #12738

Closed
1 of 2 tasks
liganega opened this issue Feb 6, 2023 · 10 comments
Closed
1 of 2 tasks

Weird behavior of j/k command for moving to the next/previous cell #12738

liganega opened this issue Feb 6, 2023 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-commands verified Verification succeeded
Milestone

Comments

@liganega
Copy link

liganega commented Feb 6, 2023

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

This is a report of a weird bevior of the (vim-style) j/k command.
First, it's only related to markdown cells.

Description of the weird behavior after editing a markdown cell:

  • When Control+Enter keybinding is applied, the j/k command won't work at all.
  • When other keybindings such as ESC key or Shift+Enter are applied, then it works as expected.

This behavior has been confirmed on several (Windows 11) PCs, even with reinstalled VS Code + Python extensions.
With code cells, on the other hand, there is no problem.

VS Code Version

Version: 1.75.0 (user setup) Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164 Date: 2023-02-01T15:23:45.584Z Electron: 19.1.9 Chromium: 102.0.5005.194 Node.js: 16.14.2 V8: 10.2.154.23-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

Jupyter Extension Version

v2023.1.2000312134

Jupyter logs

No response

Coding Language and Runtime Version

Python 3.9.12

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

Anaconda3-2022.10-Windows-x86_64

Running Jupyter locally or remotely?

None

@liganega liganega added the bug Issue identified by VS Code Team member as probable bug label Feb 6, 2023
@amunger
Copy link
Contributor

amunger commented Feb 6, 2023

When Control+Enter keybinding is applied, the j/k command won't work at all.

Can you clarify the repro steps here? If I press ctrl+enter to render a markdown cell, j/k still navigates between cells for me as expected.

@amunger amunger added info-needed Issue requires more information from poster notebook-commands labels Feb 6, 2023
@liganega
Copy link
Author

liganega commented Feb 7, 2023

I don't have any repro steps, but I tested again using another Windows 10 and 11 PCs (Korean edition). (not mine)
Here is what I did:

  • VS Code and Anaconda reinstalled. (all the configs were removed first) Latest versions for both.
  • Open VS Code and create a new ipynb file.
  • Install all extensions what VS Code recommends: Jupyter, Jupyter Cell Tags, Jupyter Keymap, Jupyter Notebook Renderers, Jupyter Slide Show, Pylance, Python

That's all. But pressing ctrl+enter to render a markdown cell won't let me navigate down/up using j/k key strokes.

@amunger amunger removed the info-needed Issue requires more information from poster label Feb 7, 2023
@amunger
Copy link
Contributor

amunger commented Feb 7, 2023

ah, I got it to repro now. I was trying with the vim extension installed, I forgot that the j/k keyboard commands are available just with the jupyter extension.

I suspect that the focus is not being correctly taken away from the markdown editor with ctrl+enter.

@amunger
Copy link
Contributor

amunger commented Feb 21, 2023

actually, all notebook cell commands are disabled (a, b, dd) as noted in the linked issue.

@liganega
Copy link
Author

Is this fixed, or will it be?

I hope so because this is really so annoying that I don't want to use VS Code with jupyter notebook anymore, almost.

@rebornix rebornix added this to the April 2023 milestone Mar 31, 2023
@rebornix
Copy link
Member

rebornix commented Mar 31, 2023

I can reproduce this issue, working on a fix now.

@jrounds
Copy link

jrounds commented Apr 6, 2023

I had this issue and the key debug logger said arrow keys were hitting "scrollLeftHover", "scrollRightHover", "scrollUpHover", and "scrollDownHover". I remapped those events not to be arrow keys and arrow keys returned to normal function in Jupyter notebook. I assume this is the same issue?

@RishabhSk7
Copy link

@jrounds yeah getting same logs in the logger. Might possibly have been due to a sublime key binding extension if I had to guess.
If anyone is not sure how to remap key events, go to file->preferences->Keyboard Shortcuts.
then search for "scrollLeftHover", "scrollRightHover", "scrollUpHover", and "scrollDownHover" and delete the respective entries.

rebornix added a commit to microsoft/vscode that referenced this issue Apr 9, 2023
…pdate editor context on markdown preview.
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Apr 10, 2023
…13263. Update editor context on markdown preview. (#179569)

Commit: 7f03ec6f7a48791d8027761b22773b454fc52478
@rebornix
Copy link
Member

This issue will be fixed and released in tomorrow's VS Code Insiders. Thank you for the input.

@liganega
Copy link
Author

Thank you for your effort!

@eleanorjboyd eleanorjboyd added the verified Verification succeeded label Apr 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-commands verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants