Sublime Forum

Line Endings

#1

What is selecting View > Line Endings meant to accomplish? It doesn’t seem to do anything for me, in either Windows or Linux.

0 Likes

#2

Unless you save the file.

0 Likes

#3

Hmm. And then what’s supposed to happen? I just opened a file, selected View > Line Endings, saved it, closed it, reopened, and I see no line endings. (This is on Windows. Don’t have my Linux machine nearby.)

0 Likes

#4

In the view buffer, ST always uses \n as the line ending. Your chosen line ending will be used when you actually save the file. (This may be a tiny pitfall when you write a plugin first time. Just always use \n when you manipulating the view buffer.)


If you want to know what’s the current line ending quickly,

	// Display line endings in the status bar
	"show_line_endings": true,
0 Likes

#5

Thanks. I’m not a programmer–a prose writer–and I don’t get the functionality here. I was just looking for a way to turn on the carriage returns in the window I’m writing in. I did try making your suggested tweak to my preferences, but nothing changed. It’s not a big deal, though. Just mainly curious what the menu item was for, as I could see no visible change.

0 Likes

#6

In a normal case, ST never renders carriage returns (\r). Just choose the Windows line ending, ST will make it done.

It shows the line ending in the status bar. (the bottom-right corner of the window)

0 Likes

#7

OK, thanks.

0 Likes