3 ms·
Reread the suggestion, you’ve got it back to front: > no escape sequence is shorter than the text it represents The idea is that you unescape immediately, and
by chrismorgan 3y ago
Reread the suggestion, you’ve got it back to front:
> no escape sequence is shorter than the text it represents
The idea is that you unescape immediately, and if necessary shuffle the remainder back, leaving a blank space at the end, but able to reuse the initial allocation.
Also, I don’t even know of anything that actually turns a \n into {CARRIAGE RETURN, LINE FEED}; if you want that, you’ll need \r\n. (A very few situations are a bit fuzzy about it, e.g. \r and \n are a bit wonky in Vim’s :substitute, but that’s all I can think of).