Sublime Forum

ST3, exists setting for NOT to convert ^M into line ending?

#1

Hello,

I have a perl script in which I remove windows line endings.

$text =~ s/^^M?\n?//mg;

When I open this skript with SublimeText 3 the ^M is interpreted as a line break:

$text =~ s/^ ?\n?//mg;

This breaks systax coloring and - much worse! - when I save the file it changes the regex. See the diff:

+  $text =~ s/^
+?\n?//mg;

Is there anything I can do to stop ST3 to interpret Windows line endings?

Thanks for Your help!
Sven

edit: Headline should now be clearer :wink:

0 Likes

#2

This is something that might benefit from github.com/facelessuser/RawLineEdit. The original intention of this plugin was to make the line endings visible, but it may also help with your issue to. I don’t honestly know, but it might be worth a look.

0 Likes

#3

Thanks a lot - this seems to be a possible workaround. But it’s not really a solution. It works but kills all the nice goodies from sublime text.

With this it’s much better for me to switch back to vim.

0 Likes