Sublime Forum

Bug: Replacement text can contain newlines

#1

In the Find/Replace dialog, it is possible to enter newlines into the replacement text by hitting Ctrl+Return. Since the “Replace With” field shows only a single line, the user may not notice that the replacement text contains newlines (he might have hit Ctrl+Return accidentally or the newline could be left over from a previous replacement).

Possible solutions:

  1. Prevent the user from entering newlines into the replacement text.

  2. Adapt the height of the text field to the number of entered lines (but only up to a maximum number of lines).

  3. Add a small icon to the text field when it contains multiple lines.

0 Likes

#2

This feature has been useful to me a great number of times. Preventing us from doing so would be a terrible idea in my opinion.

0 Likes

#3

You can adjust the height yourself by pulling on the top of the panel, but it would be very nice if it auto-expanded as you typed.

0 Likes

#4

I agree that allowing newlines in the replacement text is a useful feature.

But there should be a visual indicator when a text field contains more text than is currently displayed. Currently, a small shadow is drawn when the text exceeds the field’s width, which is a nicely unobtrusive indicator. Something similar should be there when the text exceeds the field’s height.

0 Likes