+7

Multi-line search/replace textfields

Robert Stuttaford il y a 13 ans mis à jour par Andrey Fedorov il y a 7 ans 8
Just a toggle to switch between using a single line textfield and say 3-4 lines per textfield for all the find, find/replace, find/replace in files variants.

So often I have to futz around with regexen when all i really want to do is match some multiline text and replace with same. I can't think this would be difficult to do, and the utility would be really high. And it's the only thing I feel ST2 loses vs Textmate :-)
+6
A toggle might be convenient, but you do know that the pane used for those functions is resizable, right? So you can get multi-line text fields using the mouse, just not with a key combination.
+1
thanks sven, this has bugged me forever (or six months anyway...) - i had no idea i could simply drag this box and see my multiline find/replaces!  : )
+2
Just realised that it's possible to resize the panel. Came to say this and saw your comment, Sven. Consider me a banana!
+1

I had no idea you could resize the panel until I searched for "sublime text multi line find" and found this page. It is very hard to know that you can resize the panel without looking it up or hearing about it from someone. I think Sublime Text needs a toggle button to expose the feature. This is analogous to how regular expression search has a toggle button to tell people that regex search is possible, rather than relying on people knowing the hotkey Alt+R.


The toggle button could do more than just allow resizing the window. It could also change the behavior of the up and down arrow keys. I was just trying to edit each line of a multi-line regex search to add a capturing group to capture leading whitespace. But every time I pressed up or down, the whole search was replaced with the previous or next search text from history. That feature is handy when you're searching for only one line, but it was really annoying in this case. I had to use the mouse to click on each line so I could edit it. The toggle button could enable "multi-line search mode", which would disable history browsing with the arrow keys, and let the arrow keys work the way they normally do. In this mode, history browsing might be impossible, or you could show buttons or enable alternative keyboard shortcuts to browse history.

An alternative way to expose this feature better, apart from adding a toggle button, would be to add a visible resize handle above the Find/Replace panel. A resize handle takes up vertical space, whereas a toggle button takes up horizontal space in the find panel. You decide which is more valuable to most users.


By resize handle, I mean something like the triple bar symbol "≡", but wider and shorter. The whole panel would get more padding-top, and the resize handle would be centered at the top.

I know this is a dumb question, but... How do I carriage return in the FIND and REPLACE fields?


Update.. Found it. It's ctrl+RETURN, which seems a bit daft to me. All in all, this is a lot less friendly than TextMate, as are a lot of other aspects of ST. But then, I guess only jerks want their text editors to be user friendly. Real programmers love the struggle, right? 

Ctrl or Cmd. So, what's daft with that? TextMate 2 also uses Ctrl. I don't have 1.5 handy, but I'm pretty sure you'd press some modifier key together with return there as well.

@rory is a little wordy about it, but a little "handle" like three dots or a subtle 1px line would help UX here a ton. I, too, spent a comically extensive period of time trying to fix this :-)