microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.28k stars 288 forks source link

how to disable Word Wrap feature on all Jupyter Notebook Input Cells globally #16059

Open harshalgithub opened 1 week ago

harshalgithub commented 1 week ago

Environment data

Version: 1.93.1 (system setup) Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 Date: 2024-09-11T17:20:05.685Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631

Expected behaviour

Whenver we use the shortcut key "alt + z" it should disable wordwrap on all jupyter Notebook Cells

Actual behaviour

It is currently running on individual cell level and whenever we reopen the VSCode, it will be wordwrap again, so need to click each cell and click alt + z to remove word wraps

Steps to reproduce:

  1. create multiple notebook input cells with large string data in single line
  2. inbetween create input cells with smaller strings
  3. and then keep individual input cell unwrapped using alt + z
  4. restart the VScode, and you will see all the cell input values are wordwrapped again.
  5. even if we save all input cells with unwrapped data ( alt + z ), after vscode restart, it will wrapped again.

Default I have made wordwrap Off everywhere. In below screenshot it shows "Modified elsewhere" popup, there also I have checked and made settings to Off. but still issue persists after restarting the VSCode.

image

amunger commented 1 week ago

The cells all have word wrap disabled for me based on that setting as expected. Can you try on a fresh profile to see if this still occurs without any other settings/extensions: Profiles: create a temporary profile

harshalgithub commented 1 week ago

Hi Aaron,

I have created profile with all default parameters named "Untitled" as is,

image

Then I have moved to File> New window with Profile > Untitled

image

Then I have opened the existing file .ipynb jupyter notebook using "Open File" menu It showed me popup for installing"Python" extension, but I cancelled it

image

As we can see in above image "results" variable was word-wrapped somehow, even though all the configurations are on Default

Thank you

amunger commented 1 week ago

is that a python cell? does this happen for new notebooks or just that specific one?

harshalgithub commented 1 week ago

Its Python Jupyter notebook cell.

I have created "Jupyter: New Jupyter Notebook" empty and saved it in newly created above "Untitled" profile with all default parameters only.

Then I copied the long json string variable and python code into its cell, and saved it.

When I pasted data, it was showing in Single line and saved it.

But when I closed workspace/profile and reopen it and then Open File .ipynb, all data was Wordwrapped.

So it happens with new jupyter notebook as well.

harshalgithub commented 1 day ago

hi @amunger , am I missing something in configuration?

amunger commented 1 day ago

But when I closed workspace/profile and reopen it and then Open File .ipynb, all data was Wordwrapped.

Are you opening it from within a different workspace? does that workspace have a settings file?

I haven't managed to reproduce this behavior, so it's really hard to say why it's happening for you.

Is a regular text editor word wrapped as well?