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

Text stopped wrapping text with .txt files #1407

Closed
lunar-debian opened this issue Feb 2, 2021 · 13 comments
Closed

Text stopped wrapping text with .txt files #1407

lunar-debian opened this issue Feb 2, 2021 · 13 comments
Labels
1. to develop design Experience, interaction, interface, … enhancement New feature or request

Comments

@lunar-debian
Copy link

lunar-debian commented Feb 2, 2021

Summary

Describe the bug
Nextcloud Text can be used to open .txt files. But word-wrapping is not enabled in Nextcloud 20 and that makes it not very usable.

I've just upgraded the server from Nextcloud 18. It used to work fine.

To Reproduce
Create a new file ending in.txt. Open it with Text. Type a line too long to fit on the screen. It will not be wrapped and requires horizontal scrolling.

Expected behavior
Words should be wrapped, just like they are with rich text.

The issue can be fixed by adding the following CSS snippet using the custom CSS app.

#editor-wrapper:not(.richEditor) .ProseMirror pre {
  white-space: pre-wrap;
}

Screenshots
Video demonstrating the bug

Server details

Text app version: 3.1.0

Nextcloud version: 20.0.6 - 20.0.6.1

@sushifrick
Copy link

Same problem here with Nextcloud 20.0.8 and text 3.1.0. I did not realize it until one of our users asked for an option to anable word wrap today.

Could you please provide a fix for this, or at least say something to the proposed "fix" by @lunar-debian . Is is "save" to use it os is there any other parts of the editor that are affected in an unwanted way by this?

@RussianNeuroMancer
Copy link

#1006

@dave-kennedy
Copy link

This has been "fixed" in Nextcloud 23, i.e. lines are wrapped by default when viewing plain text files. Depending on the file, sometimes I want lines to wrap and sometimes not. It'd be nice if there was a button in the toolbar to toggle this behavior.

@ed-ud
Copy link

ed-ud commented Apr 8, 2022

I find the opposite extreme case - we see it show the file in the center third of the window (and it wraps the lines of text) and there are huge areas of empty white space on the left/right of that. I'd like to TURN OFF line wrapping or have it use the entire available width of the window before wrapping...

@juliusknorr
Copy link
Member

@jancborchardt @nimishavijay @max-nextcloud What do you think about this. I see that with either wrapping or not wrapping will not work for everyone or every file type / content. Having a toggle is quite common for a text editor, but I fear we start overcomplicating the UI.

@juliusknorr juliusknorr added design Experience, interaction, interface, … needs info labels Apr 8, 2022
@ed-ud
Copy link

ed-ud commented Apr 8, 2022

I tried this CSS snippet via the "Custom CSS" app, and it seems to work fairly well to stop the line wrapping when we view text files:

#editor-wrapper:not(.richEditor) .ProseMirror pre {
white-space: pre;
}

@max-nextcloud
Copy link
Collaborator

Since this is just for plaintext and code editing we do not have the menubar. So the ui is not so cluttered anyway. I'd be okay with adding a toggle or so. Maybe even one for full width of the editor and one for line wrapping.

@nimishavijay
Copy link
Member

Great idea! Agreed, word wrap toggle is there in every other editor so we should include it for sure for .txt files. For .md I don't think we need to include it as .md files are usually used for readable content as it has formatting, bullet points, etc :)

@juliusknorr juliusknorr added enhancement New feature or request 1. to develop and removed bug Something isn't working needs info labels Apr 11, 2022
@juliusknorr
Copy link
Member

Thanks for the input everyone, I've updated the issue description accordingly.

@max-nextcloud
Copy link
Collaborator

Okay... so this issue is getting somewhat mixed up. Initially it was about wrapping not working anymore in NC20. This is fixed with Nextcloud 23 and there is a workaround available for earlier versions.

@juliusknorr
Copy link
Member

@max-nextcloud Yes, good take, lets track the enhancement separately then in #2290

@max-nextcloud
Copy link
Collaborator

@juliushaertl I copied over your new summary and reverted this so the two are easier to destinguish / understand.

@pdwalker
Copy link

#editor-wrapper:not(.richEditor) .ProseMirror pre {
white-space: pre;
}

I also added a heavy handed ".editor__content { max-width:revert!important; }" to the custom css. I may refine it further if i find it causing problems elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop design Experience, interaction, interface, … enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants