How to apply NO line wrapping?


#1

Atom has not been wrapping which is what I was looking for. I happened to toggle soft-wrap and now I can only toggle between soft wrap and hard wrap. I have not found any support to toggle no wrap like it was before I ‘turned on’ soft-wrap.

I have rm’d the correct dirs per this forum, reinstalled atom and still can only toggle between hard and soft wrap.

How can i achieve no wrap?

config:

"*":
  core:
    telemetryConsent: "no"
  "exception-reporting":
    userId: "xxxx"
  welcome:
    showOnStartup: false


#2

Sorry we missed this one @coreybeaumont, are you still having this issue?

If so, can you confirm after toggling soft wrap off what happens? E.g. it sounds like you’re saying if you disable soft wrap, then lines will hard wrap? If that’s the case, where does it hard wrap (e.g. at a specific column?)?

Lastly, are you seeing this behavior with a particular file type? Or do you see with all file types and with new plain text files?


#3

Hi @rsese thanks for getting back to me. I am indeed still having this issue.

After a fresh install of 1.16.0 (mac), in a blank full screen (27" 1920 x 1080) editor if a single line has more than around 500 characters the line will soft wrap, allowing me to scroll right to see the rest of the line. Then, if I toggle soft wrap (View > Toggle Soft Wrap) the line will hard wrap to fit removing the horizontal scroll bar. If I again toggle soft wrap, the line will go back to soft wrapping.

As for file type, the above behavior is consistent across unsaved, txt, js, sql, php, py, and no ending saved files. Here images of random blog text.
Soft wrap :

Hard wrap:

As a reminder, before I ever clicked Toggle Soft Wrap (a couple weeks ago) all of this text would be on a single line. Specifically for long sql statements having them all on one line is far less distracting.

Goal (No Wrap) via sublime:


#4

You will have to build from source and adjust this line. The line wrap limitation is in place to ensure that files with extremely long lines do not crash Atom.


#5

Thanks for the info @Wliu. Any idea why I was able to achieve no-wrap before? Would creating a no-wrap option be worth creating a pull request or would that go against the the performance goals of Atom?

For what its worth, the only time I had issues with performance on long lines/files was with the spell check package. I disabled it and all was good.


#6

It was added in Atom 1.15 to work around crashes when opening files with really long lines (think minified JS files). See https://github.com/atom/atom/pull/13820#issuecomment-280778310 for the discussion around adding a setting for this. I don’t think we’ll be adding one because people will most likely set it to a very large value and then complain about Atom crashing :confused:.


#7

ah got it thanks for the link.


#8

This has to be a configurable! 500 is a completely arbitrary number.

I have never had atom crash because of too long a line. Now I can’t get it to stop wrapping lines I do not want wrapped.

This makes Atom completely unusable for me. It might be faster, but I don’t care about that - I care about not having my lines arbitrarily wrapped.

I’m going to have to stop using atom because of this.

Here I come vscode…


#9

yeah this should at least be configurable from an init argument…good greif. I have some SQL queries that are well over 1000 characters and this forced wrapping completely breaks php grammer >:frowning:


#10

I used Sublime all my life, many features of Atom made me change to Atom. As soon as i discovered this, I switched back to Sublime. Sorry guys! But i need this feature so bad!


#11

For me, the Soft Tabs toggle doesn’t actually do anything. :confused: (Whoops, just didn’t look close enough, sorry!)

There MUST be a variable in the configs that saves the value of Soft Wrap. This may sound stupid, but maybe the toggle sets this value to 1 & 2? Then we could set it ourselves to 0.


#12

An interesting statement.

What do you expect to get?
What do you think that function does?
How does your question tie in with the topic of this thread?

What is your root problem? What are your trying to do?

Do you have your invisibles switched on?..
could you show us a screen capture of a before and after?


#13

Actually, after closer inspection, the results are identical to @coreybeaumont’s screenshots.


After experimenting I found out:
On: Soft wrap to the edge of the pane.
On with Soft Wrap At Preferred Line Length: Soft wrap to the user set preferred line length (default 80).
Off: Soft wrap to 500 characters.


Looks like Atom’s hard wrap is NOT true hard wrap.
I’m trying to disable wrap, or at least have true hard wrap.


For these examples, I will use an exaggerated line width of 14.

No Wrap:

ABRACADABRA ABRACADABR ABRACADAB ABRACADA ABRACAD ABRACA ABRAC ABRA ABR AB A

Soft Wrap:

ABRACADABRA 
ABRACADABR 
ABRACADAB 
ABRACADA 
ABRACAD 
ABRACA ABRAC 
ABRA ABR AB A

Hard Wrap:

ABRACADABRA AB
RACADABR ABRAC
ADAB ABRACADA 
ABRACAD ABRACA 
ABRAC ABRA ABR 
AB A

Looks like the majority of people here hate wrap. They should be able to see the file as is since wrap sometimes doesn’t play well with code.


Yes.


#14

TABS ≠ WRAP

Have you seen these descriptions?


#15

I am neither blind or stupid.
I know the difference between Soft Tabs and Soft Wrap. In fact if you read my previous post:

You would now know that I was mistaken (or the editor glitched, idk really).

Now can we get back on topic please?


#16

In my editor, it appears like the forced wrap is more like 550. That being said, toggling soft wrap on / off should not enable wrapping when there was none before and make a state change that you cannot revert.

This behavior goes against Atom’s entire purpose which is to be hackable and configurable. Forcing me to rebuild my own custom version because there is some integer hard coded goes against that entire concept.

Like the others, I’m going back to another editor, that’s crashy fwiw, without support for a no wrap option.

It’s sad when Atom loses out to nano in terms of usability for my use case…


#17

What state change? Wrapping, or the lack thereof, should be purely cosmetic and not affect the code or environment outside of how the text is currently displayed, so if you experienced a deviation from the expected behavior, that’s a bug that should be able to be reproduced and tracked down.


#18

I experienced the same behavior as coreybeaumont, once I toggled the soft wrap option everything started wrapping either soft or hard, but I cannot utilize any options around soft wrap (preferred line length, soft wrap on/off) to return to the initial behavior of not wrapping lines.

Regardless of the oddness of this weird step function behavior where it seems like the max line length isn’t getting initialized until the soft wrap option is first toggled(and then you can’t get back to the state of not wrapping), I’m arguing that this needs to be configurable. From my read of the other issue where it was decided to do this hard coded internal maximum line length, the only vague reason against is it’ll give people crashes or performance issues that’ll come back as bugs. I think it would be much easier to provide a button that’ll spit out relevant troubleshooting information for people to submit in bugs(version, config, module versions etc) and have that understand performance and stability edges in the configuration like this (and spit out big red bold text or something) )rather than just sweeping this one under the rug of “the users are too stupid to be allowed to edit this value”.

'Wrapping, or the lack thereof, should be purely cosmetic and not affect the code or environment outside of how the text is currently displayed’
That’s more than half of what a good editor is supposed to do, display text in an easily human readable and customizable format. As a description of the issue I’m having, yes it’s purely cosmetic, but it feels like that’s minimizing the issue, as if we’re just looking for functionality in terms of accurately editing files and displaying text, we’d still be using pico/nano,vi,emacs etc; what Atom brings to the table is a highly configurable gui and contextual highlighting. I would rather have atom crash on me once a day than not be able to toggle wrapping on long lines.