Sublime Forum

How to unwrap lines of text

#1

I’ve been given some HTML files to work on. The lines of code are splitting on to several lines. How do I get the lines to not split onto many lines? My window is massively wide - it is unnecassary for the lines to wrap and makes reading the code harder.

Thank you

0 Likes

#2

Have you perhaps activated View -> Word Wrap ? If you want word wrap to be off permanently, you can set word_wrap to false in your user preferences by going to Preferences: Settings from the command palette.

0 Likes

#3

What is Word Wrap? It is ticked. I’ve unticked it – and nothing happens. My lines don’t go back on to one line.

0 Likes

#4

Word wrap is what might have caused your code to split on several lines. Can you share a screenshot of how it looks like ?

0 Likes

#5

It’s also possible the code itself has carriage returns in it. If a line is being word wrapped then the entire wrapped line will occupy a single numbered line in the editor demonstrated by lines 1 and 2 in the screenshot. If the line is wrapping as a result of carriage returns, each line will be numbered as seen in the third paragraph lines 4 through 9.

0 Likes

#6

Hi. The html files was downloaded from a live site. You can see here that the lines are wrapping.

0 Likes

#7

It appears that my code has carriage returns in it - as each line is numbered. How do I join all the lines (that should be joined) in the file? Is there a way to see invisible characters, without having to highlight the text?

0 Likes

#8

You can join lines by highlighting the lines you wish to join and from the Edit menu select Line -> Join Lines or use CTRL+J.

0 Likes

#9

It’s going to be a pain to have to join all the lines, one at a time, without joining lines that shouldn’t be joined. I’m surprised there isn’t an automatic way to do this.

0 Likes