Aegisub icon indicating copy to clipboard operation
Aegisub copied to clipboard

Option to display newline / new line / carriage return as WYSIWYG instead of \N in edit box

Open vertigo220 opened this issue 11 months ago • 8 comments

Instead of displaying a line like this:

This is the first line \NThis is the second line

which is difficult to read, it would be helpful to have an option to display it like this:

This is the first line
This is the second line

Not only would this make it more readable, but quicker to edit with the keyboard, since instead of having to arrow all the way to the midway point to edit the end of the first line or the start of the second, it would just require hitting end or the down arrow.

vertigo220 avatar Jan 20 '25 00:01 vertigo220

One complication with this is that \N is not the only newline command the ASS format, there is also \n. Displaying these as actual line breaks would require some way for the user to distinguish between these two.

arch1t3cht avatar Jan 21 '25 13:01 arch1t3cht

One complication with this is that \N is not the only newline command the ASS format, there is also \n. Displaying these as actual line breaks would require some way for the user to distinguish between these two.

I can think of a "Subtitle View" (where subtitles are shown as text) and a "Source View" (where the subtitles are shown with the ASSA formatting), like some other softwares have.

AuroraMartell avatar Jan 21 '25 13:01 AuroraMartell

The scenario I'm afraid of is a user enabling "source view" and then deleting some line break and inserting it again. This may turn a \n into a \N or vice-versa without the user noticing.

arch1t3cht avatar Jan 21 '25 13:01 arch1t3cht

The scenario I'm afraid of is a user enabling "source view" and then deleting some line break and inserting it again. This may turn a \n into a \N or vice-versa without the user noticing.

This could be prevented by making the source view read-only.

AuroraMartell avatar Jan 21 '25 13:01 AuroraMartell

This may turn a \n into a \N or vice-versa without the user noticing.

While this is a valid concern from an "avoid accidental changes" point of view, I'm not too sure it matters as such for linebreaks in particular. Usually scripts will/should only use one type, and they are easily converted back and forth. However, \h (non-breaking space) would pose a similar problem—potentially much more harmful if accidentally deleted and replaced with a normal space.

Also, there is some question of how far should one go with this. Should other tags, such as \i1, be converted into inline styling in this "Subtitle view" mode as well? (I'm leaning towards no)

petzku avatar Jan 21 '25 14:01 petzku

IMHO it's acceptable to show \N or \n as an actual line break if and only if they take effect as forced line breaks. That is, when WrapStyle = 0 or 1, show \N in actual line break while show \n as-is, no matter if the line is actually wrapped on the video or not; when WrapStyle = 2, show both \N and \n in actual line breaks without distinction.

0tkl avatar Jan 21 '25 14:01 0tkl

How about just always show it as:

This is the first line\N
This is the second line
This is the first line\n
This is the second line

It's easier to read and still easy to edit.

dawidpotocki avatar Mar 15 '25 23:03 dawidpotocki

An alternative is to display paragraph marks. For example, Microsoft Word uses the “↵” symbol for soft line breaks. Similarly, hard spaces (\h) could also be represented using "°".

So for example:

This is the first\hline\Nthis is the second line\nThis is the third line

Would appear in the editor as:

This is the first°line
this is the second line↵
This is the third line

To make these symbols less overwhelming and to indicate that they are not part of the actual text but have a special meaning, they could be displayed in a more subtle color (grayish).

kametsuu avatar Mar 16 '25 04:03 kametsuu