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

how to disable Word Wrap globally #230128

Open
harshalgithub opened this issue Sep 18, 2024 · 11 comments
Open

how to disable Word Wrap globally #230128

harshalgithub opened this issue Sep 18, 2024 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@harshalgithub
Copy link

Environment data

Version: 1.93.1 (system setup)
Commit: 38c31bc
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

@harshalgithub harshalgithub added the bug Issue identified by VS Code Team member as probable bug label Sep 18, 2024
@amunger amunger assigned amunger and unassigned DonJayamanne Sep 18, 2024
@amunger
Copy link
Contributor

amunger commented Sep 18, 2024

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

@amunger amunger added the info-needed Issue requires more information from poster label Sep 18, 2024
@harshalgithub
Copy link
Author

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
Copy link
Contributor

amunger commented Sep 19, 2024

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

@harshalgithub
Copy link
Author

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
Copy link
Author

hi @amunger , am I missing something in configuration?

@amunger
Copy link
Contributor

amunger commented Sep 27, 2024

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?

@harshalgithub
Copy link
Author

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 mean to say that, the default profile which you have asked me initially to create in above responses, with that profile I am trying to open the 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?

Yes its happening for regular text file as well.

Can you create a single string with 10000+ characters and try to save it in in regular text file and same string you can copy into Jupyter Notebook as well then simply save both files.

After that close the VSCode and then reopen it and then try to open both files, it will show as Wordwrapped by default and when you type "Alt+Z" then it will unwrap and show in Single line text.

I have attached VSCode Profile Exports for your reference.
VSCode_Export_Profile.zip

Files : Name : Usage

1 : VSCode_Default_Profile.code-profile : Regular day to day profile
2 : VSCode_Untitled_Profile.code-profile : Created based on your initial response with "Profiles: create a temporary profile"
3 : random_string.txt : random long string text file
4 : test_random_long_string.ipynb : Jupyter Notebook cell with above same random string value

@amunger amunger transferred this issue from microsoft/vscode-jupyter Sep 30, 2024
@amunger amunger changed the title how to disable Word Wrap feature on all Jupyter Notebook Input Cells globally how to disable Word Wrap globally Sep 30, 2024
@vs-code-engineering vs-code-engineering bot removed the info-needed Issue requires more information from poster label Sep 30, 2024
@amunger
Copy link
Contributor

amunger commented Sep 30, 2024

profiles and workspaces are two different concepts - a workspace is can just be the directory that is opened in vscode. Can you check the workspace settings and also what shows up when you hover over the "modified elsewhere" text.

Since this is also happening with text editors, it seems like the setting has been turned on somewhere.

image

@harshalgithub
Copy link
Author

Hi Thank you @amunger

I have tried to make Everywhere "word wrap" config to "Off" in User & Workspace options,

After that I have manually made the wrapped lines to unwrap using "Alt + Z" and saved file. ( Jupyter Cell Notebook )

but after restarting VSCode, and opening the .ipynb jupyter file, issue still persists.

It Seems needs to RESET the VSCode.

@amunger
Copy link
Contributor

amunger commented Oct 1, 2024

Just to boil this down to a simpler repro, can you confirm this behavior:

  1. Create a new empty folder on your machine
  2. Open vs code and switch to an empty profile
  3. Open that empty folder in vscode (File: Open Folder...)
  4. create a plain text file and add a text line that is long enough to wrap (at this point it isn't wrapped)
  5. save the file
  6. close vscode and reopen with that same folder and file

🐛 the line of text is wrapped

@harshalgithub
Copy link
Author

I have followed above steps,

Created EmptyFolder
Opened VSCode and moved to default profile, and Opened the above Folder
Created PlainTextFile.txt as below, and saved it ( its in Single Line only as per screenshot )

image

After reopening the VSCode and followed same process to open file, it shows as wordwrapped as below,

image

@amunger amunger assigned alexdima and unassigned amunger Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants