Created attachment 121554 [details]
Proposed extension of buttons in Search&Replace bar
Current replace bar functionality (7.2 rc1) is as follows. Intending to replace string A by string B, I press Ctrl-H to open the Search&Replace bar. I start to type the string A in Find: field. This actually highlights the first occurrence of A. Now I type the string B in Replace: field.
Now pressing Replace replaces the highlighted occurrence of A by B, and highlights (and scrolls to) next A occurrence. This behavior is fine as long as I still need replacing. But at the moment when I know that the last occurrence of A that I intend to replace is highlighted, I want to replace it by B and to stay with cursor in this very place. But the current Replace moves me furhter what was not desired by me at this moment.
This situation is treated in many editors (see e.g. UltraStudio) by "Replace Last" action. Invoking Replace Last instead of Replace does the replacement but does not find the next occurrence.
I suggest to provide this functionality in NB search&replace bar as well.
Actually such a change would work well together with the enhancement proposed in issue #214807. See the attachment for illustration of how the new Replace Last button, together with supplied icons for Replace, Replace All and Replace Last and together with the new Open in Search Results Window button fit together.
I am also going to attach the new icons in separate attachment.
Remark: a possibly related discussion was held in issue #203269 but I am following the current observable behavior which seems different from the one described in #203269.
Created attachment 121555 [details]
new replace icons
(In reply to comment #0)
> Created attachment 121554 [details]
> Proposed extension of buttons in Search&Replace bar
I would change the position of "Replace Last" with "Replace All", as the latter goes further.
(In reply to comment #1)
> Created attachment 121555 [details]
> new replace icons
Maybe you like the alternative design draft from bug 41952, using fruits.
Oops, correction: bug 141952
Additionally please compare with bug 146818 and sophisticated find/replace dialogue from NotePad++.
I would appreciate to combine all good stuff together in NetBeans IDE.
Created attachment 121646 [details]
Proposed extension of buttons in Search&Replace bar
Good point about Last/All order, I've modified the attached proposal. The other ideas will be reviewed, yet the extensive functionality in Notepad++ is not realizable in a search bar and as such might probably be a topic of a separate enhancement request.
(In reply to comment #5)
> Good point about Last/All order, I've modified the attached proposal.
2 additional comments on your extension screen shot:
- In fact, "Last" is "Replace" and "Replace" is "Replace & Find" (or "Find & Replace")
- I would not waste 2 lines for the buttons, so if horizontally there is not enough space, buttons should be without text, but text should be displayed as tool tip while hoovering over the buttons. (maybe same for the checkboxes: cut the text to fit into the available space, but show complete text in tool tip)
> yet the extensive functionality in Notepad++ is not realizable in a search
> bar and as such might probably be a topic of a separate enhancement request.
Yes, correct, this was meant for the dialogue case.
But anyway, as I'm VERY MUCH missing a smart way to match on line borders etc., I beg for including a tiny option from Notepad++ in both, dialogue + search bar:
- a checkbox to allow '\l', '\r', '\t' interpreted as LF, CR, TAB, maybe extended for all Java String '\'-escapes ... bug 148989.
Maybe also have a look at bug 148984. Is it still valid?
Created attachment 131298 [details]
Screenshot buttons no text
I implemented different buttons - without text and no border as in toolbar buttons. I am looking for evaluation. if I should commit this change.
Look at screenshot
Created attachment 131299 [details]
Proposed patch for buttons without text.
Added Proposed patch for buttons without text.
1. I'm missing the "Replace Last" button.
2. Please look for a solution, fitting all in 1 line, as modern wide screens, especially on laptops, often are humble in vertical space.
3. I would order the fields and buttons as follows:
- Find: [Search Field] (no "What")
- [Button] with tool tip "Find previous"
- [Button] with tool tip "Find next"
- Replace: [Replace Field] (no "With")
- [Button] with tool tip "Replace( only this)" aka "Replace Last"
- [Button] with tool tip "Replace & Find next"
- [Button] with tool tip "Replace all"
- Checkboxes ...
4. List the checkboxes as many, as space available in 1 line, and open the "More ..." dialogue on mouse hover.
Alternative: checkboxes without text or just a small icon and display text as tool tip.
5. Where is the button to open the regular Find & Replace dialogue?
6. We should discuss, if the checkbox selections should be copied to/saved for the regular Find & Replace dialogue.
7. Discussion: "More ..." could display the regular Find & Replace dialogue.
8. If the regular Find & Replace dialogue is displayed and user hits one of the buttons in the tool bar, the regular Find & Replace dialogue should close automatically.
Created attachment 131354 [details]
sublime text search and replace bar
mk1: I am suggesting that netbeans should have icons instead of checkboxes for match case, whole word, regular expresion etc. I would be happy with similar solution as sublime text in attachment.
u1: Replace last will be in 8.0. I just forget to add it.
u2, u3, u4: I think 1 line would be too crowded. 2 lines are much better. You have default find and you just visually added replace functionality. You can close it if you don't have vertical space. You can turn off toolbars, etc. I don't see a point to have one line find, replace. Is there editor with one line?
u5, u6, u7: Editor search and Project search already share search history (also replace), but they have quite different case uses and different workflow. I don't like adding more connection between them.
u8: there is already special option for this in netbeans options.
(In reply to comment #11)
> mk1: I am suggesting that netbeans should have icons instead of checkboxes for
> match case, whole word, regular expresion etc. I would be happy with similar
> solution as sublime text in attachment.
Great, then we would have enough space to fit all in 1 line ;-)
(In reply to comment #12)
> u2, u3, u4: I think 1 line would be too crowded. 2 lines are much better. You
> have default find and you just visually added replace functionality. You can
> close it if you don't have vertical space. You can turn off toolbars, etc. I
> don't see a point to have one line find, replace.
Then please add an option to switch between both, so next NetCAT testers could share there opinion.
Also people with small screens want to benefit from the smart Find & Replace bar, so switching off is not an option.
What you think about my text changes, without "what", "with", "last" after "Replace", but "Replace & Find next"
> Is there editor with one line?
Is this a real criteria?
BTW, there ore other good solutions, e.g. in Notepad++, which NB IDE is still lacking: bug 146818, bug 148989.
Sidenote: we are mixing several Enhancements in this issue. Milo, would you please file separate issues for each of the new topics and keep here just the "Replace Last" issue ? The new ones would cover: replace checkboxes by pushbuttons while considering the reordering to the left from search fields (open question imho), and a separate issue would be the optional arrangement of search & replace to one line - this one would then block Issue #209259.
Created attachment 131573 [details]
New Find actions icons
Here are new icons proposal. Mito please integrate them and attach a screenshot to let us see if they fit in.
Created attachment 131576 [details]
Ok, I attach screenshot of findbar with new icons
Ralph had a comment that quotes in whole words and dot with star in regexp are too much separated therefore it looks there are different icons.
(In reply to comment #17)
> Ralph had a comment that quotes in whole words and dot with star in regexp are
> too much separated therefore it looks there are different icons.
True, we could not find out better representation of these choices so far when we discussed this with Honza. Any suggestion for alternatives is welcome. Should we stay with the current icons though, there might perhaps be some chance to find some graphic trick how to make the contents of each icon look less torn apart.. ideas in this direction are welcome as well..
Created attachment 131624 [details]
20.2.2013 New Searchbar
Recent version of new searchbar. Any comments?
(In reply to comment #19)
> Recent version of new searchbar. Any comments?
Where are Replace field and it's buttons?
I like the substitution of the check boxes by bi-stable buttons!
Are they commented by a tool tip?
I am waiting for replacebar icons. The buttons are now Jtogglebutton - same as rectangular edit in toolbar. There are tooltips.
1, I push to dev version searchbar with icons. http://hg.netbeans.org/jet-main/rev/978c289a27d5
2, Replacebar icons will be added as soon as I receive images. I will also add Replace last action
3, There is still need for icon for selection (Bug #219536)
4, I created new enhancement for optional one line replacebar (Bug #226469)
5, Consider bug 226491
I still worry about the naming of "Replace Last"
This could be misunderstood as "Replace (only) the last occurrence of the search pattern".
The real action which is meant is "Replace, but do not find next"
If you don't want to rename the standard "Replace" action to "Replace & Find Next", you could name it "Replace Only". To me this seems more precise than "Replace Last".
Integrated into 'main-golden', will be available in build *201302232300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Milutin Kristofic <email@example.com>
Log: #214986 - Replace search checkboxes with icons and Add "Replace Last" action
After several week of usage, I think this is a notable regression in usability.
I'm not commenting the "Replace Last" part, which is mixed in this ticket.
I see no gain in using icons in the search toolbar. It is more compact, but even small screens had enough horizontal space for the text that was in NB7.3.
Now for the regressions:
1. Harder to identify at first glance. My mind has to recognize a small icon and convert it to an non-obvious text equivalent. I still need to use the mouse and see the tooltips from time to time!
2. Harder to select if you don't know the shortcuts. No keyboard navigation, and the mouse click has a tiny target (less than 4 sq. mm on my screen). Some icons are too similar (whole word / regex).