-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search with regex replacement #3456
Comments
The input field takes the raw replacement text. Backslash escapes aren't interpreted, and there's no reason to believe that they would be. I agree that it would be useful to be able to insert newlines, but I don't think doing some ad-hoc backslash interpretation is the answer. A better proposal or a clean pull request would be welcome. |
The simplest, and maybe silliest thing that comes to my mind, is to detect only the |
Thanks for patch! |
I don't think I agree. Why should it only work when replacing a regular expression? You might also want to replace some string with a newline. |
IMHO there are two way in which find and replace should work: (My english isn't very good, I hope I have been clearer than before) |
I think the behavior you are proposing is horrible (inconsistent parsing of input in two different situations) and I am not going to change this. |
As far as I can tell It is the same behaviour of Netepad++, Sublime Text 2 and Netbeans. |
If you really disagree in the behaviour I asked, I think the patch should be reverted: it adds an unexpected behaviour in the "normal" case. |
I don't see how you are claiming that this is expected behavior in one case and not in an almost identical one. There is no API to implement this from outside, short of reimplementing the search addon. The patch is not going to be reverted. |
Because most of code editor work as I said, while as far as can i understand now codemirror has an odd behaviour: that is why I think is unexpected. |
I tried the search demo here: http://codemirror.net/demo/search.html.
I wanted to replace some char with a newline:
<dd>
in the text box and pressed enter\n
in text box and pressed enterActual result:
<dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
\nWhether, when indenting, the first N*<code>tabSize</code>
Expected result:
<dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
Whether, when indenting, the first N*<code>tabSize</code>
I tried with
/<dd>/
but the result was the same.The text was updated successfully, but these errors were encountered: